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

Bug report: first subtitle on the list has default flag set, no option to change this behaviour #129

Closed
ftpmorph opened this issue Dec 18, 2020 · 12 comments
Labels
feature request New idea for project
Projects

Comments

@ftpmorph
Copy link

Just found this project after trying to transcode some HDR content and learning HB doesn't support it yet.

So far so good with this, it does what it says on the tin and works very well. Thanks for making it!

I do have one small bug report however. In the current stable build, 3.4.3, if I select a subtitle track for an x265 encode it gets set as default in the MKV container. This means when I play the video the subtitles are enabled automatically. Nothing in the UI allows me to toggle this, compared to HB where I can tick a box if I want a subtitle track to be flagged as default... except in Mac OS where funnily enough HB has an identical bug.

Easy to fix this with some quick remuxing but nonetheless it'd be great if you could add a little box the user can select if they want the subtitle to be default or not, or simply change the command passed to x265 to explicitly tell it the subtitle track isn't default so the flag is disabled.

Thanks again for making this useful piece of software.

@cdgriffith cdgriffith added the feature request New idea for project label Dec 18, 2020
@cdgriffith
Copy link
Owner

Marking this as feature request for now, because this a bug in FFmpeg for MKV containers that I can't control the behavior of. Would either need to have the option to add a fake emtpy first track to make sure that doesn't happen or bring mkvmerge or something else into the mix to handle that after the fact.

@ftpmorph
Copy link
Author

Thanks for such a rapid response!

I'm sure ffmpeg must be aware of the bug so hopefully they're working on a fix that'll be out soon. I might see if I can find anything about it in their issue tracker. Perhaps it's fixed for the next release so I could install a dev build or compile ffmpeg myself to fix the issue.

If not, mkvmerge would certainly fix it. That's what I'm using to correct the problem myself and it seems like a "cleaner" solution than adding an empty subtitle track. Although I'm sure that would be an effective quick and dirty way to sort it if implementing mkvmerge is a hassle or time consuming to bring another dependency in :)

@cdgriffith
Copy link
Owner

Looking at the docs for it: https://ffmpeg.org/ffmpeg.html

-disposition[:stream_specifier] value (output,per-stream)

    Sets the disposition for a stream.

    This option overrides the disposition copied from the input stream. 
    It is also possible to delete the disposition by setting it to 0. 

I might actually be setting it wrong, because I do -disposition:s:<output> like metadata requires(for example -metadata:s:a:0), and it might be using the :s to look for subtitles specifically. I will do some tests this weekend, this might actually be something I can fix. Will update when I figure it out.

@cdgriffith
Copy link
Owner

Well, guess we both have the bugs. Becacuse I was setting wrong track as expected, but still didn't make a difference.

Setting to 0 properly shows in ffmpeg that nothing is being set, but still is set to default via MediaInfo.

-disposition:2 0
FFmpeg output:  Stream #0:2('eng'): Subtitle: hdmv_pgs_subtitle ([255][255][255][255] / 0xFFFFFFFF)

Media Info: 
Text
ID                                       : 3
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 20 s 587 ms
Language                                 : 'eng'
Default                                  : Yes
Forced                                   : No

Setting it to forced or default does show properly in ffmpeg, and is forced in MediaInfo, but still also default.

-disposition:2 forced
FFmepg output: Stream #0:2('eng'): Subtitle: hdmv_pgs_subtitle ([255][255][255][255] / 0xFFFFFFFF) (forced)


Media Info: 
Text
ID                                       : 3
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 20 s 587 ms
Language                                 : 'eng'
Default                                  : Yes
Forced                                   : Yes

So as experienced before, there is a bug of some kind with FFmpeg and MKV containers. But I also need to fix how disposition is set per track.

@ftpmorph
Copy link
Author

Looking on the bright side, whenever the ffmpeg bug gets fixed upstream this problem will now for sure disappear from FastFlix! Thanks for looking into this so quickly.

@cdgriffith
Copy link
Owner

For anyone looking into this for now, can fix the generated video using mkvtoolnix mkvpropedit from the command line without the need for remuxing.

mkvpropedit video.mkv --edit track:s1 --set flag-default=0

@cdgriffith
Copy link
Owner

In 4.0 this will be a "hidden" feature, aka will attempt to fix automatically in background after an encoding if mkvprobedit is found on the PATH. Currently in beta 4.0.0b7:

https://github.com/cdgriffith/FastFlix/releases/tag/4.0.0b7

@cdgriffith cdgriffith added this to To do in FastFlix Dec 27, 2020
@ftpmorph
Copy link
Author

Perfect, nice clean fix thank you!

@wiedemanu
Copy link

The default flag for subtitles can be disabled with the following ffmpeg command:
-default_mode infer_no_subs

I found this solution here:
https://stackoverflow.com/questions/65672037/disable-default-subtitle-track-with-ffmpeg

I just insert the line under "Custom ffmpeg options", but it would be great if this could be integrated as a selectable option in the FastFlix GUI.

@cdgriffith
Copy link
Owner

That is perfect @wiedemanu, thank you! I will look to add that as default behavior when no subtitles tracks are marked as default or forced

@wiedemanu
Copy link

Perfect! Thank you for adding this feature @cdgriffith
I am glad I could help a little.

cdgriffith added a commit that referenced this issue May 6, 2021
…opedit (thanks to wiedemanu)

* Fixing network paths not working on Windows
@cdgriffith cdgriffith moved this from To do to In progress in FastFlix May 6, 2021
cdgriffith added a commit that referenced this issue May 11, 2021
…opedit (thanks to wiedemanu)

* Fixing network paths not working on Windows
cdgriffith added a commit that referenced this issue May 11, 2021
* Fixing #129 no subtitles should be enabled, removing need for mkvpropedit (thanks to wiedemanu)
* Fixing network paths not working on Windows
* Adding support for source_directory and output_name_format in config file (thanks to cwills75)
* Changing difference between requirements and requirements-build and removing the build version
cdgriffith added a commit that referenced this issue May 11, 2021
* Adding support for source_directory and output_name_format in config file (thanks to cwills75)
* Fixing #129 no subtitles should be enabled, removing need for mkvpropedit (thanks to wiedemanu)
* Fixing network paths not working on Windows
* Changing difference between requirements and requirements-build and removing the build version
@cdgriffith cdgriffith moved this from In progress to Done in FastFlix May 11, 2021
@cdgriffith
Copy link
Owner

Thanks again for that elegant ffmpeg based solution, this should now be supported fully in https://github.com/cdgriffith/FastFlix/releases/tag/4.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New idea for project
Projects
No open projects
FastFlix
  
Done
Development

No branches or pull requests

3 participants