0

I'm trying to combine 3 videos into one. 2 are sourced from a surveillance system, the 3rd is a placeholder JPEG that I looped in to a video using this:

ffmpeg -loop 1 -i FULL.jpg -c:v libx264 -t 10 -pix_fmt yuv420p -vf "scale=1920:1080,setsar=sar=189/190,setdar=16/9" -filter:v fps=fps=1 placeholder.mp4

As you can see, I'm trying to set the sar. Because when I combine the 3 files via

ffmpeg -i BEGINNING.mp4 -i placeholder.mp4 -i END.mp4 -f lavfi -t 0.1 -i anullsrc -filter_complex "[1:v]setsar=sar=189/190[v1];[0:v:0][0:a:0][1:v:0][3:a][2:v:0][2:a:0]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" full_demo.mp4

I get:

Filter setsar has a unconnected output

The sar of BEGINNING.mp4 and END.mp4 are 189/190 according to their mediainfo output. When I run mediainfo on placeholder.mp4, there is no sar or dar returned.

So what am I doing wrong?

1 Answer 1

0

You have to input the modified stream to concat, not the original stream, so

[0:v:0][0:a:0][1:v:0][3:a][2:v:0][2:a:0]concat=n=3:v=1:a=1[v][a]

becomes

[0:v:0][0:a:0][v1][3:a][2:v:0][2:a:0]concat=n=3:v=1:a=1:unsafe=1[v][a]

Also, in your first command, only the fps filter is applied. Multiple filters should be applied in a chain. Also, setsar and setdar both operate upon the same parameter. DAR = SAR x WIDTH / HEIGHT. So,

-vf "scale=1920:1080,setdar=16/9,fps=fps=1"
5
  • Ok, fixed the first command, thanks for the extra info.
    – Matt
    Jun 15, 2019 at 5:16
  • I did the math and came up with ffmpeg -loop 1 -i FULL.jpg -c:v libx264 -t 10 -pix_fmt yuv420p -vf "scale=1920:1080,setdar=1.768,fps=fps=1" placeholder.mp4 then ffmpeg -i BEGINNING.mp4 -i placeholder.mp4 -i END.mp4 -f lavfi -t 0.1 -i anullsrc -filter_complex "[0:v:0][0:a:0][1:v:0][3:a][2:v:0][2:a:0]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" full_demo.mp4 and that kicks back [Parsed_concat_0 @ 0x19d6c60] Input link in1:v0 parameters (size 1920x1080, SAR 891:896) do not match the corresponding output link in0:v0 parameters (1920x1080, SAR 189:190)
    – Matt
    Jun 15, 2019 at 5:23
  • Edited concat args.
    – Gyan
    Jun 15, 2019 at 5:38
  • Ok, making progress. It did spit out a video, but placeholder.mp4 was completely omitted, it went from BEGINNING.mp4 right into END.mp4. During the process, it kicked out a lot of these errors: [Parsed_concat_0 @ 0x1159700] Buffer queue overflow, dropping.trate=1512.5kbits/s Last message repeated 8 times and Past duration 0.602913 too large
    – Matt
    Jun 15, 2019 at 18:12
  • Upgrade ffmpeg to recent git or 4.1 and check.
    – Gyan
    Jun 15, 2019 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.