Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Videos concat not work #836

Open
tungmt opened this issue Apr 16, 2024 · 2 comments
Open

Videos concat not work #836

tungmt opened this issue Apr 16, 2024 · 2 comments

Comments

@tungmt
Copy link

tungmt commented Apr 16, 2024

I try to concat 2 videos but I was got an error.

Here is my code:

    try:
        in1 = ffmpeg.input(args.videos[0])
        in2 = ffmpeg.input(args.videos[1])
        v1 = in1.video
        a1 = in1.audio
        v2 = in2.video
        a2 = in2.audio
        joined = ffmpeg.concat(v1, a1, v2, a2, n=2, v=1, a=1).node
        out = (
            ffmpeg.output(joined[0], joined[1], 'out.mov')
            .overwrite_output()
            .run()
        )
        print(out)
    except ffmpeg.Error as e:
        print(e.stderr, file=sys.stderr)
        sys.exit(1)

Here is error I got:

[fc#0 @ 0x600003099a70] Stream specifier ':a' in filtergraph description [0:v][0:a][1:v][1:a]concat=a=1:n=2:v=1[s0][s1] matches no streams.
Error binding filtergraph inputs/outputs: Invalid argument
@AdrKacz
Copy link

AdrKacz commented Apr 25, 2024

Did you try to run

(
    ffmpeg
    .concat(
        ffmpeg.input(args.videos[0]),
        ffmpeg.input(args.videos[1])
    )
    .output('out.mov') # Unless your input are already .mov you'll probably have to do some conversion here
    .run()
)

I am not sure I understand exactly what you are trying to achieve. Can you give more details please?

@hsngerami
Copy link

hsngerami commented Sep 8, 2024

@tungmt
you can use videoalchemy to have readable yaml base ffmpeg command. when it success get generated ffmpeg command and use that in your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants