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 > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th June 2017, 08:41   #381  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
Source and target are different. If you target Blu-Ray, you can use open-gop (needs bluray-compat but you've put it, so it's fine), it doesn't matter what source has, this parameter is for the target only.
And as it's HD 1920x1080, the sar is 1:1 and color is BT.709. For me, your command line is good.
About deinterlace and the remark about the sar and color, it's probably because he thought it was 576i.
jpsdr is offline   Reply With Quote
Old 8th June 2017, 09:35   #382  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by jpsdr View Post
About deinterlace and the remark about the sar and color, it's probably because he thought it was 576i.
Yes, he only mentioned "PAL XDCAM MXF" which I assumed to be 720x576 interlaced. He didn't say anything about 1080i.


I would remove "--videoformat PAL" and "--overscan show", I'm not sure they are allowed or appropriate. (And maybe --opencl if you're targeting production. The minor speedup might not be worth the additional stability risks.)
sneaker_ger is offline   Reply With Quote
Old 8th June 2017, 11:51   #383  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
"If something CAN be made complicated, it WILL..." (Murphy).
Why not follow the instructions for blu-ray compliant encoding given in the first post of this thread, and the links to the examples with commandlines provided at the end of the first post of this sticky ...
Sharc is offline   Reply With Quote
Old 8th June 2017, 15:39   #384  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by jpsdr View Post
Source and target are different. If you target Blu-Ray, you can use open-gop (needs bluray-compat but you've put it, so it's fine), it doesn't matter what source has, this parameter is for the target only.
And as it's HD 1920x1080, the sar is 1:1 and color is BT.709. For me, your command line is good.
About deinterlace and the remark about the sar and color, it's probably because he thought it was 576i.
Got it.

Quote:
Originally Posted by sneaker_ger View Post
Yes, he only mentioned "PAL XDCAM MXF" which I assumed to be 720x576 interlaced. He didn't say anything about 1080i.


I would remove "--videoformat PAL" and "--overscan show", I'm not sure they are allowed or appropriate. (And maybe --opencl if you're targeting production. The minor speedup might not be worth the additional stability risks.)
Yes, I'm gonna remove them.

Thank you, everyone!
FranceBB is online now   Reply With Quote
Old 8th June 2017, 19:47   #385  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,135
Everything can be summarized as:
Quote:
avs4x264mod.exe "AVS Script.avs" --x264-binary "x264.exe" --bitrate 25000 --preset medium --ref 4 --level 4.1 --profile High --vbv-bufsize 30000 --vbv-maxrate 40000 --keyint 25 --slices 4 --bframe 3 --sar 1:1 --tff --bluray-compat --colormatrix bt709 --transfer bt709 --colorprim bt709 --log-level info --thread-input --output raw_video.h264
and you'll get the same quality.

NOTE: In your command line you've switched the values of bufsize and maxrate. Bufsize needs to be 30 Mbps max, while maxrate can be up to 40 Mbps.
With your values, you'll get out of specs discs. Depending by the authoring software, you can get your file rejected or accepted but with buffer overflows problems during multiplexing or verification process.

Also, can't understand why you're normalizing your audio by peak (that can create weird results). I guess you know there are EBU standards and normalizing by peak will likely alter the audio in a not-standard way. Do you have valid reasons for that?
mp3dom is offline   Reply With Quote
Old 8th June 2017, 19:50   #386  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
And yes, if your source is interlaced, you probably should just leave it like that. Anything else will lose spatial or temporal detail.


Sent from my iPhone using Tapatalk
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 8th June 2017, 20:01   #387  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by mp3dom View Post
Everything can be summarized as:
--profile High --bframe 3 --log-level info --thread-input could also be dropped, while we're at it (and default is --ref 3). But of course it doesn't make any difference.


As Sharc said people make things too complicated instead of just reading the docs/examples...

Last edited by sneaker_ger; 8th June 2017 at 20:16.
sneaker_ger is offline   Reply With Quote
Old 9th June 2017, 02:03   #388  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by mp3dom View Post
Everything can be summarized as:

and you'll get the same quality.

NOTE: In your command line you've switched the values of bufsize and maxrate. Bufsize needs to be 30 Mbps max, while maxrate can be up to 40 Mbps.
With your values, you'll get out of specs discs. Depending by the authoring software, you can get your file rejected or accepted but with buffer overflows problems during multiplexing or verification process.

Also, can't understand why you're normalizing your audio by peak (that can create weird results). I guess you know there are EBU standards and normalizing by peak will likely alter the audio in a not-standard way. Do you have valid reasons for that?
Got it. I'm gonna bring them back to 25Mbit/s just to be 100% sure.
Besides, I need my audio to be as close as possible to -24 LUFS. We generally use a machine called "Sony DP 600" to achieve this. Is there a similar way to achieve this via avisynth?

Last edited by FranceBB; 9th June 2017 at 02:09.
FranceBB is online now   Reply With Quote
Old 9th June 2017, 08:40   #389  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,135
Quote:
Originally Posted by FranceBB View Post
Besides, I need my audio to be as close as possible to -24 LUFS. We generally use a machine called "Sony DP 600" to achieve this. Is there a similar way to achieve this via avisynth?
As far as I know, no, there isn't. You need a DAW and proper plugins to do that. -24db(-23, depending on the program) LUFS is the standard and is not so loud. If you normalize by peak you can get totally wrong results. Think of an inaudible audio with just a single peak at -3 dB, you'll get your audio boosted by only 2dB. The LUFS in that case will be even lower than -24 (probably -30) so it will be rejected. The other case, a very compressed (by dynamic range) audio where you have plenty of spikes at -5dB, you'll get a boost of 4dB so a very louder audio will be even louder. The LUFS in that case will probably be -18 or even higher. Normalizing by peak is, almost always, a bad choice.

If you can't access to a DAW/plugins, you can get decent results normalizing by RMS, with a target value of -26/-27dB. Still, this may be fine for non-professional jobs, because if you deliver the audio for broadcasting, you need to strictly follow the EBU standard.

Last edited by mp3dom; 9th June 2017 at 17:12.
mp3dom is offline   Reply With Quote
Old 1st January 2018, 04:04   #390  |  Link
imsrk48
Registered User
 
imsrk48's Avatar
 
Join Date: Nov 2017
Posts: 154
where is color correction option in MeGui Latest Version

Sent from my P4 using Tapatalk
imsrk48 is offline   Reply With Quote
Old 11th March 2018, 17:13   #391  |  Link
DenisRodman
Registered User
 
Join Date: Jul 2015
Posts: 33
Timebased Slideshow

Quote:
The HDMV Timebased Slideshow is an application to present still pictures. It is same as movie presentation except that a presenting picture is a still picture. A still picture is coded as an MPEG-4 AVC IDR I-frame or an HEVC IDR I-frame. Presentation timing of the still picture is controlled by the associated PTS value and the presentation progresses with predefined timing axis. The stream of the Timebased Slideshow may contain data of Audio, Subtitle and Graphics. The presentation timing of these data is controlled by each PTS value in the stream.
I have 10 pictures 1.png, 2.png, 3.png ... 10.png how can create Timebased Slideshow MPEG-4 AVC IDR I-frame?

Please write the full code Command Line.

Thanks.
DenisRodman is offline   Reply With Quote
Old 15th May 2018, 10:32   #392  |  Link
Qarmaa
Registered User
 
Join Date: Sep 2017
Posts: 5
Quote:
Originally Posted by DenisRodman View Post
I have 10 pictures 1.png, 2.png, 3.png ... 10.png how can create Timebased Slideshow MPEG-4 AVC IDR I-frame?

Please write the full code Command Line.

Thanks.
There is no way you can do this by using only x264. To create compliant timebased or browsable slideshow you need to integrate AVC SEI metadata:

Code:
ct_type: 2
nuit_field_base_flag: 1
counting_type: 4
full_timestamp_flag: 0
discontinuity_flag: 0
cnt_dropped_flag: 0
n_frame: 0
seconds_flag: 1
seconds_value: 1
(From stream produced by Scenarist's Still Image Encoder)


Those parameters can be set via libav's API

Last edited by Qarmaa; 15th May 2018 at 10:44.
Qarmaa is offline   Reply With Quote
Old 23rd August 2018, 04:22   #393  |  Link
WorldOfCrap
Registered User
 
Join Date: Aug 2018
Posts: 5
Blu-ray encoding in ffmpeg

So, as a bit of a side project, I thought I would attempt to start encoding Blu-rays in ffmpeg instead of x264 with AVIsynth. Since ffmpeg natively supports almost any video format, and is 64-bit all the way through, it would offer much faster encoding, not to mention support for Mac and *nix systems.

Since ffmpeg uses libx264, I thought that, once I translated the x264 syntax to ffmpeg syntax, we should be able to get identical results. The Scenarist crew has offered to assist in running some verification checks.

Two minor hiccups so far: First, ffmpeg apparently doesn't enforce the Level 4.0/4.1 limit on reference frames, so that setting has to be manually spelled out in ffmpeg with the flag "-refs 4"

Secondly, interlaced ProRes isn't handled properly by ffmpeg unless you tell it to use interlaced scaling (even if you're not scaling the image at all).

After some trial and error, we have the following command line that, so far, passes Eclipse verification (for 1080p/23.976):

Code:
ffmpeg -i "filename" -c:v libx264 -pass 1 -b:v 30000k -tune film -level 41 -g 24 -r 24000/1001 -pix_fmt yuv420p \
     -preset veryslow -vf setsar=sar=1/1 -refs 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
     -x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000:slices=4:open-gop=1:force-cfr=1 -y \
     -f rawvideo /dev/null
ffmpeg -i "filename" -c:v libx264 -pass 2 -b:v 30000k -tune film -level 41 -g 24 -r 24000/1001 -pix_fmt yuv420p \
       -preset veryslow -vf setsar=sar=1/1 -refs 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
       -x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000:slices=4:open-gop=1:force-cfr=1 -y \
       -f rawvideo "filename.264"
So far, so good. Now I'm working on doing the other formats. One problem is, I can't find any reference on how to pass the x264 "--pulldown 32" flag for encoding 24p SD material. The closest thing I can find is the telecine filter, but that ACTUALLY adds the extra fields to convert 24 to 30 frames, instead of just the RFF flags.

Anyone know how to do that? Thanks!

(Edit: Yes, I already tried adding pulldown=32 to -x264opts, but that didn't work.)

Last edited by WorldOfCrap; 23rd August 2018 at 07:07.
WorldOfCrap is offline   Reply With Quote
Old 23rd August 2018, 13:08   #394  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,135
As far as I know, ffmpeg doesn't support all the parameters of x264cli, so you can also evaluate to use ffmpeg just to read the file and pipe it to x264cli.
mp3dom is offline   Reply With Quote
Old 23rd August 2018, 21:43   #395  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
You can't add soft pulldown with ffmpeg for x264. Use x264 binary.
kolak is offline   Reply With Quote
Old 24th August 2018, 02:51   #396  |  Link
WorldOfCrap
Registered User
 
Join Date: Aug 2018
Posts: 5
Thanks mp3dom and kolak! I'll tinker with piping from ffmpeg to x264.

In the mean time, we've passed verification for encoding 1080i on ffmpeg! Even better, I'm getting SIGNIFICANT speed increases -- sometimes nearly 2x -- over just encoding with x264 & AVIsynth.

We've only passed as 29.97i/TFF, but 25i and BFF should work too (we'll check those next week). Just change -g 30 to -g 25 if you're doing 25 fps, and fieldorder=bff if necessary.

I'm not sure if "-flags +ilme+ildct" is still necessary or if those are deprecated, but it passed verification like this, so I'm leaving 'em in for now.

Code:
	ffmpeg -I input.file -c:v libx264 -pass 1 -b:v XXXXX -tune film -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p -preset veryslow \
-filter_complex scale=interl=1,setsar=sar=1/1,fieldorder=tff -refs 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
-x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000:slices=4:open-gop=1:force-cfr=1 -y -f rawvideo /dev/null
    	ffmpeg -I input.file -c:v libx264 -pass 2 -b:v XXXXX -tune film -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p -preset veryslow \
-filter_complex scale=interl=1,setsar=sar=1/1,fieldorder=tff -refs 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 \
-x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000:slices=4:open-gop=1:force-cfr=1 -y -f rawvideo output.264
Update: 480i/29.97 verified OK too! (Below is for 16x9 video, if you need 4x3 change sar=40/33 to sar=10/11, and also field order if necessary)

Code:
   	ffmpeg -I input.file -c:v libx264 -pass 1 -b:v XXXXX -tune film -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p \
-preset veryslow -filter_complex scale=interl=1,fieldorder=tff,setsar=sar=40/33 -refs 6 -color_primaries smpte170m -color_trc smpte170m \
-colorspace smpte170m -x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=31000:slices=4:open-gop=1:force-cfr=1 -y -f rawvideo /dev/null
   	ffmpeg -I input.file -c:v libx264 -pass 2 -b:v XXXXX -tune film -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p -preset veryslow \
-filter_complex scale=interl=1,fieldorder=tff,setsar=sar=40/33 -refs 6 -color_primaries smpte170m -color_trc smpte170m -colorspace smpte170m \
-x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=31000:slices=4:open-gop=1:force-cfr=1 -y -f rawvideo output.264"

Last edited by WorldOfCrap; 24th August 2018 at 03:05.
WorldOfCrap is offline   Reply With Quote
Old 28th August 2018, 18:42   #397  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by WorldOfCrap View Post
In the mean time, we've passed verification for encoding 1080i on ffmpeg! Even better, I'm getting SIGNIFICANT speed increases -- sometimes nearly 2x -- over just encoding with x264 & AVIsynth.
Not surprising. Since you're really encoding 24 progressive frames instead of 30 interlaced frames, there's a lot less work for the encoder to do; fewer frames and no MBAFF.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 28th August 2018, 19:42   #398  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
If you get 2x speed increase it means your test is flawed.
sneaker_ger is offline   Reply With Quote
Old 29th August 2018, 00:42   #399  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by sneaker_ger View Post
If you get 2x speed increase it means your test is flawed.
They also switched from 32-bit to 64-bit.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 26th September 2018, 03:44   #400  |  Link
WorldOfCrap
Registered User
 
Join Date: Aug 2018
Posts: 5
Welp, that didn't work. Despite passing both Sony and Panasonic's verifier, we're still getting weird stuttering errors on PS4. So I guess scratch that, gotta stick with full-blown x264.
WorldOfCrap 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 22:14.


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