Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Execute youtube-dl with a faststart flag #5071
Comments
|
Use the #!/bin/sh
VIDEO=$1
TEMPFILE=$VIDEO.temp
mv "$VIDEO" "$TEMPFILE"
ffmpeg -i "$TEMPFILE" -c copy -movflags faststart "$VIDEO"
rm "$TEMPFILE"You just need to run |
|
If there's something wrong with the videos that youtube-dl downloads, please say so - I'd rather fix the problem for all users instead of one. |
|
It would be SO USEFUL to the the option of "faststart" so that the index can be at the begining of the file, making the file playable as you download it. |
|
@jaimeMF Thank you for your help. Isnt the script that you wrote executed after youtube-dl finishes? I am using youtube-dl on a livestream and it works fine, but because it creates a .part file that doesnt have the index (moov atom is missing) i cannot read that file with ffmpeg while its downloading... I basically want to be able to grab snippets from that file (that is downloading in real time from the live stream) with ffmpeg, but because ffmpeg doesnt find a moov atom on it, it doesnt work. |
|
Next time, please be upfront about what you want to do - that way, we can help you better. Judging from the updated post and this cross-posting, it seems like you don't really care about moov in the first place, but want to extract part of a video. So feel free to open a new issue with a detailed explanation of your use case. At least, you should say:
|
|
@phihag I am sorry for this but i thought i explained it on here very well. I am recording a live stream with youtube-dl and i want from time to time to get a video snippet from the created file (while the recording hasnt finished yet). I have found out that when doing recordings with ffmpeg you can make it so the index (moov atom) is being continuously written at the beginning of the file so that at any time you can get the partial file and it will play. Does that explain it better? Can you help? Thank you. Alex |
Where can i add the "faststart" flag in the source code or in the command line to get the moov atom at the beginning of the file?
I need this ASAP and its only for a youtube clip and only with ffmpeg.
I just need to know what file i can add that in.
Thank you.
Alex