[FFmpeg-user] Is it possible to burn in two .srt files simultaneously to the same file?

Media Mouth communque at gmail.com
Sun Aug 20 00:38:24 EEST 2023


I've got 2 different .srt files and was hoping to use them both simultaneously to create burns in two different locations into the same video.

Currently I've got a watermark plus one .srt working just fine.  Was hoping to add the additional .srt.

The following CLI works just fine (ie Time code & 1 .srt file)
ffmpeg -i SourcePath \
-vf 'drawtext=fontsize=15:fontfile=/Library/Fonts/DroidSansMono-webfont.ttf:timecode='01\\:45\\:20\\:13':rate=23.976:fontsize=43.5:fontcolor=white:x=(w-text_w-35):bordercolor=black:borderw=2:y=75, subtitles=${SrtPath1}:force_style='Alignment=4,Fontname=Helvetica,FontSize=12,PrimaryColour=&Hffffff' \
DestPath

The following CLI fails (ie Time code & 2 .srt files)
ffmpeg -i SourcePath \
drawtext=fontsize=15:fontfile=/Library/Fonts/DroidSansMono-webfont.ttf:timecode='01\\:45\\:20\\:13':rate=23.976:fontsize=43.5:fontcolor=white:x=(w-text_w-35):bordercolor=black:borderw=2:y=75, subtitles=${SrtPath1}:force_style='Alignment=4,Fontname=Helvetica,FontSize=12,PrimaryColour=&Hffffff, subtitles=${SrtPath2}:force_style='Alignment=0,Fontname=Helvetica,FontSize=12,PrimaryColour=&Hffffff \
DestPath

The error points to the use of Helvetica font, but since the successful CLI above uses Helvetica as well with no problem, it sounds like a mislead.

ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100

  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100

[dnxhd @ 0x159905860] frame size changed: 1920x1088 -> 1920x1080

Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, mxf, from 'SourcePath':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
    uid             : adab4424-2f25-4dc7-92ff-29bd000c0000
    generation_uid  : adab4424-2f25-4dc7-92ff-29bd000c0001
    company_name    : FFmpeg
    product_name    : OP1a Muxer
    product_version_num: 58.29.100.0.0
    product_version : 58.29.100
    product_uid     : adab4424-2f25-4dc7-92ff-29bd000c0002
    toolkit_version_num: 58.29.100.0.0
    material_package_umid: 0x060A2B340101010501010D0013B02329529471342CB0232900529471342CB000
    timecode        : 01:45:20:13
  Duration: 
00:00:28.40, start: 0.000000, bitrate: 37516 kb/s
  Stream #0:0: Video: dnxhd (DNXHD), yuv422p(bt709/unknown/unknown, progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 23.98 tbn
    Metadata:
      file_package_umid: 0x060A2B340101010501010D0013B02329529471342CB0232900529471342CB001
      file_package_name: Source Package
  Stream #0:1: Audio: pcm_s24le, 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid: 0x060A2B340101010501010D0013B02329529471342CB0232900529471342CB001
      file_package_name: Source Package

Stream mapping:
  Stream #0:0 -> #0:0 (dnxhd (native) -> mpeg2video (native))
  Stream #0:1 -> #0:1 (pcm_s24le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help

[AVFilterGraph @ 0x138e05620] No option name near 'Helvetica'
[AVFilterGraph @ 0x138e05620] Error parsing a filter description around: ,FontSize=12,PrimaryColour=&Hffffff
[AVFilterGraph @ 0x138e05620] Error parsing filterchain 'drawtext=fontsize=15:fontfile=/Library/Fonts/DroidSansMono-webfont.ttf:timecode='01\:45\:20\:13':rate=23.976:fontsize=43.5:fontcolor=white:x=(w-text_w-35):bordercolor=black:borderw=2:y=75, subtitles=Path/To/TcTest1.srt:force_style='Alignment=4,Fontname=Helvetica,FontSize=12,PrimaryColour=&Hffffff, subtitles=Path/To/TcTest2.srt:force_style='Alignment=10,Fontname=Helvetica,FontSize=12,PrimaryColour=&Hffffff' around: ,FontSize=12,PrimaryColour=&Hffffff
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0

Conversion failed!



More information about the ffmpeg-user mailing list