Using a single sendcmd to read text from an external file and command a single
drawtext, is working fine:
ffmpeg -i input.mov -c:v dnxhd -b:v 115M -pix_fmt yuv422p -vf
"sendcmd=filename=commandFile1,drawtext=fontfile=/System/Library/Fonts/Helvetica.dfont:fontsize=20:fontcolor=white:x=10:y=30:text="
-an output.mov
However I need to have two or more drawtext filters being commanded from
separate sendcmd files in the same filtergraph.
I believe I need to assign filter instance names to each drawtext command and
then reference that name for [TARGET] in the sendcmd text file, but after
reading through the docs and trying a few ideas, I’m no closer.
The basic command (currently not working):
ffmpeg -i input.mov -c:v dnxhd -b:v 115M -pix_fmt yuv422p -vf
"sendcmd=filename=commandFile1,drawtext=fontfile=/System/Library/Fonts/Helvetica.dfont:fontsize=20:fontcolor=white:x=10:y=30:text=,sendcmd=filename=commandFile2,drawtext=fontfile=/System/Library/Fonts/Helvetica.dfont:fontsize=20:fontcolor=red:x=10:y=60:text="
-an output.mov
Result:
drawtext 1 - after 1 frame at each new text entry, text from commandFile2 is
overriding text from commandFile1.
drawtext 2 - nothing is being drawn by this filter.
...contents of the sendcmd files:
commandFile1
00:00:00.000-00:00:01.000 [enter] drawtext reinit 'text=Note A';
00:00:01.000-00:00:01.958 [enter] drawtext reinit 'text=Note B';
commandFile2
00:00:00.000-00:00:01.000 [enter] drawtext reinit 'text=Tag 1';
00:00:01.000-00:00:01.958 [enter] drawtext reinit 'text=Tag 2';
… and the output:
ffmpeg version N-85641-gdd49eff-tessus Copyright (c) 2000-2017 the FFmpeg
developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg
--extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl
--enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopus --enable-libschroedinger
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora
--enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs
--enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3
--disable-ffplay --disable-indev=qtkit
libavutil 55. 61.100 / 55. 61.100
libavcodec 57. 93.100 / 57. 93.100
libavformat 57. 72.101 / 57. 72.101
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 86.100 / 6. 86.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument
'debug'.
Reading option '-i' ... matched as input url with argument 'input.mov'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument
'dnxhd'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use
-b:v)) with argument '115M'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format)
with argument 'yuv422p'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with
argument
'sendcmd=filename=commandFile1,drawtext=fontfile=/System/Library/Fonts/Helvetica.dfont:fontsize=20:fontcolor=white:x=10:y=30:text=,
sendcmd=filename=commandFile2,drawtext=fontfile=/System/Library/Fonts/Helvetica.dfont:fontsize=20:fontcolor=red:x=10:y=60:text='.
Reading option '-an' ... matched as option 'an' (disable audio) with argument
'1'.
Reading option 'output.mov' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url input.mov.
Successfully parsed a group of options.
Opening an input file: input.mov.
[file @ 0x7f84705002a0] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] Format mov,mp4,m4a,3gp,3g2,mj2
probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] ISO: File Type Major Brand: qt
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] Unknown dref type 0x73696c61 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] Processing st: 0, edit list 0 -
media time: 0, duration: 48000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] Unknown dref type 0x73696c61 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] Processing st: 1, edit list 0 -
media time: 0, duration: 96000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] Unknown dref type 0x73696c61 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] Processing st: 2, edit list 0 -
media time: 0, duration: 48000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f847100] Before avformat_find_stream_info()
pos: 29676271 bytes read:38355 seeks:1 nb_streams:3
[dnxhd @ 0x7f8471017600] Profile cid 1237.
[dnxhd @ 0x7f8471017600] 1920x1080, 4:2:2 8