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

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

Open
koraa opened this issue Aug 29, 2018 · 3 comments

Comments

@koraa
Copy link

@koraa koraa commented Aug 29, 2018

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.

@koraa koraa changed the title Feature request: Download of audio, video and their merging should all run in parallel Feature request: Audio download, video download and post processing should happen in parallel Aug 30, 2018
@koraa koraa changed the title Feature request: Audio download, video download and post processing should happen in parallel Feature request: Audio download, video download and post processing (merging them) should happen in parallel Aug 30, 2018
@koraa koraa changed the title Feature request: Audio download, video download and post processing (merging them) should happen in parallel Feature request: Download of separate audio & video and their merge should happen in parallel Aug 30, 2018
@ibispi
Copy link

@ibispi ibispi commented Apr 29, 2019

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:

  • I could start watching the video immediately instead of waiting
    for the process to end.
  • I could decide to stop downloading the video if the first minutes of it
    are not of my liking."
@WolfganP
Copy link

@WolfganP WolfganP commented Apr 29, 2019

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
Copy link

@Craeckie Craeckie commented Jun 6, 2020

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

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.