[FFmpeg-user] how to control quality of subtitles

Peter Münster pmlists at free.fr
Mon May 25 11:10:06 EEST 2020


On Fri, May 22 2020, Carl Eugen Hoyos wrote:

> your command line should produce an output file with dvdsub palette.

Hello Carl Eugen,

I've tried it with the -palette option, but the rendering of the
subtitles did not change in any way...


> Complete, uncut console output missing.

Sorry. Here is it:

--8<---------------cut here---------------start------------->8---
peter at ws:/tmp/ffmpeg-tests> ffmpeg -i orig-dvbsub.ts -map 0:0 -map 0:1 -map 0:2 -c:v libx264 -c:a copy -c:s dvdsub dvbsub2dvdsub.mkv
ffmpeg version 3.4.5 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7 (SUSE Linux)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg --enable-libzvbi --enable-vaapi --enable-vdpau --enable-libx264 --enable-libx265 --enable-libxvid
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[mpegts @ 0x557482334fc0] PES packet size mismatch
Input #0, mpegts, from 'orig-dvbsub.ts':
  Duration: 00:00:46.86, start: 3496.892811, bitrate: 3831 kb/s
  Program 132 
    Stream #0:0[0xa6]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x80](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x4b](deu): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)
    Stream #0:3[0x44]: Data: bin_data ([6][0][0][0] / 0x0006)
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (dvb_subtitle (dvbsub) -> dvd_subtitle (dvdsub))
Press [q] to stop, [?] for help
[libx264 @ 0x5574823a2a20] using SAR=64/45
[libx264 @ 0x5574823a2a20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x5574823a2a20] profile High, level 3.0
[libx264 @ 0x5574823a2a20] 264 - core 155 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=18 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, matroska, to 'dvbsub2dvdsub.mkv':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=-1--1, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.107.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(deu): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2(deu): Subtitle: dvd_subtitle (dvdsub) (hearing impaired)
    Metadata:
      encoder         : Lavc57.107.100 dvdsub
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 33 14:06.37 bitrate= 336.7kbits/s speed=12.7x    
[mpeg2video @ 0x5574823a0d80] Warning MVs not available
[mpeg2video @ 0x5574823a0d80] concealing 765 DC, 765 AC, 765 MV errors in B frame
[mpegts @ 0x557482334fc0] PES packet size mismatch
    Last message repeated 1 times
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 6 22
[mpeg2video @ 0x5574823a0d80] Warning MVs not available
[mpeg2video @ 0x5574823a0d80] concealing 360 DC, 360 AC, 360 MV errors in B frame
[mpegts @ 0x557482334fc0] PES packet size mismatch
[mpeg2video @ 0x5574823a0d80] skipped MB in I-frame at 5 16
[mpeg2video @ 0x5574823a0d80] Warning MVs not available
[mpeg2video @ 0x5574823a0d80] concealing 180 DC, 180 AC, 180 MV errors in I frame
[mpegts @ 0x557482334fc0] PES packet size mismatch
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 31 29
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 19 32
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 2 14
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 5 15
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 22 33
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 8 16
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 8 17
[mpeg2video @ 0x5574823a0d80] slice mismatch
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 15 19
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 5 20
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 5 21
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 4 22
[mpeg2video @ 0x5574823a0d80] Invalid mb type in P-frame at 12 23
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 9 24
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 28 25
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 1 26
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 16 27
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 9 34
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 35 28
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 4 29
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 31 35
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 35 30
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 17 31
[mpeg2video @ 0x5574823a0d80] Warning MVs not available
[mpeg2video @ 0x5574823a0d80] concealing 990 DC, 990 AC, 990 MV errors in P frame
[mpegts @ 0x557482334fc0] PES packet size mismatch:00:12.54 bitrate= 752.5kbits/s speed=12.5x    
[mpeg2video @ 0x5574823a0d80] skipped MB in I-frame at 13 13
[mpeg2video @ 0x5574823a0d80] Warning MVs not available
[mpeg2video @ 0x5574823a0d80] concealing 360 DC, 360 AC, 360 MV errors in I frame
[mpegts @ 0x557482334fc0] PES packet size mismatch
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 18 25
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 10 26
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 8 27
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 6 34
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 32 22
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 1 32
[mpeg2video @ 0x5574823a0d80] Invalid mb type in P-frame at 7 8
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 7 29
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 2 35
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 3 23
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 1 28
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 8 8
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 34 33
[mpeg2video @ 0x5574823a0d80] slice mismatch
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 7 24
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 10 9
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 1 10
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 12 31
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 1 11
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 9 12
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 8 13
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 2 14
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 4 15
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 27 16
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 34 17
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 1 18
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 18 19
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 7 20
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 2 21
[mpeg2video @ 0x5574823a0d80] 00 motion_type at 4 22
[mpeg2video @ 0x5574823a0d80] Warning MVs not available
[mpeg2video @ 0x5574823a0d80] concealing 1305 DC, 1305 AC, 1305 MV errors in P frame
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 41 31
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 15
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 16
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 17
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 18
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 19
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 20
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 21
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 22
[mpeg2video @ 0x5574823a0d80] skipped MB in I-frame at 1 32
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 33
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 34
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 35
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 23
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 1 24
[mpeg2video @ 0x5574823a0d80] Invalid mb type in I-frame at 0 25
[mpeg2video @ 0x5574823a0d80] Invalid mb type in I-frame at 0 26
[mpeg2video @ 0x5574823a0d80] skipped MB in I-frame at 1 27
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 28
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 29
[mpeg2video @ 0x5574823a0d80] ac-tex damaged at 0 30
[mpeg2video @ 0x5574823a0d80] skipped MB in I-frame at 1 31
[mpeg2video @ 0x5574823a0d80] Warning MVs not available
[mpeg2video @ 0x5574823a0d80] concealing 945 DC, 945 AC, 945 MV errors in I frame
[mpegts @ 0x557482334fc0] PES packet size mismatch
    Last message repeated 2 times
[NULL @ 0x55748233b820] Junk in packet
[dvbsub @ 0x55748235bae0] Invalid object location! 210-720 44-44 11
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x88
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x72
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x0
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0xf
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x13
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x0
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x1
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x7
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0xdc
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x0
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x3
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x40
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x3
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0xe9
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0x3
[dvbsub @ 0x55748235bae0] Unknown/unsupported pixel block 0xeb
[dvbsub @ 0x55748235bae0] Invalid object location! 210-720 45-44 11
[mpegts @ 0x557482334fc0] PES packet size mismatch:00:42.78 bitrate= 798.1kbits/s speed=14.2x    
frame= 1153 fps=340 q=-1.0 Lsize=    5053kB time=00:00:46.21 bitrate= 895.7kbits/s speed=13.6x    
video:3912kB audio:1079kB subtitle:39kB other streams:0kB global headers:0kB muxing overhead: 0.463722%
[libx264 @ 0x5574823a2a20] frame I:13    Avg QP:17.93  size: 26035
[libx264 @ 0x5574823a2a20] frame P:331   Avg QP:20.85  size:  6893
[libx264 @ 0x5574823a2a20] frame B:809   Avg QP:23.28  size:  1712
[libx264 @ 0x5574823a2a20] consecutive B-frames:  1.7%  4.3% 29.4% 64.5%
[libx264 @ 0x5574823a2a20] mb I  I16..4: 14.4% 77.0%  8.7%
[libx264 @ 0x5574823a2a20] mb P  I16..4:  4.3% 12.4%  0.5%  P16..4: 34.2% 10.8%  7.0%  0.0%  0.0%    skip:30.8%
[libx264 @ 0x5574823a2a20] mb B  I16..4:  0.4%  1.0%  0.0%  B16..8: 31.8%  3.2%  0.5%  direct: 3.7%  skip:59.4%  L0:42.7% L1:48.8% BI: 8.5%
[libx264 @ 0x5574823a2a20] 8x8 transform intra:72.8% inter:85.8%
[libx264 @ 0x5574823a2a20] coded y,uvDC,uvAC intra: 35.9% 37.8% 11.3% inter: 8.9% 14.9% 0.2%
[libx264 @ 0x5574823a2a20] i16 v,h,dc,p: 35% 36%  9% 20%
[libx264 @ 0x5574823a2a20] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 20% 43%  1%  1%  3%  1%  3%  2%
[libx264 @ 0x5574823a2a20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 16% 12%  5%  6% 10%  4%  9%  3%
[libx264 @ 0x5574823a2a20] i8c dc,h,v,p: 49% 24% 24%  3%
[libx264 @ 0x5574823a2a20] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x5574823a2a20] ref P L0: 57.6% 11.5% 22.1%  8.8%
[libx264 @ 0x5574823a2a20] ref B L0: 81.7% 14.9%  3.3%
[libx264 @ 0x5574823a2a20] ref B L1: 95.2%  4.8%
[libx264 @ 0x5574823a2a20] kb/s:692.93
--8<---------------cut here---------------end--------------->8---


> Looks like an issue of the Samsung TV but feel free to compare
> with other players.

The only other player, that I have is VLC.
But the rendering of the subtitles on the Samsung TV is good with other
files, for example when the subtitles come from a dvb-teletext stream,
or from an HD TV-channel (arte with dvb-subtitles).
That's why I guess, that ffmpeg can produce good looking subtitles, but
I don't know how...

Thanks for your efforts,
-- 
           Peter



More information about the ffmpeg-user mailing list