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 23rd August 2018, 13:08   #401  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,025
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   #402  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: UK
Posts: 2,324
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   #403  |  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   #404  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,624
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 Instant Video

My Compression Book

Amazon Instant Video is hiring! PM me if you're interested.
benwaggoner is offline   Reply With Quote
Old 28th August 2018, 19:42   #405  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,126
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   #406  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,624
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 Instant Video

My Compression Book

Amazon Instant Video is hiring! PM me if you're interested.
benwaggoner is offline   Reply With Quote
Old 26th September 2018, 03:44   #407  |  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
Old 26th September 2018, 16:50   #408  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 2,624
Quote:
Originally Posted by WorldOfCrap View Post
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.

Are you getting the errors playing on a disc or via USB? As a .ts or a full BD disc image?

If itís BD-R, itís possible you might have have a burn/media issue.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Instant Video

My Compression Book

Amazon Instant Video is hiring! PM me if you're interested.
benwaggoner is offline   Reply With Quote
Old 27th September 2018, 08:50   #409  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,025
Quote:
Originally Posted by WorldOfCrap View Post
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.
There are stb players (maybe even PS4 at this point) that try to output progressive video (progressive scan) without using the RFF flags as support (they use their own internal routines in realtime).
I saw jerking movements/stuttering mainly on panning with "still text" on it (so, generally opening/endings). If that's the case, there's a solution, but not with x264 (create a stream with a mixture of soft and hard pulldown).

Last edited by mp3dom; 27th September 2018 at 08:53.
mp3dom is offline   Reply With Quote
Old 29th September 2018, 01:06   #410  |  Link
WorldOfCrap
Registered User
 
Join Date: Aug 2018
Posts: 5
@ benwaggoner: We always test via BD-R, but we tried multiple burns on multiple players, and got problems in the same general spot of the program. I also doubt it was an I/O issue because the stream that was playing back was NTSC SD with AC3 audio, so the total bitrate was no more than 5500 kbps.

@ mp3dom: This wasn't an interlaced/progressive issue. In fact, it wasn't happening for the entire stream, but randomly in localized parts of the video, for example, within the same minute. The stuttering was unlike anything I'd ever seen before -- we'd get dropped frames and dropped audio, but seldom at the same time, and although it would stutter in the same general area, it wouldn't be in exactly the same frames each time we played it back. We tried with multiple burns on multiple PS4s, and had the same issues in the same general parts of playback.

Here's some cell phone video my QC guy took, sorry for the low quality:
https://www.dropbox.com/s/emrxio2p5v..._5434.MOV?dl=0

I had the Scenarist team take a look, since I initially thought this was a mux problem with their new v8 release, and they were able to reproduce the problem, but had no idea what was causing it. PS3 had some minor hiccups on those discs (same general spot, similar issue), but PS4 was unwatchable. Re-encoding the video with standard x264 fixed everything.

Unfortunately I don't have the ability to keep trying this, so I'll have to give up on ffmpeg for now. I suspect that SOME essential BD-compliant flag isn't getting passed correctly to x264lib, or isn't implemented in that iteration of x264.

Last edited by WorldOfCrap; 29th September 2018 at 01:12.
WorldOfCrap is offline   Reply With Quote
Old 29th September 2018, 14:15   #411  |  Link
mp3dom
Registered User
 
Join Date: Jul 2003
Location: Italy
Posts: 1,025
Well... the only stuttering I can see from your video is the one on the onscreen text... and it's exactly what I told you before (text from the OP/ED). The very fine/razor text details (especially the razor horizontal border of the text) is making the player go crazy and get fooled because, with its own routines, it still try to output a 60p stream but using the wrong field matching.
You can overcome the problem simply encoding OP/ED with hard-pulldown and the rest with soft-pulldown.
This problem happens using other encoders too, and with other players as well... so it's not a direct x264/PS3-4 problem.

Last edited by mp3dom; 29th September 2018 at 14:31.
mp3dom is offline   Reply With Quote
Old 30th September 2018, 23:48   #412  |  Link
WorldOfCrap
Registered User
 
Join Date: Aug 2018
Posts: 5
Quote:
Originally Posted by mp3dom View Post
Well... the only stuttering I can see from your video is the one on the onscreen text...
Yeah, not what I was referring to -- I'm aware that there was some interlacing issues there. It's more like full-on drop-outs where the video stops for a good half-second while the audio keeps going, or the audio drops for a half-second or so while the video keeps going. (I'm not sure if that clip captured an incident where the video was affected, but it sure got several incidents with the audio, which was just fine. Again, this cleared after re-encoding the video.)
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 01:38.


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