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

Merge on the go #112

Open
t184256 opened this issue Oct 14, 2022 · 0 comments
Open

Merge on the go #112

t184256 opened this issue Oct 14, 2022 · 0 comments

Comments

@t184256
Copy link

t184256 commented Oct 14, 2022

Just an idea. I think you can pipe the downloaded data directly into ffmpeg (or gstreamer), not consume temporary disk space or RAM and skip the post-download merging.

Proof of concept in bash:

ffmpeg -hide_banner -nostdin -stats -loglevel fatal \
  -i <(cd "$CACHEDIR/audio"; yt-dlp --live-from-start "$URL" -f 140 -o-) \
  -i <(cd "$CACHEDIR/video"; yt-dlp --live-from-start "$URL" -f 133 -o-) \
  -vcodec copy -acodec copy \
  -map 0 -map 1 -movflags +faststart outfile.ts

produces a file that is immediately playable and seekable with VLC.

So, maybe ytarchive could use in_fdN, out_fdN = os.pipe(), -i pipe:{out_fd1} -i pipe:{out_fd2} and write to those fds directly.

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

No branches or pull requests

1 participant