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

No audio on concatenated video #105

Open
bypasses opened this issue Dec 12, 2020 · 3 comments
Open

No audio on concatenated video #105

bypasses opened this issue Dec 12, 2020 · 3 comments

Comments

@bypasses
Copy link

Im just doing some testing with a couple clips, both clips have audio full length of video throughout but when I concat them with a transition the output has no audio at all.

@laranjaquadrada
Copy link

Hi have the same issue.

I was able to find a workaround by commenting the '-c:a', 'copy' in line 60 of the transcode-video.js...

I think we should have one args variable for audio to avoid having that always set by default if we don't send a full soundtrack for the output. If we want to keep existing audio we should have control on the codec used.

So my work around was use '-c:a aac' instead sent in the args parameter. Depending on your system you might want to use other audio codec.

My problem is that the audio then is all out of sync. I think because of the context set and my source videos all have different encoding frame rates and are different sizes and etc.

I was able to concatenate videos with synced audio directly using ffmpeg but I'm struggling to put it all together with the gltransition filter... Example: ffmpeg -i 1.mp4 -i 2.mp4 -filter_complex "[0:v] [0:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" -vsync 2 output.mp4

When I bring the gltransition (using my own compiled ffmpeg) I wasn't able to get it working correctly yet as I want it.

It would be great if ffmpeg-concat could evolve to use ffmpeg concact as in the example here: transitive-bullshit/ffmpeg-gl-transition#4 (comment)

I don't get why we have the approach to set all the temp raw images and temp audio and only allow us to send args to the output video transcoding. In my case that becomes a mess because all the different video encodings in my inputs.

Ideally I would like to just set an array of input videos and then merge with concat one after the other setting the gltransitions in between. With options to define video and audio codecs and other ffmpeg params.

The current version of this amazing script seems to be a bit limited to very specific scenarios where all video inputs come from the same source, a very controlled environment.

I would love to hear thoughts about other people and ideas on how to progress this amazing script to a useful shape.

Anyone around??

@Makeshift
Copy link

I'm also encountering this issue and unfortunately the workarounds above didn't seem to work for me, which is pretty unfortunate.

Did anybody find a way to get audio to consistently work?

@mh4ck
Copy link

mh4ck commented Mar 24, 2021

Same here,

instead of commenting the line 60 in transcode-video.js you can just add

args: [
        '-c:v',
        'libx264',
        '-profile:v',
        'main',
        '-preset',
        'medium',
        '-crf 20',
        '-movflags',
        'faststart',
        '-c:a copy',
      ],

To the start properties..

But it's not working anyway.

If anybody found a solution please let me know - for my use it would be very nice to copy the sound of the video.
I'm concatinating instagram stories so it is necessary to just copy the audio otherway it would be a pain in the ass to calculate when the audio should be played and when i need to insert a blank audio for images and so on...

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

4 participants