[FFmpeg-user] How to hardcode subtitles

Andy dssnosher at gmail.com
Mon Mar 16 04:05:47 EET 2020


Can someone please shed some light on how to hardcode subtitles onto a file
that already has a subtitles(not hardcoded)?

Mediainfo provides the following information

ffprobe version 4.1.3-static https://johnvansickle.com/ffmpeg/
Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-gray --enable-libaom
--enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus
--enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc
--enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxml2 --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, matroska,webm, from
'LImmortale.2019.BluRay.1080xH264.Ita.AC3.5.1.Sub.Eng.Ita.mkv':
  Metadata:
    title           : Encoded By realDMDJ
    creation_time   : 2020-03-14T08:39:17.000000Z
    ENCODER         : Lavf58.20.100
  Duration: 01:55:25.15, start: 0.000000, bitrate: 3249 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive),
1920x1080 [SAR 90:67 DAR 160:67], 24 fps, 24 tbr, 1k tbn, 48 tbc
(default)
    Metadata:
      DURATION        : 01:55:25.130000000
    Stream #0:1(ita): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
(default)
    Metadata:
      title           : Surround
      DURATION        : 01:55:25.152000000
    Stream #0:2(ita): Subtitle: ass (default) (forced)
    Metadata:
      DURATION        : 01:47:24.380000000
    Stream #0:3(ita): Subtitle: ass
    Metadata:
      DURATION        : 01:47:25.755000000
    Stream #0:4(eng): Subtitle: ass
    Metadata:
      DURATION        : 01:47:25.755000000


Mediainfo provides the following information:
General
Unique ID                                :
339833835165267786502206373342323544125
(0xFFA99DAD54CAD8304A7E412718A6103D)
Complete name                            :
LImmortale.2019.BluRay.1080xH264.Ita.AC3.5.1.Sub.Eng.Ita.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 2.62 GiB
Duration                                 : 1 h 55 min
Overall bit rate                         : 3 250 kb/s
Movie name                               : Encoded By realDMDJ
Encoded date                             : UTC 2020-03-14 08:39:17
Writing application                      : HandBrake 1.2.2 2019022300
Writing library                          : Lavf58.20.100
ErrorDetectionType                       : Per level 1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main at L4
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 1 h 55 min
Bit rate                                 : 2 800 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 24.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.056
Stream size                              : 2.21 GiB (84%)
Writing library                          : x264 core 157 r2935 545de2f
Encoding settings                        : cabac=1 / ref=2 /
deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 /
psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1
/ 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 /
chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 /
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=1 / keyint=240 /
keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 /
rc=abr / mbtree=1 / bitrate=2800 / ratetol=1.0 / qcomp=0.60 / qpmin=0
/ qpmax=69 / qpstep=4 / vbv_maxrate=20000 / vbv_bufsize=25000 /
nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 1 h 55 min
Bit rate mode                            : Constant
Bit rate                                 : 448 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -5 ms
Stream size                              : 370 MiB (14%)
Title                                    : Surround
Language                                 : Italian
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

Text #1
ID                                       : 3
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Duration                                 : 1 h 47 min
Compression mode                         : Lossless
Language                                 : Italian
Default                                  : Yes
Forced                                   : Yes

Text #2
ID                                       : 4
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Duration                                 : 1 h 47 min
Compression mode                         : Lossless
Language                                 : Italian
Default                                  : No
Forced                                   : No

Text #3
ID                                       : 5
Format                                   : ASS
Codec ID                                 : S_TEXT/ASS
Codec ID/Info                            : Advanced Sub Station Alpha
Duration                                 : 1 h 47 min
Compression mode                         : Lossless
Language                                 : English
Default                                  : No
Forced                                   : No


More information about the ffmpeg-user mailing list