Custom FFmpeg

Questions and answers on how to get the most out of FFAStrans
Post Reply
kamilion
Posts: 10
Joined: Thu Jun 09, 2022 11:07 am

Custom FFmpeg

Post 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.
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Custom FFmpeg

Post 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.
emcodem, wrapping since 2009 you got the rhyme?
kamilion
Posts: 10
Joined: Thu Jun 09, 2022 11:07 am

Re: Custom FFmpeg

Post 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
emcodem
Posts: 1811
Joined: Wed Sep 19, 2018 8:11 am

Re: Custom FFmpeg

Post 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
emcodem, wrapping since 2009 you got the rhyme?
kamilion
Posts: 10
Joined: Thu Jun 09, 2022 11:07 am

Re: Custom FFmpeg

Post by kamilion »

Perfect! Thank you !
Post Reply