Custom Ffmpeg on h264

Questions and answers on how to get the most out of FFAStrans
Post Reply
sebird
Posts: 8
Joined: Thu Dec 14, 2017 11:18 am

Custom Ffmpeg on h264

Post by sebird »

Hello,
I'm trying to use a custom ffmpeg in the h264 encoder but impossible to find the right way.

I tried to add -map 0 -map 1 -map 2 to mix 2 mono channels on 1 stereo channel but it dont'work.

I also tried : input -filter_complex '[0:1][0:2]join=inputs=2:channel_layout=stereo[audio];

and i got : Encoding: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height.

Can you help me? Thank you!

Sebastien
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Custom Ffmpeg on h264

Post by emcodem »

Hi sebird,

no problemo. I'd just recommend to get rid of the custom ffmpeg and do a commandline processor instead. This way it is easier to first test your command on commandline only (without ffastrans) and only when you got it working, replace sourcefile and output path by some variables and copy your command to the commandline executor.

It is not obvious for me to tell how many input files you have, you said 2 mono to 1 stereo.

This example that you can 1:1 copy/paste into the custom ffmpeg node assumes that you have a source file with 2 mono tracks and you want the newly generated stereo track as well as the video track in the output file:

Code: Select all

-filter_complex "[0:a:0][0:a:1]join=inputs=2:channel_layout=stereo[STEREO]" -map 0:v -map "[STEREO]"
On commandline it would look like this:

Code: Select all

 ffmpeg -i SOURCEFILE -filter_complex "[0:a:0][0:a:1]join=inputs=2:channel_layout=stereo[STEREO]" -map 0:v -map "[STEREO]" OUTPUTFILE.mp4
Also, it is important when working on stuff as you do, to read the log files called "*ffreport" in the work dir of the job, e.g. configure your workflow settings to "keep work files" and in the status monitor, rightclick the job and "open work dir". This way you can read the full ffmpeg output and all errors it spits out. Or alternatively use the webinterface to investigate the logs, thats even more comfortable.
emcodem, wrapping since 2009 you got the rhyme?
Post Reply