in

MCEBuddy

Convert, Shrink and Remove Ads for Media Center

Bad MP4 conversions, analysis and a possible workaround

Last post 10-20-2008 18:02 by Gorodin. 19 replies.
Page 1 of 2 (20 items) 1 2 Next >
Sort Posts: Previous Next
  • 07-09-2008 10:56

    • jens
    • Top 500 Contributor
    • Joined on 07-09-2008

    Bad MP4 conversions, analysis and a possible workaround

    I was using MCE buddy for H.264 conversions into MP4 containers. The results were unplayable or had severe A/V sync issues. Analysis results

    (1) MENCODER support for container formats other than AVI is flawed

    (2) This is especially true when using B frames

    The workaround for me is to remux MENCODER's output using FFMPEG, i.e.

       ffmpeg.exe -i show.mp4 -vcodec copy -acodec copy show_final.mp4

    Cheers,
    Jens.

  • 08-04-2008 4:08 In reply to

    • Stark
    • Top 50 Contributor
    • Joined on 08-02-2008
    • Southsea, UK
    • Beta Tester

    Re: Bad MP4 conversions, analysis and a possible workaround

    Firstly I would like to praise MCEBuddy, for me it provides the best solution for dvr-ms. The automation, scheduling and organisation of files is excellent.

    I agree with the findings of jens. Although the H264 profile avi's are playable .mp4 is the compliant container for h.264 and aac and results in less overhead than an avi. 

    I have not attempted direct .mp4 conversion from MENCODER for the reasons above.

    I also employ a transcode workaround from the avi file produced in the current H.264 profiles to gain .mp4 files, which is far from ideal. Similar to jens I create a batch file to extract the raw audio and videostreams and remux with MP4box. MP4box creates an ISO compliant MPEG-4 stream.

    I have a very limited knowlege of what's going on under the lid of MCEBuddy/licensing etc but perhaps the mux operation could be called directly from raw streams produced through MENCODER?

    Incidentally the AAC, when played in Windows Media Player gave me a bit of trouble with missing codecs. Analysis of the faac AAC gives a codec type 706D which I assume needs faad to decode. Does faac AAC fully support the latest aac profiles, I know there has been some discussion on other posts about AAC playback problems. Is faac still being developed?  Maybe for those with the latest hardware and future support an alternative encoder may be better, Nero? I'm working around this with Nero at the moment.

    As said earlier MCEBuddy is a great tool and I look forward to future development. Thanks for the great work.

     

     

    Filed under: , , ,
  • 08-05-2008 1:08 In reply to

    Re: Bad MP4 conversions, analysis and a possible workaround

    Hi,

    I had a similar problem that surfaced after a Vista / Linksys DMA2200 upgrade.

    Found all my H.264 files played video OK but no sound.
    After a lot of testing and "trial and error" I came up with a new entry for the
    mencoder.conf
     
    My MP4 files now play with good compression and quality with no sync issues.
     
    Might be worth a try.
     
    [x264-MP4]
    profile-desc="H.264/MP4 Linksys DMA2200 Recommended"
    vf=pullup,softskip,pp=fd,scale=:-2,hqdn3d,harddup
    lavdopts=threads=4
    ovc=x264=yes
    x264encopts=threads=auto:subq=5:frameref=4:me=umh:partitions=all:b-pyramid=yes:qcomp=0.8:trellis=1:nocabac=yes:level_idc=13:bitrate=1200
    oac=faac=yes
    faacopts=br=192:raw=yes:mpeg=4:tns=yes:object=2
    af=volnorm=2
    of=lavf=yes
    lavfopts=format=mp4
    #FileExtension=mp4
    #IPod=yes
    Filed under: ,
  • 08-07-2008 9:07 In reply to

    • Stark
    • Top 50 Contributor
    • Joined on 08-02-2008
    • Southsea, UK
    • Beta Tester

    Re: Bad MP4 conversions, analysis and a possible workaround

    Sparkie

    I had a quick try of your profile yesterday and it seems to have done the trick, for me at least. No sync issues and the H.264 and AAC stream profiles seem ok, no 706D. I will have a futher test but at present this hopefully will be my chosen mencoder.conf profile entry for MP4 (H.264/AAC).

    At last I can ditch the AVI container!

    Does this disprove Jens comment (1) on Mencoder?  When I have the time i'll have to read more about Mencoder commands!

    Many thanks for your 'trial and error' it's saved me a lot of time.

     

    Filed under: ,
  • 08-07-2008 23:44 In reply to

    Re: Bad MP4 conversions, analysis and a possible workaround

    Stark:

    Sparkie

    I had a quick try of your profile yesterday and it seems to have done the trick, for me at least. No sync issues and the H.264 and AAC stream profiles seem ok, no 706D. I will have a futher test but at present this hopefully will be my chosen mencoder.conf profile entry for MP4 (H.264/AAC).

    At last I can ditch the AVI container!

    Does this disprove Jens comment (1) on Mencoder?  When I have the time i'll have to read more about Mencoder commands!

    Many thanks for your 'trial and error' it's saved me a lot of time.

     

    Guys, if you want you can try the new profile I'm currently testing for MCEBuddy 2.0

    [x264-New]
    profile-desc="H.264    New"
    vf=pullup,softskip,pp=fd,scale=:-10,hqdn3d,harddup
    lavdopts=threads=2
    ovc=x264=yes
    x264encopts=threads=auto:frameref=6:subq=7:qcomp=0.8:me=umh:me_range=24:trellis=2:bframes=0:nocabac=yes:partitions=p8x8,i4x4:level_idc=30:direct_pred=auto:deblock=-1,0:bitrate=1536:vbv_maxrate=1536:vbv_bufsize=1536
    oac=faac=yes
    faacopts=br=128:raw=yes:mpeg=4:tns=yes:object=2
    af=volnorm=2
    of=lavf=yes
    lavfopts=format=mp4
    #FileExtension=mp4
    #IPod=yes

    No sync issues and it is iTunes, iPod compatible and generally clean and safe from an MP4 perspective.  Also handles high motion a lot better.  Might be a little heavy on the CPU so let me know how you go if you use it.  MP4 is likely to become THE container for H.264 with MCEBuddy 2.0 as it doesn't have the sync issues that AVI/H2.64 has.  Working with a lot of other systems and devices is also a bonus.

    Jens comments are generally correct. To produce a viable MP4 from a mencoder transcode you need a remux (see Jens ffmpeg example).  MCEBuddy has this function, this is what #Ipod=yes does.  I'll probably rename it to #mp4remux=yes or something in MCEBuddy 2.0.

    Phredeaux

  • 08-08-2008 2:35 In reply to

    Re: Bad MP4 conversions, analysis and a possible workaround

    Phredeaux

    Just some feedback....

    I have been doing some testing in regards to [x264-New] that you have been testing and I found that to works OK.

    No sync issues.

    But I do get some shuddering on some frame transitions. This is on my Linksys DMA2100.

    Cheers

    Sparkie

     

  • 08-08-2008 6:33 In reply to

    Re: Bad MP4 conversions, analysis and a possible workaround

    Sparkie:

    Phredeaux

    Just some feedback....

    I have been doing some testing in regards to [x264-New] that you have been testing and I found that to works OK.

    No sync issues.

    But I do get some shuddering on some frame transitions. This is on my Linksys DMA2100.

    Cheers

    Sparkie

    Does it shudder with direct playback on the box or only using the extender? It's going to be hard to get the transcode any more vanilla than it is and still retain quality.

  • 08-09-2008 0:31 In reply to

    • Stark
    • Top 50 Contributor
    • Joined on 08-02-2008
    • Southsea, UK
    • Beta Tester

    Re: Bad MP4 conversions, analysis and a possible workaround

     

    Phredeaux:

    Guys, if you want you can try the new profile I'm currently testing for MCEBuddy 2.0

    [x264-New]
    profile-desc="H.264    New"
    vf=pullup,softskip,pp=fd,scale=:-10,hqdn3d,harddup
    lavdopts=threads=2
    ovc=x264=yes
    x264encopts=threads=auto:frameref=6:subq=7:qcomp=0.8:me=umh:me_range=24:trellis=2:bframes=0:nocabac=yes:partitions=p8x8,i4x4:level_idc=30:direct_pred=auto:deblock=-1,0:bitrate=1536:vbv_maxrate=1536:vbv_bufsize=1536
    oac=faac=yes
    faacopts=br=128:raw=yes:mpeg=4:tns=yes:object=2
    af=volnorm=2
    of=lavf=yes
    lavfopts=format=mp4
    #FileExtension=mp4
    #IPod=yes

    No sync issues and it is iTunes, iPod compatible and generally clean and safe from an MP4 perspective.  Also handles high motion a lot better.  Might be a little heavy on the CPU so let me know how you go if you use it.  MP4 is likely to become THE container for H.264 with MCEBuddy 2.0 as it doesn't have the sync issues that AVI/H2.64 has.  Working with a lot of other systems and devices is also a bonus.

    Jens comments are generally correct. To produce a viable MP4 from a mencoder transcode you need a remux (see Jens ffmpeg example).  MCEBuddy has this function, this is what #Ipod=yes does.  I'll probably rename it to #mp4remux=yes or something in MCEBuddy 2.0.

    Phredeaux

    Phredeaux

    I have tested the profile [x264-New] and can report that there was no audio problems or sync issues. I am using fairly low bit rates for my conversions at around the 500Kbps to suit my compression rates and space saving requirements (The original dvr-ms are around 1990Kbps).

    A further look at the encodes from yours and Sparkie profiles do not show any initial obvious differences, when I have the time I will make a more detailed viewing comparison. One thing I have noticed which affects both is that there is some brief "frame scrambling" (green visible blocks on the frames) this occurs very briefly between transitions. i.e at the cuts between the adverts and programme. I have checked and this is not present on the original dvr-ms.

    Another difference which may have some effect for is that;

    Sparkie is using a Codec Profile: Baseline@L1.3 and Codec Settings RefFrames : 4

    Phredeaux is using a Codec Profile: Baseline@L3.0 and Codec Setting RefFrames :6

    Excuse my ignorance on the x264 baseline profiles but don't these have a bearing on the hardware/bitrate requirements which may explain Sparkie's noticed problem?

    I hope the information is of use.

    Cheers.

     

    Filed under: ,
  • 08-09-2008 1:57 In reply to

    Re: Bad MP4 conversions, analysis and a possible workaround

    Phredeaux

    Just to answer your question; It does occur of both the extender and the Media Centre.

    Cheers,

    Sparkie 

     

  • 08-10-2008 5:29 In reply to

    Re: Bad MP4 conversions, analysis and a possible workaround

    Sparkie:

    Phredeaux

    Just to answer your question; It does occur of both the extender and the Media Centre.

    Cheers,

    Sparkie

    Is this with or without ad removal?

  • 08-10-2008 5:34 In reply to

    Re: Bad MP4 conversions, analysis and a possible workaround

    The main difference between the two profiles is the removal of b--frames from the resulting video, plus a couple of minor things.  These difference provide a much wider range of compatibility for the final MP4 video that it produces.  Basically, most anything that supports MP4/H.264 should work with it as is, including more sensitive devices such as iPods and the like.  The problem is that b-frames improve the quality/size payoff and this is why I've put so much time into this new profile as I wanted to get it to be as close in wuality to the old H.264 profile as I could, but removnig b-frames and improving overall compatibility.  it's hard.  But if you could not tell much difference between the two, then that is a good start.  What about the encoding time?  What was it like?


    Derek

  • 08-11-2008 9:07 In reply to

    • Stark
    • Top 50 Contributor
    • Joined on 08-02-2008
    • Southsea, UK
    • Beta Tester

    Re: Bad MP4 conversions, analysis and a possible workaround

    Phredeaux:

    Basically, most anything that supports MP4/H.264 should work with it as is, including more sensitive devices such as iPods and the like.  The problem is that b-frames improve the quality/size payoff and this is why I've put so much time into this new profile as I wanted to get it to be as close in wuality to the old H.264 profile as I could, but removnig b-frames and improving overall compatibility.

    Thanks for the further background info, I am starting to have a better understanding of the x264 options. 

    Your quote with regards to creating an MP4 profile with the greatest compatability I am not sure of your thinking with a "one size fits all" approach.

    Should not the default H264 profile contain b-frames, the benefit of this encode, then provide trimmed down profiles for differing hardware/requirements. Its hard to say what the default should be but in my opinion this should utilise the main benefits of the encoder, as well as offering a fair trade between encode time and quality as you mention.

    As promised I will reply to the profile encode times and quality as soon as I have the time.

     Cheers. 

     

    Filed under: , ,
  • 08-13-2008 3:36 In reply to

    • Stark
    • Top 50 Contributor
    • Joined on 08-02-2008
    • Southsea, UK
    • Beta Tester

    Re: Bad MP4 conversions, analysis and a possible workaround

    As promised here is my analysis of Phredeaux's and Sparkie's MP4 (H.264/AAC) encodes;

    Source Information
    Complete name                : .dvr-ms
    Format                       : Windows Media
    File size                    : 86.4 MiB
    PlayTime                     : 5mn 5s
    Bit rate mode                : VBR
    Bit rate                     : 2369 Kbps
    Maximum bit rate             : 160 Mbps

    Video #0
    Codec                        : MPEG-2 Video
    Codec/Family                 : MPEG-V
    Codec profile                : Main@Main
    Codec settings, Matrix       : Standard
    PlayTime                     : 5mn 5s
    Bit rate mode                : CBR
    Bit rate                     : 2004 Kbps
    Nominal bit rate             : 15.0 Mbps
    Width                        : 544 pixels
    Height                       : 576 pixels
    Display Aspect ratio         : 16/9
    Frame rate                   : 25.000 fps
    Chroma                       : 4:2:0
    Interlacement                : Top Field First
    Bits/(Pixel*Frame)           : 0.256
    Language                     : English

    Audio #0
    Codec                        : MPEG-1 Audio layer 2
    PlayTime                     : 5mn 5s
    Bit rate                     : 192 Kbps
    Channel(s)                   : 2 channels
    Sampling rate                : 48.0 KHz
    Resolution                   : 16 bits
    Language                     : English

    Sparkie Profile
    Format                       : MPEG-4
    Format/Info                  : ISO 14496-1 Base Media
    Format/Family                : MPEG-4
    File size                    : 22.9 MiB
    PlayTime                     : 5mn 5s
    Bit rate                     : 629 Kbps
    StreamSize/String            : 173 KiB
    Encoded date                 : UTC 1970-01-01 00:00:00
    Tagged date                  : UTC 1970-01-01 00:00:00

    Video #0
    Codec                        : AVC
    Codec/Family                 : AVC
    Codec/Info                   : Advanced Video Codec
    Codec profile                : Baseline@L1.3
    Codec settings, CABAC        : No
    Codec_Settings_RefFrames     : 4
    PlayTime                     : 5mn 5s
    Bit rate mode                : VBR
    Bit rate                     : 497 Kbps
    Width                        : 544 pixels
    Height                       : 306 pixels
    Display Aspect ratio         : 16/9
    Frame rate mode              : CFR
    Frame rate                   : 25.000 fps
    Chroma                       : 4:2:0
    Interlacement                : Progressive
    Bits/(Pixel*Frame)           : 0.119
    StreamSize/String            : 18.1 MiB
    Encoded date                 : UTC 1970-01-01 00:00:00
    Tagged date                  : UTC 1970-01-01 00:00:00

    Audio #0
    Codec                        : AAC LC
    Codec/Family                 : AAC
    Codec/Info                   : AAC Low Complexity
    PlayTime                     : 5mn 5s
    Bit rate mode                : VBR
    Bit rate                     : 128 Kbps
    Channel(s)                   : 2 channels
    Channel positions            : L R
    Sampling rate                : 48.0 KHz
    Resolution                   : 16 bits
    StreamSize/String            : 4.67 MiB
    Encoded date                 : UTC 1970-01-01 00:00:00
    Tagged date                  : UTC 1970-01-01 00:00:00

    Encode Time
    6m 49sec

    Phredeaux Profile
    Format                       : MPEG-4
    Format/Info                  : ISO 14496-1 Base Media
    Format/Family                : MPEG-4
    File size                    : 22.8 MiB
    PlayTime                     : 5mn 5s
    Bit rate                     : 626 Kbps
    StreamSize/String            : 173 KiB
    Encoded date                 : UTC 1970-01-01 00:00:00
    Tagged date                  : UTC 1970-01-01 00:00:00

    Video #0
    Codec                        : AVC
    Codec/Family                 : AVC
    Codec/Info                   : Advanced Video Codec
    Codec profile                : Baseline@L3.0
    Codec settings, CABAC        : No
    Codec_Settings_RefFrames     : 6
    PlayTime                     : 5mn 5s
    Bit rate mode                : VBR
    Bit rate                     : 493 Kbps
    Width                        : 544 pixels
    Height                       : 304 pixels
    Display Aspect ratio         : 16/9
    Frame rate mode              : CFR
    Frame rate                   : 25.000 fps
    Chroma                       : 4:2:0
    Interlacement                : Progressive
    Bits/(Pixel*Frame)           : 0.119
    StreamSize/String            : 18.0 MiB
    Encoded date                 : UTC 1970-01-01 00:00:00
    Tagged date                  : UTC 1970-01-01 00:00:00

    Audio #0
    Codec                        : AAC LC
    Codec/Family                 : AAC
    Codec/Info                   : AAC Low Complexity
    PlayTime                     : 5mn 5s
    Bit rate mode                : VBR
    Bit rate                     : 128 Kbps
    Channel(s)                   : 2 channels
    Channel positions            : L R
    Sampling rate                : 48.0 KHz
    Resolution                   : 16 bits
    StreamSize/String            : 4.67 MiB
    Encoded date                 : UTC 1970-01-01 00:00:00
    Tagged date                  : UTC 1970-01-01 00:00:00

    Encode Time
    10m 28sec

    Looking at the quality this is a difficult one to assess. At first look I think Sparkie's encode is the most pleasing to the eye, there are less artifacts visible and the image seems to be more stable. There was some minor jitter on the Phredeaux encode particularly on the transitions between scene changes. I have taken some screen shots to look in more detail and there is definately a difference. The Phredeaux encode contains a bit more detail on the slower moving scenes than Sparkie's encode but gains a lot of artifacts on the faster moving scenes and transitions.

    Overall the "averaging" effect of Sparkie's encode gives it the edge as the artifacts on Phredeaux's I found distracting and although improved detail on slower scenes this was a subtle difference in comparison.

    Hope this is of some use.

     

     

    Filed under: ,
  • 08-19-2008 4:34 In reply to

    Re: Bad MP4 conversions, analysis and a possible workaround

    Guys, I'm back now and starting on the next MCEBuddy beta. 

    The issue with the mencoder converison and remux within the MP4 container using ffmpeg and using a variant of the original MCEBuddy 1.0.8 H.264 profile is simply bframes. If the number of bframes exceeds 1, it all falls apart.  Subsequently, there's a few options in that profile which cannot be used unless you have more than 1 bframe.  So here's a high quality profile (not Apple compatible) that is also a candidate for the best default MCEBuddy transcode.  It puts a few nice things in that were removed in both the Sparkie and the Apple Compatible transcodes and removed the options that require >1 bframe.

    [x264-New]
    profile-desc="H.264    New"
    vf=pullup,softskip,pp=fd,scale=720:-2,hqdn3d,harddup
    lavdopts=threads=2
    ovc=x264=yes
    x264encopts=threads=auto:subq=6:frameref=6:me=umh:partitions=all:qcomp=0.8:trellis=1:8x8dct=yes:bime=yes:brdo=yes:nofast_pskip=yes:mixed_refs=yes:bitrate=1200
    oac=faac=yes
    faacopts=br=128:raw=yes:mpeg=4:tns=yes:object=2
    of=lavf=yes
    lavfopts=format=mp4
    ofps=24000/1001
    #FileExtension=mp4
    #IPod=yes

    This should play under quicktime and the k-lite MP4 codec pack, but not on ipods and other baseline H.264 devices due to the bframes.  Let me know how it goes. The only thing I am worried about is setting the frames per second to 24.  This is the only reliable way I've found to resolve a range of audio sync isues, however I'm not sure how it will go on NTSC playback.  Are you in the US?  On the whole I'm generally worried about a/v sync with x264 as its been an ongoing issue. 

    There's a new Xvid one coming too.

  • 08-26-2008 14:27 In reply to

    • Stark
    • Top 50 Contributor
    • Joined on 08-02-2008
    • Southsea, UK
    • Beta Tester

    Re: Bad MP4 conversions, analysis and a possible workaround

    Glad you're back and excited about the next release!

    I will report back on the latest profile in more detail when I have a moment. A quick notice was that encode times are significantly longer but guessing this is due to the added goodies in this profile.

    I am in the UK so unfortunately no help for the NTSC comments.

Page 1 of 2 (20 items) 1 2 Next >
Powered by Community Server (Non-Commercial Edition), by Telligent Systems