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.
Please allow invoked ffmpeg to read from stdin #8252
Comments
|
I've proposed #8256 to pass |
… 'Ctrl+C' (#8252) Otherwise the mp4 file can't be played.
|
Since I think 9d90e7d solves the problem you have, I'm closing the issue. If you really need to pass something to ffmpeg through stdin, we can reopen the issue. Thanks for report! |
Well 9d90e7d is an ad hoc fix, that is surely enough for this particular use case (sending "q" to stop ffmpeg gracefully, but why trapping Ctrl-C? and not "q"?), but there are certainly other uses for ffmpeg interactive mode: if you press "?" while ffmpeg is running, you'll get a menu explaining other interactive commands; most have to do with logging-debugging (and maybe they can be useful to debug problems in youtube-dl itself, so I wouldn't disable them). More generally, this doesn't seem a good approach: to allow for a very very specific use case ("gradually feeding youtube-dl with urls through a pipe", see #8139 (comment)) you break the default expected behaviour of ffmpeg (reading from stdin), then make an exception (9d90e7d) to fix the use case that I pointed out. What if someone else in the future will complain about some of the other ffmpeg interactive commands not working anymore? You'd have to add yet another ad hoc workaround? I proposed a more conservative solution (see #8139 (comment)): let ffmpeg behave as it's supposed to (so that you don't break "q" and other interactive commands), and if you really think the "gradually feeding youtube-dl with urls through a pipe" use case is really worth considering, add a new option to youtube-dl to pass "-nostdin" (that is a ffmpeg option) to the invoked ffmpeg, so that ffmpeg's stdin can be disabled on demand by the user if he needs to. |
|
(First of all: thanks for your detailed response and explanation)
To be consistent with the rest of youtube-dl, 'Ctrl-C' cancels the download in the rest of downloaders. Additionally, while supporting 'Ctrl-C' is simple, 'q' may require some rework of the downloader.
I know, but if someone needs to debug a problem they can just run the command that it's printed when you run
I think that being able to directly control ffmpeg is your expectation, I see ffmpeg just as an internal tool for youtube-dl and I don't think users should be able to control it fully. And in the case of passing input to ffmpeg, it wouldn't allow us to wrap ffmpeg like we do for rtmpdump to provide the same download progress messages (the user wouldn't see the output from ffmpeg)
I see youtube-dl not as program you interact with (that's the only place where youtube-dl ever consumes from stdin and it's not even documented), instead you just run it until it finishes and you can exit it if you want to cancel the download The example I shared was too specific, but I still think that being able to use youtube-dl in a script without having to care about it consuming stdin is nice. Since I don't share your view, I'll let other maintainers decide what approach should follow youtube-dl. |
|
Agree with @jaimeMF - if you want to interact with ffmpeg, run ffmpeg directly. |
|
[q] interactive input should still work for livestreams, otherwise finishing a download is difficult. |
Since you asked for it... you can find all the details in #8139