Opened 11 years ago

Closed 11 years ago

#3282 closed enhancement (fixed)

Read dvdsub palette from mov files

Reported by: Carl Eugen Hoyos Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: dvdsub mov
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

(As "reported" on irc.)
The sample from ticket #756 - http://samples.mplayerhq.hu/MPEG-4/NeroRecodeSample-MP4/NeroRecodeSample.mp4 - contains dvdsub subtitles that are shown by ffplay (and ffmpeg), colours are guessed as implemented by Alexandre Colucci and Reimar in cf16104a, instead the palette from the extradata should be used.
Command line for the irc sample that I will upload:

$ ffmpeg -i gundam_sample.mp4 -filter_complex [0:0][0:4]overlay -qscale 2 -t 20 out.avi
ffmpeg version N-59678-g2358458 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  8 2014 11:09:19 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.102 / 55. 22.102
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'gundam_sample.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2012-05-18 09:33:11
    title           : 機動戦士ガンダムUC ユニコーン episode.05 「黒いユニコーン」
  Duration: 00:53:34.31, start: 0.000000, bitrate: 86 kb/s
    Chapter #0.0: start 0.000000, end 126.960000
    Metadata:
      title           : AVANT-TITLE
    Chapter #0.1: start 126.960000, end 1559.432000
    Metadata:
      title           : PART A
    Chapter #0.2: start 1559.432000, end 2902.899000
    Metadata:
      title           : PART B
    Chapter #0.3: start 2902.899000, end 3214.313333
    Metadata:
      title           : ENDING
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 3988 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2012-05-19 09:30:30
      handler_name    : X264 ISOM Video Handler
    Stream #0:1(jpn): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 639 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:22
      handler_name    : JAPANESE
    Stream #0:2(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 639 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:25
      handler_name    : ENGLISH
    Stream #0:3(jpn): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 1920x1080, 7 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:28
      handler_name    : GPAC IsoMedia Handler
    Stream #0:4(eng): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 1920x1080, 8 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:28
      handler_name    : GPAC IsoMedia Handler
    Stream #0:5(fra): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 1920x1080, 7 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:29
      handler_name    : GPAC IsoMedia Handler
    Stream #0:6(spa): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 1920x1080, 8 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:29
      handler_name    : GPAC IsoMedia Handler
    Stream #0:7(zho): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 1920x1080, 9 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:29
      handler_name    : GPAC IsoMedia Handler
    Stream #0:8(zho): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 1920x1080, 9 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:29
      handler_name    : GPAC IsoMedia Handler
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    INAM            : 機動戦士ガンダムUC ユニコーン episode.05 「黒いユニコーン」
    ISFT            : Lavf55.22.102
    Chapter #0.0: start 0.000000, end 20.000000
    Metadata:
      title           : AVANT-TITLE
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 tbn, 23.98 tbc (default)
    Stream #0:1(jpn): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1, fltp, 448 kb/s (default)
    Metadata:
      creation_time   : 2012-05-18 09:33:22
      handler_name    : JAPANESE
Stream mapping:
  Stream #0:0 (h264) -> overlay:main (graph 0)
  Stream #0:4 (dvdsub) -> overlay:overlay (graph 0)
  overlay (graph 0) -> Stream #0:0 (mpeg4)
  Stream #0:1 -> #0:1 (aac -> ac3)
Press [q] to stop, [?] for help
frame=  480 fps= 71 q=2.0 Lsize=   20506kB time=00:00:20.02 bitrate=8391.0kbits/s
video:19376kB audio:1094kB subtitle:0 global headers:0kB muxing overhead 0.175884%

Command line for the Nero sample, can this be done differently?

$ ffmpeg -canvas_size 610x548 -i NeroRecodeSample.mp4 -filter_complex "[0:2]pad=720:550[pad],[pad][0:6]overlay" -qscale 2 out.avi
ffmpeg version N-59678-g2358458 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  8 2014 11:09:19 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      52. 62.100 / 52. 62.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.102 / 55. 22.102
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'NeroRecodeSample.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: mp41ndsh
    creation_time   : 2004-07-28 21:34:12
  Duration: 00:01:44.12, start: 0.000000, bitrate: 2383 kb/s
    Chapter #0.0: start 0.000000, end 104.120000
    Metadata:
      title           : Kapitel 23
    Stream #0:0(fre): Data: none (mp4s / 0x7334706D), 320 kb/s (default)
    Metadata:
      creation_time   : 2004-07-28 21:34:12
    Stream #0:1(fre): Data: none (mp4s / 0x7334706D), 288 kb/s (default)
    Metadata:
      creation_time   : 2004-07-28 21:34:12
    Stream #0:2(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D), yuv420p, 720x304 [SAR 1:1 DAR 45:19], 1977 kb/s, 25 fps, 25 tbr, 25k tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2004-07-28 21:34:12
    Stream #0:3(ger): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 192 kb/s (default)
    Metadata:
      handler_name    : Nero Digital Audio 5.1-Kanal Deuts
      creation_time   : 2004-07-28 21:34:12
    Stream #0:4(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 195 kb/s (default)
    Metadata:
      handler_name    : Nero Digital Audio 5.1-Kanal Englis
      creation_time   : 2004-07-28 21:34:12
    Stream #0:5(ger): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 610x548, 8 kb/s (default)
    Metadata:
      handler_name    : Deutsch
      creation_time   : 2004-07-28 21:34:12
    Stream #0:6(eng): Subtitle: dvd_subtitle (mp4s / 0x7334706D), 610x548, 8 kb/s (default)
    Metadata:
      handler_name    : Englisch
      creation_time   : 2004-07-28 21:34:12
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: mp41ndsh
    ISFT            : Lavf55.22.102
    Chapter #0.0: start 0.000000, end 104.120000
    Metadata:
      title           : Kapitel 23
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 720x550 [SAR 1:1 DAR 72:55], q=2-31, 200 kb/s, 25 tbn, 25 tbc (default)
    Stream #0:1(ger): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1, fltp, 448 kb/s (default)
    Metadata:
      handler_name    : Nero Digital Audio 5.1-Kanal Deuts
      creation_time   : 2004-07-28 21:34:12
Stream mapping:
  Stream #0:2 (mpeg4) -> pad (graph 0)
  Stream #0:6 (dvdsub) -> overlay:overlay (graph 0)
  overlay (graph 0) -> Stream #0:0 (mpeg4)
  Stream #0:3 -> #0:1 (aac -> ac3)
Press [q] to stop, [?] for help
frame= 2603 fps=345 q=2.0 Lsize=   33730kB time=00:01:44.16 bitrate=2652.8kbits/s
video:27891kB audio:5691kB subtitle:0 global headers:0kB muxing overhead 0.441613%

Change History (3)

comment:2 by Carl Eugen Hoyos, 11 years ago

Description: modified (diff)

comment:3 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: newclosed

Implemented by wm4 and Michael.

Note: See TracTickets for help on using tickets.