Page 1 of 1

Custom FFmpeg

Posted: Fri Jul 08, 2022 8:55 am
by kamilion
Hello, How corectly set custom ffmpeg command with 2 pass render?

-pass 1 -passlogfile %s_original_path% -c:v libx264 -b:v 5000k -profile:v high -level 4.1 -map v:0 -c:a aac -ar 48k -b:a 320k -map a:0 -pix_fmt yuv420p -sws_flags lanczos
-pass 2 -passlogfile %s_original_path% -c:v libx264 -b:v 5000k -profile:v high -level 4.1 -map v:0 -c:a aac -ar 48k -b:a 320k -map a:0 -pix_fmt yuv420p -sws_flags lanczos

Unfortunatelly, with that command im receiving one output, but with two video and audio layers and duplicated bitrate.

Re: Custom FFmpeg

Posted: Fri Jul 08, 2022 10:05 am
by emcodem
Hey there!

thats easy, you cannot use custom ffmpeg for this. As usual i recommend not to use custom ffmpeg at all but the commandline processor instead.
All you have to do is to change the lines you wrote and add the prefix
"%s_ffmpeg%" -i "%s_source%"

and the postfix
First pass:

Code: Select all

-f mp4 -
Second pass:

Code: Select all

"%s_job_work%\%s_original_name%.YOUREXTENSION"
and also check "set s_source to" in the cmd processor and also set to same value as postfix.
This way everything should behave exactly like when you are using custom ffmpeg proc.

Also, whenever you are working like that, you should always first get your ffmpeg commands working on commandline, after that, you just copy everything between the input and output from the ffmpeg command and replace it by the prefix and postifxes i wrote above. This way you get much faster information about if there is something wrong with your command.
Plus, in order to see the ffmpeg log, it is best to use webinterface job details view.

Re: Custom FFmpeg

Posted: Fri Jul 08, 2022 1:24 pm
by kamilion
Thanks for your reply. Commandline processor y meaning command executor?

Code: Select all

"%s_ffmpeg%" -i "%s_source%" -f mp4 -pass 1 -passlogfile %s_original_path% -c:v libx264 -b:v 5000k -profile:v high -level 4.1 -map v:0 -c:a aac -ar 48k -b:a 320k -map a:0 -pix_fmt yuv420p -sws_flags lanczos
"%s_job_work%\%s_original_name%.mp4" -pass 2 -passlogfile %s_original_path% -c:v libx264 -b:v 5000k -profile:v high -level 4.1 -map v:0 -c:a aac -ar 48k -b:a 320k -map a:0 -pix_fmt yuv420p -sws_flags lanczos

Re: Custom FFmpeg

Posted: Fri Jul 08, 2022 2:35 pm
by emcodem
Yes, "command executor processor".
And your commands will not work, they would never work on commandline without ffastrans, that's what you want to get running first. Only when you got that working, you can do it in command or custom ffmpeg processors.
You need to see the 2 commands completely separate from each other. It is like 2 completely separate encodings. The only thing they share is the passlog path.
your pass1 misses the output at the end and the pass2 misses the full path to ffmpeg.exe at begin of line and also it misses the output at the end..

This should work:
emcodem_2pass_encoding.json
(3.41 KiB) Downloaded 245 times

Re: Custom FFmpeg

Posted: Mon Jul 11, 2022 6:53 am
by kamilion
Perfect! Thank you !