Open KingMob opened 6 years ago
Do you fancy creating a pull to drop this in? I hit up against it the other day, but haven't had time to implement myself as I had to press on with what I was using.
The main challenge, though, will probably be getting exit statuses when we fork off multiple processes to handle different bitrates, and deciding how to handle them if a single bitrate fails.
If not, then as a (horrible) workaround, you can also look at how long the script ran for - if it completes within a few seconds then it failed. Not pretty by any means...
Man, I wish I could help, but I doubt my shell-fu is up to the task.
If you want to simplify and remove the forking, I do know ffmpeg can use multiple threads/cores, and that it can produce multiple variants with different params from a single invocation, so multiple processes are probably not necessary for maximum speed.
E.g.:
$ ffmpeg -i input \
... [encoding parameters 1] ... output-variant1 \
... [encoding parameters 2] ... output-variant2 \
... [encoding parameters 3] ... output-variant3
Yeah I toyed with that a little while back, but can't remember why I went the other route (probably have a note somewhere). I've a feeling it was because I needed to do something funky with some named pipes at the same time for a muxing appliance I was building. Will have to have a dig to see if I can find the info - otherwise may well be worth doing.
In the meantime, I've added this to the wishlist in JIRA - HLS-29
I tried at one point to build up the command-line for each variant in a loop, but I couldn't quite figure out how to properly quote things for filenames with spaces. Best of luck.
I was trying to use this as part of a general video pipeline, but the script doesn't exit with error codes if there are any problems (other than the one check to verify that ffmpeg exists). This makes it hard to know if it succeeded or not.