如何让 LG LS3450 电视正确显示字幕?

How to get LG LS3450 TV to properly show subtitles?

手册应该支持 mkv 文件:视频:H.264 /AVC、XViD、MPEG-4 Part2 音频:HE-AAC、Dolby Digital、MPEG-1 Layer III (MP3) 也支持 .ass 字幕.那么我到底应该怎么做才能以正确的格式和其他所有内容播放它?

使用此命令将 FLAC 音频转换为 AAC:

ffmpeg -i CodeGeass01.mkv -c:a libfdk_aac -profile:a aac_he_v2 CodeGeass01_1.mkv

可以播放,但没有自定义字体和字幕定位也不起作用。所以看来我需要制作硬字幕视频,需要刻录字幕。并将音频编码为aac。那么我该如何使用正确的格式、定位等来做到这一点?

ffmpeg -i CodeGeass01.mkv 的输出:

ffmpeg version 4.3.2-0+deb11u1ubuntu1 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10 (Ubuntu 10.2.1-20ubuntu1)
  configuration: --prefix=/usr --extra-version=0+deb11u1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  WARNING: library configuration mismatch
  avcodec     configuration: --prefix=/usr --extra-version=0+deb11u1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[matroska,webm @ 0x561477f71200] Could not find codec parameters for stream 3 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x561477f71200] Could not find codec parameters for stream 4 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x561477f71200] Could not find codec parameters for stream 5 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x561477f71200] Could not find codec parameters for stream 6 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x561477f71200] Could not find codec parameters for stream 7 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x561477f71200] Could not find codec parameters for stream 8 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x561477f71200] Could not find codec parameters for stream 9 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x561477f71200] Could not find codec parameters for stream 10 (Attachment: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from '[ShadyCrab] Code Geass Lelouch of the Rebellion - S01E01v2 [BD][1080p][Hi10][Dual][8F912937] (1).mkv':
  Metadata:
    encoder         : libebml v1.4.2 + libmatroska v1.6.4
    creation_time   : 2021-10-11T22:08:26.000000Z
  Duration: 00:24:10.45, start: 0.000000, bitrate: 6340 kb/s
    Chapter #0:0: start 0.000000, end 104.104000
    Metadata:
      title           : Chapter 01
    Chapter #0:1: start 104.104000, end 194.194000
    Metadata:
      title           : Chapter 02
    Chapter #0:2: start 194.194000, end 793.793000
    Metadata:
      title           : Chapter 03
    Chapter #0:3: start 793.793000, end 1359.358000
    Metadata:
      title           : Chapter 04
    Chapter #0:4: start 1359.358000, end 1450.449000
    Metadata:
      title           : Chapter 05
    Stream #0:0(jpn): Video: h264 (High 10), yuv420p10le(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 5597190
      DURATION        : 00:24:10.449000000
      NUMBER_OF_FRAMES: 34776
      NUMBER_OF_BYTES : 1014804966
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-10-11 22:08:26
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(jpn): Audio: flac, 48000 Hz, stereo, s16 (default)
    Metadata:
      BPS             : 735933
      DURATION        : 00:24:10.449000000
      NUMBER_OF_FRAMES: 16998
      NUMBER_OF_BYTES : 133429238
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-10-11 22:08:26
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2: Subtitle: ass (default)
    Metadata:
      BPS             : 158
      DURATION        : 00:23:31.690000000
      NUMBER_OF_FRAMES: 470
      NUMBER_OF_BYTES : 27973
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-10-11 22:08:26
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3: Attachment: none
    Metadata:
      filename        : AbbeyHU.ttf
      mimetype        : font/ttf
    Stream #0:4: Attachment: none
    Metadata:
      filename        : Formal421N.ttf
      mimetype        : font/ttf
    Stream #0:5: Attachment: none
    Metadata:
      filename        : ARIBLK_0.TTF
      mimetype        : font/ttf
    Stream #0:6: Attachment: none
    Metadata:
      filename        : INSULA__.ttf
      mimetype        : font/ttf
    Stream #0:7: Attachment: none
    Metadata:
      filename        : BOOKOSI.TTF
      mimetype        : font/ttf
    Stream #0:8: Attachment: none
    Metadata:
      filename        : BOOKOSBI.TTF
      mimetype        : font/ttf
    Stream #0:9: Attachment: none
    Metadata:
      filename        : BOOKOSB.TTF
      mimetype        : font/ttf
    Stream #0:10: Attachment: none
    Metadata:
      filename        : H_DEVTBI.TTF
      mimetype        : font/ttf

so it seems i need to make a hardsub video, need to burn in the subtitles. and encode the audio to aac. so how do i exactly do that, with the correct formatting, positioning etc?

使用subtitles filter:

ffmpeg -i input.mkv -vf "subtitles=input.mkv" output.mp4
  • 你可以通过添加-t选项做一个简短的测试,比如-t 60输出限制为60秒。

  • 如果字体没有以正确的字体呈现,那么您可能必须:

    1. 转储所有带有-dump_attachment的字体文件:

      ffmpeg -dump_attachment:t "" -i INPUT
      
    2. 然后使用 subtitles filter 中的 fontsdir 选项,或者将字体安装到您的系统。