简体   繁体   中英

How to use filter_complex on ffmpeg with streaming videos

I have 30 video sources. i want to make ffmpeg command to create 1 channel (streaming) with all channels embedded in (in bad quality)

"[0:v][1:v]setpts=PTS-STARTPTS,overlay=20:40[1]; \
 [1][1:v]setpts=PTS-STARTPTS,overlay=(W-w)/2:(H-h)/2[v]; \
 [1:a][2:a]amerge=inputs=2[a]" \
-map "[v]" -map "[a]" -ac 2 3.mp4

i trying to find the correct command do downgrade quality, than create one streaming output. (one audio chosen)

Scale each video to desired size with the scale filter . Arrange with the xstack filter .

ffmpeg -i input0 -i input1 ... -i input29 -i audio -filter_complex
"[0]scale=128:-1[v0];[1]scale=128:-1[v1];...[29]scale=128:-1[v29];
[v0][v1]...[v29]xstack=inputs=30:layout=<your desired layout>[v]"
-map "[v]" -map 30:a -c:v libx264 -crf 51 -c:a aac -shortest output.mp4

-crf 51 will provide the low quality as requested. Decrease the value if you want better quality.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM