ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.2k stars 9.93k forks source link

Feature request: Download of separate audio & video and their merge should happen in parallel #17378

Open koraa opened 6 years ago

koraa commented 6 years ago

For some sites, audio and video is downloaded separately. First the video, then the audio. During post processing both files are merged.

It would be nice, if all three of those processes could run in parallel, since this would allow users to start playing back the video before the download has completed.

ibispi commented 5 years ago

I am posting this for a friend who doesn't have a github account: "This would be wonderful! I download youtube vidoes as youtube-dl -f worstvideo+worstaudio http://somelink.com/vid-id and being able to 'preview' them while downloading would make things better in two ways:

WolfganP commented 5 years ago

Regarding the OP feature request, I think is a wonderful idea. The merging stage may be difficult to coordinate due is performed by a separate program (ffmpeg), but +1 for the concurrent download of video and audio streams.

@dstftw do you think it's possible to implement? (concurrent download for separate streams)

Craeckie commented 4 years ago

Anyone still working on this? Even merging could be in parallel using pipes like this

mkfifo temp1 temp2
ffmpeg -y -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts temp1 2> /dev/null & \
ffmpeg -y -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts temp2 2> /dev/null & \
ffmpeg -f mpegts -i "concat:temp1|temp2" -c copy -bsf:a aac_adtstoasc output.mp4

Just instead of the upper two ffmpeg commands, you would stream the download of the files into the pipes. This also avoids creating any intermediate files.

Source: https://trac.ffmpeg.org/wiki/Concatenate#Usingnamedpipestoavoidintermediatefiles

Lee-Carre commented 2 years ago

See Parallel youtube-dl.

maisiliym commented 2 years ago

The lack of interest in this feature qualifies as a paranormal event.