Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

I'm Missing Something...

2012-09-20
2012-12-11
  • This may not be the best place to ask but I won't be able to post on doom9's forum until 5 day's after registering.

    I've been encoding my DVD's into mp4's with handbrake, I started off using the default 3 reference frames but as I learned more about encoding I've been adapting the options.  The least capable device the files need to play on is an ipod touch which can play up to h.264 Level 3.1 and I learned from wikipedia that for DVD resolution I can use up to 11 reference frames.  So far mediainfo has shown most of the resulting files to be at level 3.1 but some files jump up to 3.2.  I was confused at first but after fiddling around a bit I realised the difference was that the 3.2 files were much more severely auto-cropped.  This confuses me, surely increasing the cropping would make the frames smaller and thus be more likely to LOWER the h.264 level.  I've checked and the bitrates are generally lower than the 3.1s.  I'm not sure how mediainfo determines the h.264 level so I have to ask is this Mediainfo's doing, or x264, or is there something about h.264 and non-standard frame sizes that I'm not aware of.  Plus, is there any way of fixing this short of reencoding with 10 reference frames (which works) or manually limiting the cropping (which leaves black bars) and would an ipod be able to play the files regardless of what mediainfo reports.

    Any help in understanding this would be appreciated.

    ndjamena

     
  • I forgot to point out that the iPod belongs to my nephew so I don't actually have it on hand to test out.

     
  • MediaInfo only provides information about how are encoded your files (level is found from the level field in the H264 seaquence header).
    The differnece of level depends only of your encoder, the level does not depend of the frame size.
    Your question is not releated to MediaInfo (the reporting tool) but to x264 (your encoder)
    FYI, yo ucan limit the level with -level and yo ucan specify the count of ref frames with -ref

     
  • Hmmm, there's nothing in the Handbrake settings to set the level.  I've tried exporting the queue, adding the -level setting to the exported files parameters and trying to encode that but it didn't work.  I may have got the syntax wrong so I'll do some research and try again.  I've also tried downloading a program that was supposed to be able to change the h.264 level but that got me nowhere.  In the comments it was written that mediainfo did a more thorough search to determine the level so I thought maybe it did it's own calculations independant of the x264 header.  I assumed the level was related to the limits of the hardware needed to decode it.  ie - 3.1 is limited to 11 720 x 576 reference frames in order to be playable on a device with a certain amount of available memory.  Is it possible these slightly off-size frames are more cpu intensive???  Does it need some kind of weird feature that isn't available in 3.1.  Is x264 just being a PITA?  If there's no actual reason these smaller files should be of a higher level than the larger ones… blah!

    Maybe I could try strict anamorphic.

    I guess I'll figure something out.

     
  • I've also tried downloading a program that was supposed to be able to change the h.264 level but that got me nowhere.

    It would change the header data, but it is only a cheat, and your file may not be playable.

    In the comments it was written that mediainfo did a more thorough search to determine the level so I thought maybe it did it's own calculations independant of the x264 header.

    Currnetly, it relies on the sequence header metadata. It does not compare to the reality.

    I assumed the level was related to the limits of the hardware needed to decode it.

    It is.

    If there's no actual reason these smaller files should be of a higher level than the larger ones… blah!

    A smaller file may have an higher peak. The peak is important.

     
  • Since it's still the same FPS I don't see how that's possible, plus the last DVD I had that problem with was Inspector Gadget put through the strongest denoise filter - I truly doubt such simplistic animation would break a level.  I've already thought about all this, which is why I used the topic name 'I'm missing something…'.  It doesn't add up, so there must be a variable missing somewhere.  I could try lowering the quality settings and see if that makes a difference, but a 10 second preview still shows the level at 3.2 and I know all I have to do is use less cropping to set it back to 3.1.  If it's a mistake I'd like to find a way to manually alter the file to show 3.1, if it's not I'd need to know why before I start lowering reference frames.

    You are being helpful by the way.  Media Info doesn't show peak bandwidth, and it's possible that a smaller frame using the same quality would keep more of it's own detail, negating the effect of the reference frames and thus increasing the peak.

    I've still got a few hours before the current lot is complete and I can start experimenting, so if there are any more ideas…

     
  • Oh, god.  I just figured out what was wrong.

    The DVD is encoded in 720 x 576, then cropping takes 10 from the left and 8 from the right to make 702 x 576.  And the problem becomes that handbrake then resizes it back to 720 while keeping the same aspect ratio which makes it 720 x 592 which is above the specs of 3.1.  It doesn't tell me it's doing that in the GUI, it's only after the encoding will mediainfo show the new resolution.  I guess all I have to do is manually set the width to match the source width minus the cropping, the undisplayed height should stay the same then and that's hopefully problem solved.  There doesn't seem to be an automatic way of doing it though.  It all makes sense now.

    We live, we learn.  I'm happy :)