Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > (HD) DVD, Blu-ray & (S)VCD > (HD) DVD & Blu-ray authoring

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th July 2019, 22:23   #1  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
translator needed: x264 to ffmpeg script

i've been using the scripting discussed here for a very long time:

https://forum.doom9.org/showthread.p...ighlight=babag

i'd like to have the option to use ffmpeg now rather than x264 encoder as i use ffmpeg more anyway. i'm just not up to figuring this out. here is the scripting for x264:
Code:
x264 --bluray-compat --bitrate 22000 --preset veryslow --tune film --weightp 0 /
--bframes 3 --nal-hrd vbr --vbv-maxrate 40000 /
--vbv-bufsize 30000 --level 4.1 --fps 24000/1001 /
--keyint 24 --b-pyramid strict --slices 4 --aud /
--colorprim "bt709" --transfer "bt709" --colormatrix "bt709" /
--sar 1:1 --ref 4 --qpmin 4 --pass 1 -o output_file.264 /
input_16x9_ProResHQ.mov /
&& /
x264 --bluray-compat --bitrate 22000 --preset veryslow /
--tune film --weightp 0 --bframes 3 --nal-hrd vbr /
--vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 /
--fps 24000/1001 --keyint 24 --b-pyramid strict --slices 4 /
--aud --colorprim "bt709" --transfer "bt709" /
--colormatrix "bt709" --sar 1:1 --ref 4 --qpmin 4 --pass 2 /
-o output_file.264 input_16x9_ProResHQ.mov
can anyone translate this into ffmpeg?

thanks very much,
babag

Last edited by BabaG; 30th July 2019 at 22:26.
BabaG is offline   Reply With Quote
Old 1st August 2019, 13:56   #2  |  Link
Lypheo
Registered User
 
Join Date: Sep 2018
Posts: 14
You can use the -x264opts option in ffmpeg to pass a list of arbitrary parameters to x264. See the documentation for the exact syntax.
Lypheo is offline   Reply With Quote
Old 1st August 2019, 17:40   #3  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
thanks, lypheo. i found this on the ffmpeg site:
Quote:
Warning: Do not use the option x264opts, as it will eventually be removed. Use x264-params instead.
don't really understand how this works. is this calling and using x264 software or is it just translating x264 commands so that ffmpeg can execute them?

thanks again,
babag
BabaG is offline   Reply With Quote
Old 1st August 2019, 18:00   #4  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
I just googled it for you https://trac.ffmpeg.org/wiki/Encode/H.264

Code:
Example:

ffmpeg -i input -c:v libx264 -preset slow -crf 22 -x264-params keyint=123:min-keyint=20 -c:a copy output.mkv
Warning: Do not use the option x264opts, as it will eventually be removed. Use x264-params instead.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 1st August 2019, 18:22   #5  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
thanks, chaosking. that's actually the same page i got the warning quote from.

the script i originally posted produces a .264 file that loads into adobe encore directly without encore requiring transcoding. from everything i read online, that's something of a problem as many scripts produce files that encore wants to transcode. for that reason, i feel like i want to try to replicate the posted script, using ffmpeg, as directly as possible. still don't quite understand the process, though. getting the idea that using something like 'x264-params' followed by my x264 options separated by colons would be the process but haven't yet found direct examples of more than a couple of scenarios, none as complex as the above script. still looking.

@chaosking are you suggesting, by posting the code in addition to the warning, that i should simply add all of my parameters, separated by colons, into the 'x264-params' part of that code? is that how it works?

also, do i have it right that x264 has in some way been folded into ffmpeg now and it's that included x264 code that's being called with the 'x264-params' switch?

thanks again,
babag

Last edited by BabaG; 1st August 2019 at 18:41.
BabaG is offline   Reply With Quote
Old 1st August 2019, 19:03   #6  |  Link
BabaG
Registered User
 
Join Date: Dec 2003
Posts: 253
ok, based on what i think i'm starting to see, here's a go at translating to ffmpeg:
Code:
ffmpeg -i input_16x9_ProResHQ.mov -c:v libx264 /
-preset veryslow -crf 22 -x264-params bluray-compat: /
bitrate 22000:preset veryslow:tune film:weightp 0: /
bframes 3:nal-hrd vbr:vbv-maxrate 40000: /
vbv-bufsize 30000:level 4.1:fps 24000/1001: /
keyint 24:b-pyramid strict:slices 4:aud: /
colorprim "bt709":transfer "bt709":colormatrix "bt709": /
sar 1:1:ref 4:qpmin 4:pass 1 -o output_file.264 /
&& /
ffmpeg -i input_16x9_ProResHQ.mov -c:v libx264 /
-preset veryslow -crf 22 -x264-params bluray-compat: /
bitrate 22000:preset veryslow:tune film:weightp 0: /
bframes 3:nal-hrd vbr:vbv-maxrate 40000: /
vbv-bufsize 30000:level 4.1:fps 24000/1001: /
keyint 24:b-pyramid strict:slices 4:aud: /
colorprim "bt709":transfer "bt709":colormatrix "bt709": /
sar 1:1:ref 4:qpmin 4:pass 2 -o output_file.264 /
the most questionable things i see are that i use the preset veryslow twice, and whether pass 1 and pass 2 should be part of the x264 call. i wasn't sure whether the veryslow call needed to be made for both ffmpeg as well as the x264 parameters or if just the ffmpeg was sufficient (or, maybe the x264 call is the one to use). there's probably plenty more but that's where i am with this now.

also wondering if any of the x264 parameters should be moved to native ffmpeg switches as there are so many x264 parameters being called. guidance on that is appreciated.

thanks for any corrections,
babag

Last edited by BabaG; 1st August 2019 at 19:12.
BabaG is offline   Reply With Quote
Old 2nd August 2019, 10:11   #7  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
you can also check the file itself.

Code:
 mediainfo file.mp4 | grep -i encoding 
Encoding settings                        : cabac=1 / ref=5 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=hex ...
In this example I can tell that this is not 'veryslow' due to the fact that 'me=hex'.
__________________
certain other member

Last edited by smok3; 2nd August 2019 at 10:14.
smok3 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:53.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.