Opened 2 years ago

Last modified 11 months ago

#10015 open enhancement

[feature request] Set disposition(s) based on language, not the stream specifier

Reported by: chm Owned by:
Priority: wish Component: ffmpeg
Version: git-master Keywords: disposition language metadata
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description (last modified by chm)

As far as I know, setting a disposition for a stream is only based on stream specifier.

     -disposition:s:0 default

For videos with streams of multiple languages, it would be great if we can also set a disposition based on the language, regardless of its stream specifier number.

     -disposition:s:m:language:eng default

If there are multiple subtitles for the same language, and only want to set one as default, forced, or any other output, an additional option will be helpful too.

In this example, there are 3 Spanish subtitles, and want to set the 3rd Spanish subtitle as the default, maybe something like?

     -disposition:s:m:language:spa:2 default

(with 2 referring to Stream #0:4 (the 3rd Spanish subtitle stream))

Stream #0:0[0x1](und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 626x360, 1231 kb/s, 26.20 fps, 26.17 tbr, 10k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x3](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:2[0x4](spa): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
    Metadata:
      handler_name    : SubtitleHandler
  Stream #0:3[0x5](spa): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler
  Stream #0:4[0x6](spa): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler
  Stream #0:5[0x7](eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler
  Stream #0:6[0x8](fra): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler

Reason for request: I have hundreds of videos with multiple subtitles in different languages, however a lot of them are default/forced in another language and I want to set all of them to default in English WITHOUT removing the other languages.

Thank you!

Change History (3)

comment:1 by elenril, 2 years ago

Analyzed by developer: set
Reproduced by developer: set
Status: newopen

Setting disposition based on metadata has been implemented in 95af0bcc344e2f3742494c76b7f6bcfee909a8ef. So far it can only do all matching streams, not a specific n-th one.

in reply to:  1 comment:2 by chm, 2 years ago

Replying to elenril:

Setting disposition based on metadata has been implemented in 95af0bcc344e2f3742494c76b7f6bcfee909a8ef. So far it can only do all matching streams, not a specific n-th one.

Thank you so much! I've tried it, and it works amazingly.

comment:3 by chm, 11 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.