How to use -a53cc for Closed Captions during conversion

Questions involving a Windows version of FFmpeg.
Post Reply
CaptainKen
Posts: 5
Joined: Thu Jan 05, 2017 3:37 pm

How to use -a53cc for Closed Captions during conversion

Post by CaptainKen » Sun Jan 14, 2018 6:29 am

I'm trying to convert TS files to MKV. I want to convert the MPEG to x264, keep 1st AC3 audio stream original and keep the 1st Closed Captain track/stream.

I found this article explaining how to use -ac53cc for Closed Captions":
https://lists.ffmpeg.org/pipermail/ffmp ... 33612.html

My implementation of articles syntax gave Video and Closed Captions subtitles, but no audio. This tells me that it's possible to keep the CC.
ffmpeg -i InputFile.TS -c:v libx264 -c:a -a53cc -an -f mpegts NEW_File.mkv

No Closed Caption subtitle in command, just to be sure I can do without subtitles:
ffmpeg -i InputFile.TS -c:v libx264 -c:a copy NEW_File.mkv

Video and Closed Captions subtitles, but no audio:
ffmpeg -i InputFile.TS -c:v libx264 -c:a -a53cc -an -f mpegts NEW_File.mkv

Code: Select all

D:\Temp>ffmpeg -i InputFile.TS -c:v libx264 -c:a -a53cc -an -f mpegts NEW_File.mkv
ffmpeg version N-82871-ga5cf600 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 68.100 / 57. 68.100
  libavformat    57. 60.100 / 57. 60.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
[mpeg2video @ 0000000002678b40] Warning: not compiled with thread support, using thread emulation
[ac3 @ 0000000002655400] Warning: not compiled with thread support, using thread emulation
[ac3 @ 00000000026564e0] Warning: not compiled with thread support, using thread emulation
Input #0, mpegts, from 'InputFile.TS':
  Duration: 00:21:52.97, start: 1.400000, bitrate: 9677 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:2[0x102](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
[mpeg2video @ 0000000004896740] Warning: not compiled with thread support, using thread emulation
[libx264 @ 0000000003028ea0] Warning: not compiled with thread support, using thread emulation
[libx264 @ 0000000003028ea0] using SAR=1/1
[libx264 @ 0000000003028ea0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0000000003028ea0] profile High, level 4.0
Output #0, mpegts, to 'NEW_File.mkv':
  Metadata:
    encoder         : Lavf57.60.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 90k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.68.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (libx264))
Gives error "At least one output file must be specified":
ffmpeg -i InputFile.TS -c:v libx264 -c:a copy -a53cc NEW_File.mkv

Code: Select all

D:\Temp>ffmpeg -i InputFile.TS -c:v libx264 -c:a copy -a53cc NEW_File.mkv
ffmpeg version N-82871-ga5cf600 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 43.100 / 55. 43.100
  libavcodec     57. 68.100 / 57. 68.100
  libavformat    57. 60.100 / 57. 60.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Trailing options were found on the commandline.
[mpeg2video @ 0000000002688a00] Warning: not compiled with thread support, using thread emulation
[ac3 @ 0000000002665180] Warning: not compiled with thread support, using thread emulation
[ac3 @ 00000000026662c0] Warning: not compiled with thread support, using thread emulation
Input #0, mpegts, from 'InputFile.TS':
  Duration: 00:21:52.97, start: 1.400000, bitrate: 9677 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:2[0x102](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
At least one output file must be specified
Error "[NULL @ 00000000047115c0] Unable to find a suitable output format for 'MKV' MKV: Invalid argument"
ffmpeg -i InputFile.TS -c:v libx264 -c:a copy -a53cc -f MKV NEW_File.mkv

No error, but no Closed Caption subtitles either:
ffmpeg -i InputFile.TS -c:v libx264 -c:a copy -c:s copy NEW_File.mkv
ffmpeg -i InputFile.TS -c:v libx264 -c:a copy -c:s -a53cc NEW_File.mkv

Code: Select all

General
ID                                       : 1 (0x1)
Complete name                            : D:\Temp\InputFile.ts
Format                                   : MPEG-TS
File size                                : 1.48 GiB
Duration                                 : 21 min 52 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 9 678 kb/s
Movie name                               : Program Name

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : [email protected]
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : Variable
Format settings, picture structure       : Frame
Codec ID                                 : 2
Duration                                 : 21 min 52 s
Bit rate mode                            : Variable
Bit rate                                 : 8 618 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.139
Stream size                              : 1.32 GiB (89%)

Audio #1
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Format settings, Endianness              : Big
Codec ID                                 : 129
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Bit rate                                 : 384 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 spf)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -39 ms
Stream size                              : 60.1 MiB (4%)
Language                                 : English
Service kind                             : Complete Main

Audio #2
ID                                       : 258 (0x102)
Menu ID                                  : 1 (0x1)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Format settings, Endianness              : Big
Codec ID                                 : 129
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 spf)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -115 ms
Stream size                              : 30.0 MiB (2%)
Language                                 : Spanish
Service kind                             : Complete Main

Text #1
ID                                       : 256 (0x100)-CC1
Menu ID                                  : 1 (0x1)
Format                                   : EIA-608
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)
CaptionServiceName                       : CC1

Text #2
ID                                       : 256 (0x100)-CC3
Menu ID                                  : 1 (0x1)
Format                                   : EIA-608
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)
CaptionServiceName                       : CC3

Text #3
ID                                       : 256 (0x100)-1
Menu ID                                  : 1 (0x1)
Format                                   : EIA-708
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)

Text #4
ID                                       : 256 (0x100)-2
Menu ID                                  : 1 (0x1)
Format                                   : EIA-708
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)

Text #5
ID                                       : 256 (0x100)-3
Menu ID                                  : 1 (0x1)
Format                                   : EIA-708
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)

Text #6
ID                                       : 256 (0x100)-4
Menu ID                                  : 1 (0x1)
Format                                   : EIA-708
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)

Text #7
ID                                       : 256 (0x100)-5
Menu ID                                  : 1 (0x1)
Format                                   : EIA-708
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)

Text #8
ID                                       : 256 (0x100)-6
Menu ID                                  : 1 (0x1)
Format                                   : EIA-708
Muxing mode                              : A/53 / DTVCC Transport
Muxing mode, more info                   : Muxed in Video #1
Duration                                 : 21 min 52 s
Bit rate mode                            : Constant
Stream size                              : 0.00 Byte (0%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 21 min 52 s
List                                     : 256 (0x100) (MPEG Video) / 257 (0x101) (AC-3, English) / 258 (0x102) (AC-3, Spanish)
Title                                    : Program Name
Language                                 :  / English / Spanish
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television

Post Reply