mlsmithjr / transcoder

Python wrapper for ffmpeg for batch and/or concurrent transcoding
GNU General Public License v3.0
117 stars 27 forks source link

rules: support subtitle codec rules #19

Open slippycheeze opened 4 years ago

slippycheeze commented 4 years ago

G'day. Transcoding from mp4 to mkv with embedded subtitles, using copy, fails: the mkv container can't hold the mov_text subtitle format. It works fine with, eg, -c:s webvtt, srt, or ass.

I don't want to transcode subtitle streams unnecessarily; while the ffmpeg subtitle codecs are generally good, they sometimes mess something up.

It'd be great to get an scodec predicate to enable this, matching the subtitle stream format(s). Right now I work around this using the path – transcode subtitles on any mp4 stream – which works, but is a blunt hammer for a specific requirement.

example metadata output

    Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, left), 1920x1040, 2888 kb/s, 24 fps, 24 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2017-05-22T22:10:51.000000Z
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2017-05-22T22:10:51.000000Z
    Stream #0:2(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 640 kb/s
    Metadata:
      creation_time   : 2017-05-22T22:10:51.000000Z
    Side data:
      audio service type: main
    Stream #0:3(eng): Subtitle: mov_text (tx3g / 0x67337874), 1920x60, 0 kb/s (default)
    Metadata:
      rotate          : 0
      creation_time   : 2017-05-22T22:10:51.000000Z
    Stream #0:4(und): Data: bin_data (text / 0x74786574)
    Metadata:
      creation_time   : 2017-05-22T22:10:51.000000Z

error message

[matroska @ 000001d285d691c0] Subtitle codec 94213 is not supported.
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
Error initializing output stream 0:0 --