Coder Social home page Coder Social logo

Comments (8)

bytedream avatar bytedream commented on July 22, 2024

What would be the benefit of this?

from crunchy-cli.

p47-6 avatar p47-6 commented on July 22, 2024

As far as i know forced subtitles are always shown, even when you are watching the movie in your preferred language. That way you still get subtitles for on screen text.

from crunchy-cli.

bytedream avatar bytedream commented on July 22, 2024

You can set the forced flag for one subtitle stream by providing the --default-subtitle flag.
Applying the forced flag to every CC subtitle by default will likely cause some issues. For example, if the mkv file contains multiple CC subtitles in different languages, they may be shown above each other or a random CC subtitle of the available forced options is picked.

from crunchy-cli.

p47-6 avatar p47-6 commented on July 22, 2024

I've mainly using PLEX as media library and have never seen that problem. I've also checked other media files just to be sure and there are definitly multiple ones marked as forced. Here is an example mkvinfo output:

| + Track
|  + Track number: 6 (track ID for mkvmerge & mkvextract: 5)
|  + Track UID: 8
|  + Track type: subtitles
|  + "Default track" flag: 0
|  + "Forced display" flag: 1
|  + "Lacing" flag: 0
|  + Language: ger
|  + Codec ID: S_HDMV/PGS
|  + Language (IETF BCP 47): de
|  + Name: Deutsch Forced (PGS)
| + Track
|  + Track number: 7 (track ID for mkvmerge & mkvextract: 6)
|  + Track UID: 15178870140572590589
|  + Track type: subtitles
|  + "Default track" flag: 0
|  + "Forced display" flag: 1
|  + "Lacing" flag: 0
|  + Language: ger
|  + Codec ID: S_VOBSUB
|  + Codec's private data: size 348
|  + Language (IETF BCP 47): de
|  + Name: Deutsch Forced (VobSub)
| + Track
|  + Track number: 8 (track ID for mkvmerge & mkvextract: 7)
|  + Track UID: 4939342997478923845
|  + Track type: subtitles
|  + "Default track" flag: 0
|  + "Forced display" flag: 1
|  + "Lacing" flag: 0
|  + Language: ger
|  + Codec ID: S_TEXT/UTF8
|  + Language (IETF BCP 47): de
|  + Name: Deutsch Forced (SRT)
| + Track
|  + Track number: 9 (track ID for mkvmerge & mkvextract: 8)
|  + Track UID: 6
|  + Track type: subtitles
|  + "Default track" flag: 0
|  + "Lacing" flag: 0
|  + Language: ger
|  + Codec ID: S_HDMV/PGS
|  + Language (IETF BCP 47): de
|  + Name: Deutsch SDH (PGS)
|  + "Hearing impaired" flag: 1
| + Track
|  + Track number: 10 (track ID for mkvmerge & mkvextract: 9)
|  + Track UID: 10260309544658459880
|  + Track type: subtitles
|  + "Default track" flag: 0
|  + "Lacing" flag: 0
|  + Language: ger
|  + Codec ID: S_VOBSUB
|  + Codec's private data: size 348
|  + Language (IETF BCP 47): de
|  + Name: Deutsch SDH (VobSub)
|  + "Hearing impaired" flag: 1
| + Track
|  + Track number: 11 (track ID for mkvmerge & mkvextract: 10)
|  + Track UID: 10
|  + Track type: subtitles
|  + "Default track" flag: 0
|  + "Lacing" flag: 0
|  + Codec ID: S_HDMV/PGS
|  + Language (IETF BCP 47): en
|  + Name: English SDH (PGS)
|  + "Hearing impaired" flag: 1
|  + "Original language" flag: 1
| + Track
|  + Track number: 12 (track ID for mkvmerge & mkvextract: 11)
|  + Track UID: 4621194038152181430
|  + Track type: subtitles
|  + "Default track" flag: 0
|  + "Lacing" flag: 0
|  + Codec ID: S_VOBSUB
|  + Codec's private data: size 348
|  + Language (IETF BCP 47): en
|  + Name: English SDH (VobSub)
|  + "Hearing impaired" flag: 1
|  + "Original language" flag: 1

Could it be that you are mixing the forced with the default flag ?

from crunchy-cli.

p47-6 avatar p47-6 commented on July 22, 2024

I've just verified with the mkv tech notes. They do no mention that it is not valid to have multiple forced subtitle tracks. Also there is an example for subtitle selection by the player: https://www.matroska.org/technical/notes.html#subtitle-selection
Here is the important bit:

However, the case where the Portuguese audio track is selected has an important catch: a Forced track in Portuguese is present. This may contain translations of onscreen text from the video track, or of portions of the audio that are not translated (music, for instance). This means that even if the user’s preferences wouldn’t normally call for captions here, the Forced track should be selected nonetheless, rather than selecting no track at all. On the other hand, if the user’s preferences do call for captions, the non-Forced tracks should be preferred, as the Forced track will not contain captioning for the dialogue.

Also, as of my understanding the "default" flagged subtitle track should not have the forced flag on if it is not a "(CC)" subtitle.

from crunchy-cli.

bytedream avatar bytedream commented on July 22, 2024

Okay I see, my bad. Thanks for providing the sources/links.

from crunchy-cli.

p47-6 avatar p47-6 commented on July 22, 2024

EDIT: I'm sorry for the confusion: It works, but not with older ffmpeg versions. I've first tested it firth with ffmpeg 4.1.8 and the result is the file below. After a little bit of research I've tried again with ffmpeg 6.0.2 and it works perfectly fine.

I've tested the ci/cd generated bin and it seems like it only tags the first added subtitle:

| + Track
|  + Track number: 5 (track ID for mkvmerge & mkvextract: 4)
|  + Track UID: 5
|  + "Lacing" flag: 0
|  + Name: German
|  + Language: de-DE
|  + "Default track" flag: 0
|  + "Forced display" flag: 1
|  + Codec ID: S_TEXT/ASS
|  + Track type: subtitles
|  + Codec's private data: size 1976
| + Track
|  + Track number: 6 (track ID for mkvmerge & mkvextract: 5)
|  + Track UID: 6
|  + "Lacing" flag: 0
|  + Name: German (CC)
|  + Language: de-DE
|  + "Default track" flag: 0
|  + Codec ID: S_TEXT/ASS
|  + Track type: subtitles
|  + Codec's private data: size 2510
| + Track
|  + Track number: 7 (track ID for mkvmerge & mkvextract: 6)
|  + Track UID: 7
|  + "Lacing" flag: 0
|  + Name: English (US)
|  + Language: en-US
|  + "Default track" flag: 0
|  + Codec ID: S_TEXT/ASS
|  + Track type: subtitles
|  + Codec's private data: size 3099
| + Track
|  + Track number: 8 (track ID for mkvmerge & mkvextract: 7)
|  + Track UID: 8
|  + "Lacing" flag: 0
|  + Name: English (US) (CC)
|  + Language: en-US
|  + "Default track" flag: 0
|  + Codec ID: S_TEXT/ASS
|  + Track type: subtitles
|  + Codec's private data: size 1260

I'm not a rust developer but if i read the code correctly wouldn't it be the easiest to add it directly while adding the subtitles somewhere around here: https://github.com/crunchy-labs/crunchy-cli/blob/8613ea80cc9bde3dccfcc1429823aea3cdcec484/crunchy-cli-core/src/utils/download.rs#L331C1-L347C10

from crunchy-cli.

bytedream avatar bytedream commented on July 22, 2024

Added in v3.2.0

from crunchy-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.