ffmpeg使用相同的复数滤波器进行多输出

时间:2018-01-10 20:51:57

标签: ffmpeg youtube

您好我正在尝试使用ffmpeg直播内容到youtube以及输出mp4。问题是我有一个复杂的过滤器,不知道如何将它应用于两个输出。

这是代码

  

ffmpeg -re -i“https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8”   -i ./public/images/ACE.png   -i ./public/images/logo2.jpg   -filter_complex“[1] scale = 40:40 [ovrl1],[v0] [ovrl1] overlay = 580:10:enable ='between(t,1,5)'[v1]; [2] scale = 40: 40 ovrl2]   [v1] [ovrl2] overlay = 580:10:enable ='between(t,5,15)'[v2]; [v2]   DrawText的= = fontfile = fontfile /系统/库/字体/ Keyboard.ttf:   \ text ='VideoGami':fontcolor = white:fontsize = 24:x =(w-text_w)/ 2:   y =(h-text_h)/1.05:enable ='between(t,1,10)'“   -acodec aac -vcodec libx264 -f flv“rtmp://a.rtmp.youtube.com/live2/moo”   -acodec aac -vcodec libx264 trial.mp4

1 个答案:

答案 0 :(得分:1)

使用tee muxer。未经测试的例子:

ffmpeg -re -i "https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8" -i ./public/images/ACE.png -i ./public/images/logo2.jpg -filter_complex "[1]scale=40:40[ovrl1], [0:v:6][ovrl1] overlay=580:10:enable='between(t,1,5)'[v1];[2]scale=40:40[ovrl2], [v1][ovrl2] overlay=580:10:enable='between(t,5,15)',drawtext=fontfile=fontfile=/System/Library/Fonts/Keyboard.ttf: \text='VideoGami':fontcolor=white: fontsize=24: x=(w-text_w)/2: y=(h-text_h)/1.05: enable='between(t,1,10)'[v]" -map "[v]" -map 0:a:6 -c:v libx264 -c:a aac -f tee "[f=flv]rtmp://a.rtmp.youtube.com/live2/moo|trial.mp4"