Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write youtube-time script. #90

Open
rootCircle opened this issue Mar 16, 2024 · 2 comments
Open

Write youtube-time script. #90

rootCircle opened this issue Mar 16, 2024 · 2 comments

Comments

@rootCircle
Copy link
Member

Make a script to download youtube video from given timeframes

E.g.: youtube-time 2:00 4:00 tutorial.mkv "https://www.youtube.com/watch?v=SPwyp2NG-bE"
The above command should create a output file which contains the video from 2 min to 4 min.

After writing script send a PR mentioning this issue by putting "#" in your PR (optionally also in the commit).

Refer: youtube-dl and ffmpeg commands for this.

After writing script send a PR mentioning this issue by putting "#<number of this issue>" in your PR (optionally also in the commit).


PS:

Note: There can be two ways of implementing these:

  1. Download the full video then trim it to the liking.
  2. Get the download url and then get only the required frames, then finally merge it.

Depending on the implementation, different points can be assigned.

@shuklamaneesh23
Copy link

shuklamaneesh23 commented Mar 16, 2024

@rootCircle ,Can you please assign this issue to me .Here is a brief overview on how I am going to solve this issue.

Will design a script to download a video from a given URL using youtube-dl and then trim the downloaded video file to a specified start and end time using ffmpeg.

The script checks if exactly four arguments are provided: start time, end time, output file name, and video URL. If not, it displays the correct usage and exits with an error code.

It uses youtube-dl to download the video from the provided URL. The format chosen for download is specified as the best video format available with MP4 extension for video and M4A extension for audio, which are then merged into a single MP4 file named "video.mp4".

It uses ffmpeg to trim the downloaded video ("video.mp4") from the specified start_time to end_time. The video and audio streams are copied directly without re-encoding, ensuring fast and lossless trimming.

After trimming the video, it removes the temporary file "video.mp4" to clean up disk space.

Overall, this script efficiently downloads and trims videos, providing a convenient way to extract specific segments from online videos.

@rootCircle
Copy link
Member Author

@shuklamaneesh23 I have assigned this to you! you can go ahead with your implementation! You will have 12 hr to come up with your PR before it get unassigned!

ping me if you need any help in that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants