<p>You need to split the drawtext output and then map a split result for each output.</p>
<pre><code>ffmpeg \
-i ./source/video/women/1.mp4 \
-i ./source/audio/women.mp3 -y \
-filter_complex drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=1:boxcolor=black@1:y=280,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a0:boxcolor=black@0.8:enable='between(t,0,6.5)':y=700,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a1:boxcolor=black@0.8:enable='between(t,0,6.5)':y=800,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a2:boxcolor=black@0.8:enable='between(t,0,6.5)':y=900,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a3:boxcolor=black@0.8:enable='between(t,0,6.5)':y=1000,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b0:boxcolor=black@0.8:enable='between(t,7,10)':y=1000,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b1:boxcolor=black@0.8:enable='between(t,7,10)':y=1100,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b2:boxcolor=black@0.8:enable='between(t,7,10)':y=1200,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b3:boxcolor=black@0.8:enable='between(t,7,10)':y=1300,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b4:boxcolor=black@0.8:enable='between(t,7,10)':y=1400,drawtext=fontsize=30:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=c:enable='between(t,10.2,inf)':boxcolor=black@1:y=1500,drawtext=fontsize=30:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=d:enable='between(t,10.2,inf)':boxcolor=black@1:y=1550,split=2[o0][o1] \
-map [o0] \
-map 1:a:0 \
-shortest out1/_.mp4
-map [o1] \
-map 1:a:0 \
-shortest out2/_.mp4
</code></pre>

CC BY-SA 4.0
2023-08-01T20:14:22.227Z
Thanks, it's almost what I need, but not final. I've added update to question
kRicha
CC BY-SA 4.0
2023-08-02T04:07:58.823Z
ffmpeg logs to stderr and I don't see any error in the log. To not have audio in 2nd output, remove `-map 1:a:0` and also `-shortest`
Gyan
CC BY-SA 4.0
2023-08-02T19:19:59.597Z
yes, I've done this and get error) error is in question section.
kRicha
CC BY-SA 4.0
2023-08-03T04:24:25.497Z
I looked at the log and there's no error indicated, only encoding progress and stats.
Gyan
CC BY-SA 4.0
2023-08-03T15:44:06.633Z
seems something wrong, because music stops after 1st second in first video.
kRicha
CC BY-SA 4.0
2023-08-06T19:46:17.490Z
any thoughts? Or maybe I've make a mistake?
kRicha
CC BY-SA 4.0
2023-08-07T16:43:49.810Z
for some reasons ffmpeg -i ./source/video/kids/5.mp4 -i ./source/audio/history.mp3 -map 0:v  -map 1:a -y -shortest 1.mp4 with shortest flat audio drops on 2 second, without shortest flag audio is ok, but video is too long
kRicha
CC BY-SA 4.0
2023-08-01T04:15:24.037Z
2023-08-01T04:15:24.037Z
Gyan
<p>I've created command, which connects video file with music, use shortest(video) duration, and output this to result file</p>
<pre><code> ffmpeg \
-i ./source/video/women/1.mp4 \
-i ./source/audio/women.mp3 -y \
-filter:v drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=1:boxcolor=black@1:y=280,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a0:boxcolor=black@0.8:enable='between(t,0,6.5)':y=700,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a1:boxcolor=black@0.8:enable='between(t,0,6.5)':y=800,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a2:boxcolor=black@0.8:enable='between(t,0,6.5)':y=900,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a3:boxcolor=black@0.8:enable='between(t,0,6.5)':y=1000,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b0:boxcolor=black@0.8:enable='between(t,7,10)':y=1000,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b1:boxcolor=black@0.8:enable='between(t,7,10)':y=1100,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b2:boxcolor=black@0.8:enable='between(t,7,10)':y=1200,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b3:boxcolor=black@0.8:enable='between(t,7,10)':y=1300,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b4:boxcolor=black@0.8:enable='between(t,7,10)':y=1400,drawtext=fontsize=30:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=c:enable='between(t,10.2,inf)':boxcolor=black@1:y=1500,drawtext=fontsize=30:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=d:enable='between(t,10.2,inf)':boxcolor=black@1:y=1550 \
-map 0:v:0 \
-map 1:a:0 \
-shortest out2/_.mp4
</code></pre>
<p>If I add second output, it works, but without audio and drawtext. How could I fixe this and get draw text works on both outputs?</p>
<p><strong>UPD 1:</strong></p>
<pre><code>ffmpeg -i ./source/video/kids/1.mp4 -i ./source/audio/kids.mp3 -y \
-filter_complex drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='Facts about children':boxcolor=black@1:y=280,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='a0':boxcolor=black@0.8:y=700:enable='between(t,0,6.5)',drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='a1':boxcolor=black@0.8:y=800:enable='between(t,0,6.5)',drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='a2':boxcolor=black@0.8:y=900:enable='between(t,0,6.5)',drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='a3':boxcolor=black@0.8:y=1000:enable='between(t,0,6.5)',split=2[o0][o1] \
-map [o0] -map 1:a:0 -shortest 1.mp4 \
-map [o1] 2.mp4
</code></pre>
<p>now it works almost correctly, but gives the following error:</p>
<pre><code>Stderr output: frame=    0 fps=0.0 q=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A
Stderr output: frame=    0 fps=0.0 q=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A
Stderr output: frame=    8 fps=6.2 q=28.0 q=28.0 size=       0kB time=00:00:00.20 bitrate=   1.9kbits/s speed=0.156x
Stderr output: frame=   14 fps=7.7 q=28.0 q=28.0 size=       0kB time=00:00:00.44 bitrate=   0.9kbits/s speed=0.242x
Stderr output: frame=   22 fps=9.3 q=28.0 q=28.0 size=       0kB time=00:00:00.76 bitrate=   0.5kbits/s speed=0.321x
Stderr output: frame=   30 fps= 10 q=28.0 q=28.0 size=       0kB time=00:00:01.12 bitrate=   0.3kbits/s speed=0.389x
Stderr output: frame=   39 fps= 11 q=28.0 q=28.0 size=       0kB time=00:00:01.44 bitrate=   0.3kbits/s speed=0.424x
Stderr output: frame=   50 fps= 12 q=28.0 q=28.0 size=       0kB time=00:00:01.88 bitrate=   0.2kbits/s speed=0.462x
Stderr output: frame=   57 fps= 12 q=28.0 q=28.0 size=       0kB time=00:00:02.20 bitrate=   0.2kbits/s speed=0.478x
Stderr output: frame=   67 fps= 13 q=28.0 q=28.0 size=       0kB time=00:00:02.56 bitrate=   0.1kbits/s speed=0.496x
Stderr output: frame=   75 fps= 13 q=28.0 q=28.0 size=       0kB time=00:00:02.88 bitrate=   0.1kbits/s speed=0.502x
Stderr output: frame=   83 fps= 13 q=28.0 q=28.0 size=       0kB time=00:00:03.20 bitrate=   0.1kbits/s speed=0.507x
Stderr output: frame=   92 fps= 13 q=28.0 q=28.0 size=       0kB time=00:00:03.56 bitrate=   0.1kbits/s speed=0.52x
Stderr output: frame=  100 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:03.88 bitrate=   0.1kbits/s speed=0.527x
Stderr output: frame=  108 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:04.20 bitrate=   0.1kbits/s speed=0.533x
Stderr output: frame=  117 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:04.56 bitrate=   0.1kbits/s speed=0.534x
Stderr output: frame=  126 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:04.92 bitrate=   0.1kbits/s speed=0.543x
Stderr output: frame=  134 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:05.24 bitrate=   0.1kbits/s speed=0.547x
Stderr output: frame=  142 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:05.56 bitrate=   0.1kbits/s speed=0.551x
Stderr output: frame=  151 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:05.92 bitrate=   0.1kbits/s speed=0.559x
Stderr output: frame=  158 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:06.20 bitrate=   0.1kbits/s speed=0.558x
Stderr output: frame=  165 fps= 14 q=28.0 q=28.0 size=     256kB time=00:00:06.52 bitrate= 321.7kbits/s speed=0.559x
Stderr output: frame=  174 fps= 14 q=28.0 q=28.0 size=     512kB time=00:00:06.84 bitrate= 613.3kbits/s speed=0.559x
Stderr output: frame=  184 fps= 14 q=28.0 q=28.0 size=     768kB time=00:00:07.24 bitrate= 869.0kbits/s speed=0.568x
Stderr output: frame=  193 fps= 15 q=28.0 q=28.0 size=    1024kB time=00:00:07.60 bitrate=1103.8kbits/s speed=0.571x
Stderr output: frame=  252 fps= 16 q=-1.0 Lq=-1.0 size=    8271kB time=00:00:09.96 bitrate=6802.6kbits/s speed=0.626x
Stderr output: video:16476kB audio:28kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Stderr output: [libx264 @ 0xffffa27d79f0] frame I:2     Avg QP:23.97  size: 87068
Stderr output: [libx264 @ 0xffffa27d79f0] frame P:80    Avg QP:24.66  size: 47762
Stderr output: [libx264 @ 0xffffa27d79f0] frame B:170   Avg QP:25.98  size: 26117
Stderr output: [libx264 @ 0xffffa27d79f0] consecutive B-frames:  1.2% 23.0% 10.7% 65.1%
Stderr output: [libx264 @ 0xffffa27d79f0] mb I  I16..4: 12.8% 74.6% 12.6%
Stderr output: [libx264 @ 0xffffa27d79f0] mb P  I16..4: 12.3% 44.9%  2.2%  P16..4: 24.9%  7.9%  2.0%  0.0%  0.0%    skip: 5.7%
Stderr output: [libx264 @ 0xffffa27d79f0] mb B  I16..4:  6.4% 15.8%  0.4%  B16..8: 35.7%  7.8%  1.1%  direct: 4.7%  skip:28.2%  L0:48.4% L1:46.8% BI: 4.8%
Stderr output: [libx264 @ 0xffffa27d79f0] 8x8 transform intra:73.1% inter:88.7%
Stderr output: [libx264 @ 0xffffa27d79f0] coded y,uvDC,uvAC intra: 43.3% 71.1% 18.0% inter: 20.2% 36.8% 0.9%
Stderr output: [libx264 @ 0xffffa27d79f0] i16 v,h,dc,p: 32% 22% 10% 37%
Stderr output: [libx264 @ 0xffffa27d79f0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 17% 19%  5%  7%  7%  6%  7%  5%
Stderr output: [libx264 @ 0xffffa27d79f0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 19% 12%  5% 11% 10%  7%  7%  4%
Stderr output: [libx264 @ 0xffffa27d79f0] i8c dc,h,v,p: 45% 21% 25%  9%
Stderr output: [libx264 @ 0xffffa27d79f0] Weighted P-Frames: Y:0.0% UV:0.0%
Stderr output: [libx264 @ 0xffffa27d79f0] ref P L0: 63.6% 17.3% 14.5%  4.6%
Stderr output: [libx264 @ 0xffffa27d79f0] ref B L0: 89.1%  9.4%  1.5%
Stderr output: [libx264 @ 0xffffa27d79f0] ref B L1: 97.7%  2.3%
Stderr output: [libx264 @ 0xffffa27d79f0] kb/s:6694.37
Stderr output: [aac @ 0xffffa26739b0] Qavg: 530.098
Stderr output: [libx264 @ 0xffffa21358d0] frame I:2     Avg QP:23.97  size: 87068
Stderr output: [libx264 @ 0xffffa21358d0] frame P:80    Avg QP:24.66  size: 47762
Stderr output: [libx264 @ 0xffffa21358d0] frame B:170   Avg QP:25.98  size: 26117
Stderr output: [libx264 @ 0xffffa21358d0] consecutive B-frames:  1.2% 23.0% 10.7% 65.1%
Stderr output: [libx264 @ 0xffffa21358d0] mb I  I16..4: 12.8% 74.6% 12.6%
Stderr output: [libx264 @ 0xffffa21358d0] mb P  I16..4: 12.3% 44.9%  2.2%  P16..4: 24.9%  7.9%  2.0%  0.0%  0.0%    skip: 5.7%
Stderr output: [libx264 @ 0xffffa21358d0] mb B  I16..4:  6.4% 15.8%  0.4%  B16..8: 35.7%  7.8%  1.1%  direct: 4.7%  skip:28.2%  L0:48.4% L1:46.8% BI: 4.8%
Stderr output: [libx264 @ 0xffffa21358d0] 8x8 transform intra:73.1% inter:88.7%
Stderr output: [libx264 @ 0xffffa21358d0] coded y,uvDC,uvAC intra: 43.3% 71.1% 18.0% inter: 20.2% 36.8% 0.9%
Stderr output: [libx264 @ 0xffffa21358d0] i16 v,h,dc,p: 32% 22% 10% 37%
Stderr output: [libx264 @ 0xffffa21358d0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 17% 19%  5%  7%  7%  6%  7%  5%
Stderr output: [libx264 @ 0xffffa21358d0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 19% 12%  5% 11% 10%  7%  7%  4%
Stderr output: [libx264 @ 0xffffa21358d0] i8c dc,h,v,p: 45% 21% 25%  9%
Stderr output: [libx264 @ 0xffffa21358d0] Weighted P-Frames: Y:0.0% UV:0.0%
Stderr output: [libx264 @ 0xffffa21358d0] ref P L0: 63.6% 17.3% 14.5%  4.6%
Stderr output: [libx264 @ 0xffffa21358d0] ref B L0: 89.1%  9.4%  1.5%
Stderr output: [libx264 @ 0xffffa21358d0] ref B L1: 97.7%  2.3%
Stderr output: [libx264 @ 0xffffa21358d0] kb/s:6694.37
</code></pre>
<p>In result I need one video with all draw text + audio from input trimmed by video duration (I use shortest for this, maybe I'm wrong), and a second video with all draw text and without any audio.</p>

<ffmpeg>
ffmpeg one draw text to multiple outputs
kRicha
# ffmpeg one draw text to multiple outputs

(Asked by: username_0 on 2023-07-31)

I've created command, which connects video file with music, use shortest(video) duration, and output this to result file
 ffmpeg \
-i ./source/video/women/1.mp4 \
-i ./source/audio/women.mp3 -y \
-filter:v drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=1:boxcolor=black@1:y=280,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a0:boxcolor=black@0.8:enable='between(t,0,6.5)':y=700,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a1:boxcolor=black@0.8:enable='between(t,0,6.5)':y=800,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a2:boxcolor=black@0.8:enable='between(t,0,6.5)':y=900,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a3:boxcolor=black@0.8:enable='between(t,0,6.5)':y=1000,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b0:boxcolor=black@0.8:enable='between(t,7,10)':y=1000,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b1:boxcolor=black@0.8:enable='between(t,7,10)':y=1100,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b2:boxcolor=black@0.8:enable='between(t,7,10)':y=1200,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b3:boxcolor=black@0.8:enable='between(t,7,10)':y=1300,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b4:boxcolor=black@0.8:enable='between(t,7,10)':y=1400,drawtext=fontsize=30:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=c:enable='between(t,10.2,inf)':boxcolor=black@1:y=1500,drawtext=fontsize=30:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=d:enable='between(t,10.2,inf)':boxcolor=black@1:y=1550 \
-map 0:v:0 \
-map 1:a:0 \
-shortest out2/_.mp4

If I add second output, it works, but without audio and drawtext. How could I fixe this and get draw text works on both outputs?
UPD 1:
ffmpeg -i ./source/video/kids/1.mp4 -i ./source/audio/kids.mp3 -y \
-filter_complex drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='Facts about children':boxcolor=black@1:y=280,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='a0':boxcolor=black@0.8:y=700:enable='between(t,0,6.5)',drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='a1':boxcolor=black@0.8:y=800:enable='between(t,0,6.5)',drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='a2':boxcolor=black@0.8:y=900:enable='between(t,0,6.5)',drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=Facts about children:boxcolor=black@1:y=280:text='a3':boxcolor=black@0.8:y=1000:enable='between(t,0,6.5)',split=2[o0][o1] \
-map [o0] -map 1:a:0 -shortest 1.mp4 \
-map [o1] 2.mp4

now it works almost correctly, but gives the following error:
Stderr output: frame=    0 fps=0.0 q=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A
Stderr output: frame=    0 fps=0.0 q=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A
Stderr output: frame=    8 fps=6.2 q=28.0 q=28.0 size=       0kB time=00:00:00.20 bitrate=   1.9kbits/s speed=0.156x
Stderr output: frame=   14 fps=7.7 q=28.0 q=28.0 size=       0kB time=00:00:00.44 bitrate=   0.9kbits/s speed=0.242x
Stderr output: frame=   22 fps=9.3 q=28.0 q=28.0 size=       0kB time=00:00:00.76 bitrate=   0.5kbits/s speed=0.321x
Stderr output: frame=   30 fps= 10 q=28.0 q=28.0 size=       0kB time=00:00:01.12 bitrate=   0.3kbits/s speed=0.389x
Stderr output: frame=   39 fps= 11 q=28.0 q=28.0 size=       0kB time=00:00:01.44 bitrate=   0.3kbits/s speed=0.424x
Stderr output: frame=   50 fps= 12 q=28.0 q=28.0 size=       0kB time=00:00:01.88 bitrate=   0.2kbits/s speed=0.462x
Stderr output: frame=   57 fps= 12 q=28.0 q=28.0 size=       0kB time=00:00:02.20 bitrate=   0.2kbits/s speed=0.478x
Stderr output: frame=   67 fps= 13 q=28.0 q=28.0 size=       0kB time=00:00:02.56 bitrate=   0.1kbits/s speed=0.496x
Stderr output: frame=   75 fps= 13 q=28.0 q=28.0 size=       0kB time=00:00:02.88 bitrate=   0.1kbits/s speed=0.502x
Stderr output: frame=   83 fps= 13 q=28.0 q=28.0 size=       0kB time=00:00:03.20 bitrate=   0.1kbits/s speed=0.507x
Stderr output: frame=   92 fps= 13 q=28.0 q=28.0 size=       0kB time=00:00:03.56 bitrate=   0.1kbits/s speed=0.52x
Stderr output: frame=  100 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:03.88 bitrate=   0.1kbits/s speed=0.527x
Stderr output: frame=  108 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:04.20 bitrate=   0.1kbits/s speed=0.533x
Stderr output: frame=  117 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:04.56 bitrate=   0.1kbits/s speed=0.534x
Stderr output: frame=  126 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:04.92 bitrate=   0.1kbits/s speed=0.543x
Stderr output: frame=  134 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:05.24 bitrate=   0.1kbits/s speed=0.547x
Stderr output: frame=  142 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:05.56 bitrate=   0.1kbits/s speed=0.551x
Stderr output: frame=  151 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:05.92 bitrate=   0.1kbits/s speed=0.559x
Stderr output: frame=  158 fps= 14 q=28.0 q=28.0 size=       0kB time=00:00:06.20 bitrate=   0.1kbits/s speed=0.558x
Stderr output: frame=  165 fps= 14 q=28.0 q=28.0 size=     256kB time=00:00:06.52 bitrate= 321.7kbits/s speed=0.559x
Stderr output: frame=  174 fps= 14 q=28.0 q=28.0 size=     512kB time=00:00:06.84 bitrate= 613.3kbits/s speed=0.559x
Stderr output: frame=  184 fps= 14 q=28.0 q=28.0 size=     768kB time=00:00:07.24 bitrate= 869.0kbits/s speed=0.568x
Stderr output: frame=  193 fps= 15 q=28.0 q=28.0 size=    1024kB time=00:00:07.60 bitrate=1103.8kbits/s speed=0.571x
Stderr output: frame=  252 fps= 16 q=-1.0 Lq=-1.0 size=    8271kB time=00:00:09.96 bitrate=6802.6kbits/s speed=0.626x
Stderr output: video:16476kB audio:28kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Stderr output: [libx264 @ 0xffffa27d79f0] frame I:2     Avg QP:23.97  size: 87068
Stderr output: [libx264 @ 0xffffa27d79f0] frame P:80    Avg QP:24.66  size: 47762
Stderr output: [libx264 @ 0xffffa27d79f0] frame B:170   Avg QP:25.98  size: 26117
Stderr output: [libx264 @ 0xffffa27d79f0] consecutive B-frames:  1.2% 23.0% 10.7% 65.1%
Stderr output: [libx264 @ 0xffffa27d79f0] mb I  I16..4: 12.8% 74.6% 12.6%
Stderr output: [libx264 @ 0xffffa27d79f0] mb P  I16..4: 12.3% 44.9%  2.2%  P16..4: 24.9%  7.9%  2.0%  0.0%  0.0%    skip: 5.7%
Stderr output: [libx264 @ 0xffffa27d79f0] mb B  I16..4:  6.4% 15.8%  0.4%  B16..8: 35.7%  7.8%  1.1%  direct: 4.7%  skip:28.2%  L0:48.4% L1:46.8% BI: 4.8%
Stderr output: [libx264 @ 0xffffa27d79f0] 8x8 transform intra:73.1% inter:88.7%
Stderr output: [libx264 @ 0xffffa27d79f0] coded y,uvDC,uvAC intra: 43.3% 71.1% 18.0% inter: 20.2% 36.8% 0.9%
Stderr output: [libx264 @ 0xffffa27d79f0] i16 v,h,dc,p: 32% 22% 10% 37%
Stderr output: [libx264 @ 0xffffa27d79f0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 17% 19%  5%  7%  7%  6%  7%  5%
Stderr output: [libx264 @ 0xffffa27d79f0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 19% 12%  5% 11% 10%  7%  7%  4%
Stderr output: [libx264 @ 0xffffa27d79f0] i8c dc,h,v,p: 45% 21% 25%  9%
Stderr output: [libx264 @ 0xffffa27d79f0] Weighted P-Frames: Y:0.0% UV:0.0%
Stderr output: [libx264 @ 0xffffa27d79f0] ref P L0: 63.6% 17.3% 14.5%  4.6%
Stderr output: [libx264 @ 0xffffa27d79f0] ref B L0: 89.1%  9.4%  1.5%
Stderr output: [libx264 @ 0xffffa27d79f0] ref B L1: 97.7%  2.3%
Stderr output: [libx264 @ 0xffffa27d79f0] kb/s:6694.37
Stderr output: [aac @ 0xffffa26739b0] Qavg: 530.098
Stderr output: [libx264 @ 0xffffa21358d0] frame I:2     Avg QP:23.97  size: 87068
Stderr output: [libx264 @ 0xffffa21358d0] frame P:80    Avg QP:24.66  size: 47762
Stderr output: [libx264 @ 0xffffa21358d0] frame B:170   Avg QP:25.98  size: 26117
Stderr output: [libx264 @ 0xffffa21358d0] consecutive B-frames:  1.2% 23.0% 10.7% 65.1%
Stderr output: [libx264 @ 0xffffa21358d0] mb I  I16..4: 12.8% 74.6% 12.6%
Stderr output: [libx264 @ 0xffffa21358d0] mb P  I16..4: 12.3% 44.9%  2.2%  P16..4: 24.9%  7.9%  2.0%  0.0%  0.0%    skip: 5.7%
Stderr output: [libx264 @ 0xffffa21358d0] mb B  I16..4:  6.4% 15.8%  0.4%  B16..8: 35.7%  7.8%  1.1%  direct: 4.7%  skip:28.2%  L0:48.4% L1:46.8% BI: 4.8%
Stderr output: [libx264 @ 0xffffa21358d0] 8x8 transform intra:73.1% inter:88.7%
Stderr output: [libx264 @ 0xffffa21358d0] coded y,uvDC,uvAC intra: 43.3% 71.1% 18.0% inter: 20.2% 36.8% 0.9%
Stderr output: [libx264 @ 0xffffa21358d0] i16 v,h,dc,p: 32% 22% 10% 37%
Stderr output: [libx264 @ 0xffffa21358d0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 17% 19%  5%  7%  7%  6%  7%  5%
Stderr output: [libx264 @ 0xffffa21358d0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 19% 12%  5% 11% 10%  7%  7%  4%
Stderr output: [libx264 @ 0xffffa21358d0] i8c dc,h,v,p: 45% 21% 25%  9%
Stderr output: [libx264 @ 0xffffa21358d0] Weighted P-Frames: Y:0.0% UV:0.0%
Stderr output: [libx264 @ 0xffffa21358d0] ref P L0: 63.6% 17.3% 14.5%  4.6%
Stderr output: [libx264 @ 0xffffa21358d0] ref B L0: 89.1%  9.4%  1.5%
Stderr output: [libx264 @ 0xffffa21358d0] ref B L1: 97.7%  2.3%
Stderr output: [libx264 @ 0xffffa21358d0] kb/s:6694.37

In result I need one video with all draw text + audio from input trimmed by video duration (I use shortest for this, maybe I'm wrong), and a second video with all draw text and without any audio.

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2023-08-01. Score: 2

You need to split the drawtext output and then map a split result for each output.
ffmpeg \
-i ./source/video/women/1.mp4 \
-i ./source/audio/women.mp3 -y \
-filter_complex drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=1:boxcolor=black@1:y=280,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a0:boxcolor=black@0.8:enable='between(t,0,6.5)':y=700,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a1:boxcolor=black@0.8:enable='between(t,0,6.5)':y=800,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a2:boxcolor=black@0.8:enable='between(t,0,6.5)':y=900,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=a3:boxcolor=black@0.8:enable='between(t,0,6.5)':y=1000,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b0:boxcolor=black@0.8:enable='between(t,7,10)':y=1000,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b1:boxcolor=black@0.8:enable='between(t,7,10)':y=1100,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b2:boxcolor=black@0.8:enable='between(t,7,10)':y=1200,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b3:boxcolor=black@0.8:enable='between(t,7,10)':y=1300,drawtext=fontsize=80:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=b4:boxcolor=black@0.8:enable='between(t,7,10)':y=1400,drawtext=fontsize=30:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=c:enable='between(t,10.2,inf)':boxcolor=black@1:y=1500,drawtext=fontsize=30:fontcolor=white:x=(w-tw)/2:box=1:boxborderw=20:fontfile=./OpenSans-Light.ttf:text=d:enable='between(t,10.2,inf)':boxcolor=black@1:y=1550,split=2[o0][o1] \
-map [o0] \
-map 1:a:0 \
-shortest out1/_.mp4
-map [o1] \
-map 1:a:0 \
-shortest out2/_.mp4

> **Comments:**
> **username_0**: Thanks, it's almost what I need, but not final. I've added update to question  
> **username_1**: ffmpeg logs to stderr and I don't see any error in the log. To not have audio in 2nd output, remove `-map 1:a:0` and also `-shortest`  
> **username_0**: yes, I've done this and get error) error is in question section.  
> **username_1**: I looked at the log and there's no error indicated, only encoding progress and stats.  
> **username_0**: seems something wrong, because music stops after 1st second in first video.  
> **username_0**: any thoughts? Or maybe I've make a mistake?  
> **username_0**: for some reasons ffmpeg -i ./source/video/kids/5.mp4 -i ./source/audio/history.mp3 -map 0:v  -map 1:a -y -shortest 1.mp4 with shortest flat audio drops on 2 second, without shortest flag audio is ok, but video is too long  

---

