lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

Subtitle arguments are not handled by recent HandbrakeCLI nightlies #172

Closed lambdan closed 6 years ago

lambdan commented 7 years ago

I'm not sure as of which version, but newer HandBrakeCLI nightlies do not seem to work with your scripts --burn-subtitle x argument (and possibly other commands/arguments, haven't tested.)

It's evident by just running with your scripts --dry-run parameter (see the attached screenshot). With a HandbrakeCLI nightly nothing about subtitles is shown, so maybe it has something to do with the media scanning?

I know you might not wanna support nightly builds and I get around this by manually passing -H subtitle=1 -H subtitle-burned but I thought you should know :)

combined

lisamelton commented 7 years ago

@lambdan Thanks for the heads up! And for the detailed information.

Unfortunately, this wouldn't be the first time subtitles or other major functionality has broken in HandBrake nightly builds. :( And I suspect you're right that this is due to a media scanning failure, probably because the HandBrake developers changed the diagnostic output format that I'm parsing.

I'll take a look at this in the next few days.

lisamelton commented 7 years ago

@lambdan OK, I can confirm this bug. And my guess as to the reason for it was correct.

It looks like the change which caused the problem is the update to Libav 12.2 two weeks ago:

https://github.com/HandBrake/HandBrake/commit/72b4ee71638ab2f0b658f3076119b3d28f41f177

Apparently that changed the diagnostic output for subtitles.

I think I can fix this but it's going to take awhile. The hard part will be making the fix backward compatible and cross platform. Yikes.

lisamelton commented 7 years ago

@lambdan Looks like I was wrong about which change broke subtitle scanning. It was done all the way back on March 10 with this:

https://github.com/HandBrake/HandBrake/commit/bd22891d633e16d7aedddadd2e4dd716f615d847

And I doubt they plan on changing it back. God willing they won't change the formatting for audio tracks.

lisamelton commented 7 years ago

@lambdan I just filed this bug with the HandBrake team:

https://github.com/HandBrake/HandBrake/issues/962

Hopefully they will back out their change to test/test.c which causes this problem. Otherwise it's going to be difficult if not impossible to work around.

lisamelton commented 6 years ago

@lambdan I realize it's been over a month, but... I finally have a 99% workaround/bandaid fix for this. And after a little more testing today, I'm probably going to land it in the tree and release it sometime in the next few days. Stay tuned.

lambdan commented 6 years ago

@donmelton That's cool! I heard you even talk about the issue on an episode of Vector so I was excited to hear about one of my issues being escalated that far

lisamelton commented 6 years ago

@lambdan You heard that? :) Seriously, thanks for listening to our podcast.

Anyway, the fix will not use the new --json API provided in nightly builds of HandBrackeCLI that I talked about on the podcast. I don't plan on using that API until I can fully drop support for the current and previous release versions of HandBrake. This is because supporting both the old mechanism and the new API would cause an explosion of code in media handling.

Instead, what I've developed is a (I hope) clever hack which leverages information from LibAV in the existing diagnostic output of HandBrakeCLI. The only drawback with this hack is that language detection for subtitles in disc image directory input may still be wrong. That's why I characterize this as a 99% solution.

lisamelton commented 6 years ago

It looks like language detection for individual closed caption tracks may still be wrong, too. That actually might count as a feature. :)

lisamelton commented 6 years ago

@lambdan OK, the fix is checked in and I'll probably release it tomorrow.

lisamelton commented 6 years ago

@lambdan And this is now released. Just gem update video_transcoding to get version 0.18.0.