VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 35
Thread
  1. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Hi,

    This is my input file:

    Video
    ID : 514 (0x202)
    Menu ID : 1 (0x1)
    Format : MPEG Video
    Format version : Version 2
    Format profile : 4:2:2@High
    Format settings, BVOP : Yes
    Format settings, Matrix : Custom
    Format settings, GOP : M=3, N=12
    Codec ID : 2
    Duration : 2h 9mn
    Bit rate mode : Variable
    Bit rate : 50.4 Mbps
    Maximum bit rate : 90.0 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:2
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Top Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.972
    Stream size : 45.6 GiB (94%)
    As you can see it's 1080i with very high size and bitrate, also 4:2:2 chroma. My intended output is a BD-R 25GB disc, which means I need to keep it 1080i 25fps but lower the bitrate to around 23.5Mbps with H.264 preferably, using x264.

    My frontend of choice is currently handbrake and my test output sample looks brilliant but it's progressive which isn't Blu Ray legal, it needs to be interlaced for 25fps material I believe. It seems handbrake can't take interlaced input and output it interlaced though. I tried the AVCHDCoder frontend and whilst that can do interlaced output (MBAFF) there is a problem with the output, red 'shadows' to some objects and Encore didn't like the file either. I tried with Premiere Pro which uses Mainconcept and the output of that wasn't great in my eyes although the red shadows were gone and Encore liked it.

    So which frontend for x264 would you recommend for this project and what settings I should use within in/x264? Speed isn't a concern, it can take as long as it needs to get the best output but I also don't want to waste time on extreme settings that make no difference.

    Thanks
    Quote Quote  
  2. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    i'd try keeping it mpeg-2 - mp@hl supports 1080 25i. premiere pro should do it ok with it's mc encoder.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  3. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Would there be an advantage to keeping it MPEG2? I was going to H.264 because I believed at similar bitrates it performs much better than MPEG2?
    Quote Quote  
  4. Member Chef Goldblum's Avatar
    Join Date
    Feb 2012
    Location
    Planet Earth
    Search PM
    Killer 3737 - You are not incorrect.
    Quote Quote  
  5. Originally Posted by Killer3737 View Post
    Would there be an advantage to keeping it MPEG2? I was going to H.264 because I believed at similar bitrates it performs much better than MPEG2?

    4:2:2 subsampling isn't supported by blu-ray (any format), so you would have to re-encode anyway

    yes, h.264 does perform better than MPEG2 as similar bitrates

    You could use something like Megui, but make sure to output raw avc (no container) for authoring. There are blu-ray presets in megui, but they might not be up to date. Use these commandlines as a starting guideline

    http://sites.google.com/site/x264bluray/home/1080i
    Quote Quote  
  6. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    So this was a while ago but you know how things get in the way. Anyway I went to encode this today and first started with a sample. I used the newest version of x264.exe from today and cut out a sample with VideoRedo. The command line inputted was this:

    x264 --bitrate 23500 --preset veryslow --tune grain --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --slices 4 --tff --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 sample.ts

    then

    x264 --bitrate 23500 --preset veryslow --tune grain --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --slices 4 --tff --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o out.264 sample.ts

    However the output file is a mess. Doesn't play in VLC, plays all choppy at 2/3fps in Power DVD and mediainfo says the file is variable frame rate, not 25fps. So what has gone wrong?
    Quote Quote  
  7. Are you playing raw video or in a container? You cannot check if it's raw video (most players do not support properly)

    If not using avisynth (which forces cfr), you can add --force-cfr --fps 25

    http://mewiki.project357.com/wiki/X264_Settings#force-cfr
    http://mewiki.project357.com/wiki/X264_Settings#fps
    Quote Quote  
  8. Member edDV's Avatar
    Join Date
    Mar 2004
    Location
    Northern California, USA
    Search Comp PM
    For the record, Handbrake does not support export to interlace h.264.
    Recommends: Kiva.org - Loans that change lives.
    http://www.kiva.org/about
    Quote Quote  
  9. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Are you playing raw video or in a container? You cannot check if it's raw video (most players do not support properly)

    If not using avisynth (which forces cfr), you can add --force-cfr --fps 25

    http://mewiki.project357.com/wiki/X264_Settings#force-cfr
    http://mewiki.project357.com/wiki/X264_Settings#fps
    I tried playing the raw .264 file and muxed it into an m2ts, both were the same mess. I'll try feeding it via avisynth then.
    Quote Quote  
  10. You shouldn't need to use avisynth if there aren't any decoding errors, and you force the fps and cfr

    But another reason to use avisynth is you can preview to see if there are any decoding problems, it's another step of security, IMO more reliable

    If you feed "sample.ts" directly into x264, it relies on a hierarchy of demuxers and decoders if it's been compiled with support - eg. ffms2 or lavf, and works its way down. If it settles on one that causes issues, then those problems will get propogated to your encode

    You can force a demuxer by specifying --demuxer e.g. --demuxer lavf or --demuxer avs etc...
    Quote Quote  
  11. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Yeah the problem was the TS container. I just demuxed it to a raw mpv stream with tsmuxer and encoded that with the same settings as before and the output is fine. Still says variable frame rate though so i'll also add those arguments to make sure it comes out at constant 25fps.

    One more question, is using the 'tune - grain' option a good idea, considering the source? It's obviously very high quality as it comes from a Sony XDCAM 422 @ 50Mbps but i am seeing a fair bit of grain/noise in some scenes so thought that tune was the best option?

    EDIT:
    Ok new problem, this is my new input:

    x264 --bitrate 23500 --preset veryslow --tune film --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --force-cfr --fps 25 --level 4.1 --keyint 25 --slices 4 --tff --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o constantframe.264 sam.mpv

    It plays fine and looks pretty nice but I'm seeing some strange colour issues. Yellow patches and smears. Is it something to do with the color settings and the 4:2:2 > 4:2:0 downscale? It converted to 4:2:0 automatically but is there anything specific I need to include in the input?

    This is what I mean:

    Click image for larger version

Name:	col1.png
Views:	480
Size:	484.1 KB
ID:	11382Click image for larger version

Name:	col2.png
Views:	470
Size:	416.6 KB
ID:	11383

    It happens with all RYB colours, so there are some similar yellow flashes as well. It's more noticable on playback with PowerDVD but when I was making those screenshots with VirtualDub the yellows weren't there. I don't know what's going on.
    Last edited by Killer3737; 9th Mar 2012 at 09:01.
    Quote Quote  
  12. One more question, is using the 'tune - grain' option a good idea, considering the source? It's obviously very high quality as it comes from a Sony XDCAM 422 @ 50Mbps but i am seeing a fair bit of grain/noise in some scenes so thought that tune was the best option?
    If you want to keep the noise/grain in there then it's a good idea . Very costly to encode, you need high bitrates otherwise it starts looking patchy and splotchy

    The other alternative is to reduce the grain or denoise / prefilter before encoding




    The chroma issue might be a swscale issue , a decoding issue, or it might be a interlaced chroma upscale issue (playback issue)

    What does the log file say about converting 4:2:2 => 4:2:0 ?

    Another reason I would do it in avisynth with ConvertToYV12(interlaced=true) to rule out swscale issues

    If its not autodetcting the source correctly or you can try --demuxer lavf --input-csp yuv422p --output-csp i420 , (or just get it right the first time with avisynth)




    (If you're doing these short test runs, you might want to use something faster than --preset veryslow)
    Quote Quote  
  13. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    In x264 before the encode it says:

    resize [warning]: converting from yuv422p to yuv420p.

    So If I did it with Avisynth what would my script look like, forgetting the grain for now? Just loading the file and then the color conversion line? Nothing else?
    Quote Quote  
  14. If I were doing this, I would index the video with dgindex, it will give you a .d2v index file

    MPEG2Source("file.d2v")
    ConvertToYV12(interlaced=true)
    Quote Quote  
  15. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Ok thanks, I'll give it a whirl.
    Last edited by Killer3737; 9th Mar 2012 at 10:02. Reason: fixed
    Quote Quote  
  16. Has your x264.exe been compiled with avs support?

    You shouldn't need to, but try adding --demuxer avs
    Quote Quote  
  17. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    I downloaded the latest build from the official website, but it was the 64-bit build. Switched to the 32-bit build and it's running fine now.
    Quote Quote  
  18. You can't use 64-bit binary with 32-bit avisynth. You need to "bridge" it with avs4x264 , avs4264mod or vfw4x264

    Some of the gui's will do this for you (they have everything built in)
    Quote Quote  
  19. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Ok thanks. The only reason I am using the CLI version is so I can get the output exactly as desired. I was using MeGui for example but on the GUI for x264 It wouldn't let me turn --open-gop off with --bluray-compat on. The reason I don't want --open-gop is because I'm authoring with Encore CS5 and it's a known bug that if you have that option on then it's pretty much impossible to use encore.

    http://www.x264bluray.com/issues-with-certain-players
    Quote Quote  
  20. --open-gop is disabled by default , but for megui, some of the presets have hardcoded entries, but you can change them in the custom command line box

    (megui needs a lot of attention to update the presets, but there is only 1 guy running the project currently, when there used to be 3 or 4)
    Quote Quote  
  21. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Sigh, really not having a good day. Those chroma issues are still there:

    Click image for larger version

Name:	blues.png
Views:	243
Size:	654.1 KB
ID:	11385

    The original 4:2:2 file for reference:
    Click image for larger version

Name:	fourtwotwo.png
Views:	220
Size:	715.7 KB
ID:	11386



    x264 input was the same as before, just via the avisynth script as you posted.
    Quote Quote  
  22. how are you playing this back? have you tried something else like mpchc ?(temporarily wrap it with tsmuxer)

    looks like either it's a decoding issue (your software might not support mbaff), or x264 encoding issue (very new binaries could potentially have problems, some things get broken)

    can you post some video samples of source and encode
    Quote Quote  
  23. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Those screens are directly from Virtualdub with just a deinterlace filter applied on both. The output was muxed into a transport stream and loaded via directshowsource, the original mpv file dropped straight in with the internal MPEG2 plugin. Playing them back as a TS in PowerDVD I notice the yellow patches more, in the skin.

    Here is first a sample of the output, since it's smaller and quicker to upload - http://www.mediafire.com/?5sd7118aaig1hsp

    Original to follow shortly.
    Quote Quote  
  24. Those screens are directly from Virtualdub with just a deinterlace filter applied on both.
    I'll have a look in a sec, but vdub upsamples interlaced YV12 incorrectly (converts to RGB incorrectly, because it treats interlaced YV12 as progressive), so you have to force YUY2 in the color depth options in vdub.
    Quote Quote  
  25. Yep, looks fine here; it's a playback issue, and the method in which you took screenshots in vdub
    Quote Quote  
  26. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Hmm, so the problem is on my system somewhere. Thanks anyway, at least I know the output is good and I can think about doing the full encode.

    Anyway here is the original sample - http://www.mediafire.com/?pktb6upj9zd6gdj if you still want to have a look at it and see what you think of encoding it as I am.
    Quote Quote  
  27. Originally Posted by Killer3737 View Post
    Hmm, so the problem is on my system somewhere.
    The chroma issue is not a system problem. It' s just the way vdub handles chroma it upsamples interlaced YV12 as if it were progressive

    You mentioned something else about "yellow patches?" not sure what that is, but I don't use Power DVD any more for a few years so I cannot check
    Quote Quote  
  28. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Ok so what do I need to do in VDub to get accurate screenshots?

    Regarding the yellow patches I think I was just mistaking the lights reflecting on his face.
    Quote Quote  
  29. You have to force YUY2 in the color depth options - but it doesn't always work in my experience for whatever reason. Sometimes it works after scrubbing a few frames, sometimes it doesn't.

    Also the vdub preview will do Rec601 conversion to RGB (colors will look slightly off), on the blu-ray player it will use Rec709 . I don't know anyway of changing this in vdub without avisynth

    So if you want it to get rigth it 100% of the time, load into vdub with avisynth, ConvertToRGB(matrix="Rec709", interlaced=true), or use AvsPmod to preview. If you don't specify in the script, avspmod has preview options for interlaced/progressive, Rec601/709
    Quote Quote  
  30. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Ok thanks, I was loading via an avisynth anyway as I just find it easier.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!