Problem with converted mp4s with Mediacoder

Discussion in 'Wii U - Console, Accessories and Hardware' started by DiscostewSM, Mar 17, 2013.

Mar 17, 2013
  1. DiscostewSM
    OP

    Member DiscostewSM GBAtemp Psycho!

    Joined:
    Feb 10, 2009
    Messages:
    4,799
    Location:
    Sacramento, California
    Country:
    United States
    I had recently been trying to convert videos so I can play them on my WiiU. They seem to play fine, except when I go to seek to a different spot in the video, it plays for about 30 seconds and then gets stuck into a loading loop. I was thinking it was because of the recent update, but videos already as mp4 that I didn't convert work fine when seeking. The converted videos I made would also on occasion bring up an error that it couldn't load the video. So, I was wondering if anyone has used Mediacoder and had videos successfully converted with seeking working having specific settings, or if there is a better program for this?
     
  2. trumpet-205

    Member trumpet-205 Embrace the darkness within

    Joined:
    Jan 14, 2009
    Messages:
    4,363
    Country:
    United States
    Specification for the video? What codecs did you use? How many reference frame did you pick? FPS?
     
  3. DiscostewSM
    OP

    Member DiscostewSM GBAtemp Psycho!

    Joined:
    Feb 10, 2009
    Messages:
    4,799
    Location:
    Sacramento, California
    Country:
    United States
    Here's the information of the MKV I'm trying to convert from

    Code:
    General
    Format                         : Matroska
    Format version                 : Version 2
    File size                      : 7.65 GiB
    Duration                       : 1h 41mn
    Overall bit rate               : 10.8 Mbps
    Writing application            : mkvmerge v4.1.1 ('Bouncin' Back') built on Jul  3 2010 22:54:08
    Writing library                : libebml v1.0.0 + libmatroska v1.0
     
    Video
    ID                            : 1
    Format                        : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                : High@L4.1
    Format settings, CABAC        : Yes
    Format settings, ReFrames      : 5 frames
    Codec ID                      : V_MPEG4/ISO/AVC
    Duration                      : 1h 41mn
    Bit rate                      : 9 304 Kbps
    Width                          : 1 920 pixels
    Height                        : 808 pixels
    Display aspect ratio          : 2.40:1
    Frame rate mode                : Constant
    Frame rate                    : 23.976 fps
    Color space                    : YUV
    Chroma subsampling            : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Progressive
    Bits/(Pixel*Frame)            : 0.250
    Stream size                    : 6.43 GiB (84%)
    Writing library                : x264 core 129 r2245 bc13772
    Encoding settings              : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=9304 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
    Language                      : English
    Default                        : Yes
    Forced                        : No
     
    Audio
    ID                            : 2
    Format                        : DTS
    Format/Info                    : Digital Theater Systems
    Codec ID                      : A_DTS
    Duration                      : 1h 41mn
    Bit rate mode                  : Constant
    Bit rate                      : 1 510 Kbps
    Channel(s)                    : 6 channels
    Channel positions              : Front: L C R, Side: L R, LFE
    Sampling rate                  : 48.0 KHz
    Bit depth                      : 24 bits
    Compression mode              : Lossy
    Stream size                    : 1.07 GiB (14%)
    Title                          : DTS
    Language                      : English
    Default                        : Yes
    Forced                        : No
     
    Text #1
    ID                            : 3
    Format                        : UTF-8
    Codec ID                      : S_TEXT/UTF8
    Codec ID/Info                  : UTF-8 Plain Text
    Title                          : English
    Language                      : English
    Default                        : No
    Forced                        : No
     
    Text #2
    ID                            : 4
    Format                        : UTF-8
    Codec ID                      : S_TEXT/UTF8
    Codec ID/Info                  : UTF-8 Plain Text
    Title                          : English
    Language                      : English
    Default                        : No
    Forced                        : No
     
    Menu
    00:00:00.000                  : en:00:00:00.000
    00:07:12.140                  : en:00:07:12.140
    00:16:34.910                  : en:00:16:34.910
    00:27:07.501                  : en:00:27:07.501
    00:37:25.952                  : en:00:37:25.952
    00:44:46.684                  : en:00:44:46.684
    00:48:45.130                  : en:00:48:45.130
    00:51:36.009                  : en:00:51:36.009
    00:58:56.032                  : en:00:58:56.032
    01:09:07.893                  : en:01:09:07.893
    01:13:39.623                  : en:01:13:39.623
    01:15:56.802                  : en:01:15:56.802
    01:18:52.978                  : en:01:18:52.978
    01:21:53.742                  : en:01:21:53.742
    01:27:25.365                  : en:01:27:25.365
    01:33:10.543                  : en:01:33:10.543
    
    Here are the settings I'm trying to use for transcoding to MP4 with MediaCoder...

    Code:
    Video
    Rate Mode: Average Bitrate (3800Kbps)
    Format: H.264
    Encoder: x264
    Source: MEncoder
    Profile: High
    Level: 4.1
    Preset: Fast
    Tune: Normal
    GOP: 25 ~ 250
    B-Frames: 3
    Ref. Frames: 4
     
    Audio
    Format: LC_AAC
    Encoder: Nero Encoder
    Source: Default
    Resample: Original
    Bit Depth: Original
    Rate Mode: CBR
    Bitrate/Quality: 160Kbps
    
    And here is the information of the converted MP4

    Code:
    General
    Format                         : MPEG-4
    Format profile                 : Base Media
    Codec ID                       : isom
    File size                      : 2.79 GiB
    Duration                       : 1h 41mn
    Overall bit rate mode          : Variable
    Overall bit rate               : 3 951 Kbps
    Encoded date                   : UTC 2013-03-23 21:31:18
    Tagged date                    : UTC 2013-03-23 21:31:18
     
    Video
    ID                             : 1
    Format                         : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                 : High@L4.1
    Format settings, CABAC         : Yes
    Format settings, ReFrames      : 3 frames
    Codec ID                       : avc1
    Codec ID/Info                  : Advanced Video Coding
    Duration                       : 1h 41mn
    Bit rate                       : 3 800 Kbps
    Maximum bit rate               : 29.9 Mbps
    Width                          : 1 920 pixels
    Height                         : 808 pixels
    Display aspect ratio           : 2.40:1
    Frame rate mode                : Constant
    Frame rate                     : 23.976 fps
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Progressive
    Bits/(Pixel*Frame)             : 0.102
    Stream size                    : 2.68 GiB (96%)
    Writing library                : x264 core 130 r2273 b3065e6
    Encoding settings              : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=abr / mbtree=1 / bitrate=3800 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Encoded date                   : UTC 2013-03-23 21:31:18
    Tagged date                    : UTC 2013-03-23 21:34:57
     
    Audio
    ID                             : 2
    Format                         : AAC
    Format/Info                    : Advanced Audio Codec
    Format profile                 : LC
    Codec ID                       : 40
    Duration                       : 1h 41mn
    Bit rate mode                  : Variable
    Bit rate                       : 160 Kbps
    Maximum bit rate               : 168 Kbps
    Channel(s)                     : 2 channels
    Channel positions              : Front: L R
    Sampling rate                  : 48.0 KHz
    Compression mode               : Lossy
    Stream size                    : 116 MiB (4%)
    Encoded date                   : UTC 2013-03-23 21:34:24
    Tagged date                    : UTC 2013-03-23 21:34:57
     
    
    As I said, the video after conversion runs fine from start to finish on the Wii U, but if I decide to skip to a different section of the video, it will play for about 30 seconds at most and then it will go into a continual "loading" loop. I can seek to a different part of the video from that, but the same thing happens as a result.

    I have attempted to use a different converter, such as Handbrake, but I'm having problems converting with that as well. Using the "High" preset for it. The video doesn't seem to have the seek problem as MediaCoder does, but it also stops encoding at a certain part of the video every time. I found out that was due to something in the MKV container, as I used MkvToMP4, then tried Handbrake and it encoded completely. Unfortunately, that ended up desyncing the audio by a smidgen, which I think is because it sets the audio to Variable bitrate rather than Constant with no option to change it.
     
  4. trumpet-205

    Member trumpet-205 Embrace the darkness within

    Joined:
    Jan 14, 2009
    Messages:
    4,363
    Country:
    United States
    Pick Constant Quality under Video tab, set it to 22 RF.

    Under Audio tab in Handbrake, you should be able to pick audio bitrate (64/80/96/112/128/160....).

    Select it to output to .mkv.

    If that still caused the audio to de-synched, use mkvtoolnix (mkvextract) to extract DTS audio file from that source .mkv file. From there use LameXP to convert DTS to AAC (put Nero AAC encoder under the same folder as LameXP). Finally use mkvtoolnix (mmg) to add AAC audio back to the de-synched .mkv file.

    After that, simply convert .mkv to .mp4
     
  5. DiscostewSM
    OP

    Member DiscostewSM GBAtemp Psycho!

    Joined:
    Feb 10, 2009
    Messages:
    4,799
    Location:
    Sacramento, California
    Country:
    United States
    I made some big progress into what the problem is. I had extracted the video stream from the mkv and converted it to mp4 (so no audio), and that seemed to play just fine on the Wii U. When I went to convert the audio and mux the streams together, the video stopped working correctly as explained above with seeking. So, I'm glad it isn't the video stream, because that takes so long to transcode compared to the audio. So, I'll give your method of extracting the DTS and using LameXP to convert to AAC a try to see if that works.
     
  6. DiscostewSM
    OP

    Member DiscostewSM GBAtemp Psycho!

    Joined:
    Feb 10, 2009
    Messages:
    4,799
    Location:
    Sacramento, California
    Country:
    United States
    It seems I was wrong in my last post. The MP4 containing only the video stream worked, but attempts to use it alongside AAC from different compressors keeps causing problems. I was referred to DVDVideoSoft by a friend, and its conversion, while working on the Wii U, is slightly worse quality and with desyncing. I tried Yamb with a mixture of video and audio streams, and I've concluded that it is the video stream made through MediaCoder. When alone, it runs fine, but when contained alongside an audio stream, it messes up, to which I have no idea.

    What I did notice was that DVDVideoSoft was using GPU encoding for its transcoding, so, when I switched to CUDA encoding on MediaCoder, the output was also worse (for reasons explained by various experts on GPU encoding), but the video played with no problems whatsoever.

    So the question is, what is CPU encoding doing that is causing this problem that GPU encoding isn't, and is the difference between the two allowing the video transcoding quality to be better with CPU encoding at the same bitrate? If it is purely to make CPU encoding to run faster than it normally would, then I'd love to know what to set/disable, as I'm not too worried about time. But, if it has something to do with improved compression, then that would be a problem.

    Here are the settings I used for CUDA encoding with MediaCoder

    Code:
    Preset: BD
    Profile: High
    Level: 4.1
    B-Frames: 3
    Device: 0
    Offload: Full
    Use GPU Memory: checked
    CABAC: checked
    SPS: checked
    Dynamic GOP: unchecked
    Deblocking: checked
    
     
  7. trumpet-205

    Member trumpet-205 Embrace the darkness within

    Joined:
    Jan 14, 2009
    Messages:
    4,363
    Country:
    United States
    GPU encoding doesn't work while CUDA works? That doesn't make sense at all. Both is using GPU to do the encoding, one is OpenCL while the other is CUDA.

    The only hypothesis I can came up was that Wii U choked on decoding that video file. When you switched to different encoders with different encoding settings, some features were not used. Wii U doesn't have a hardware H.264 decoder (unlike PS3 and Xbox 360), so everything is done on software acceleration/CPU level. Maybe too many features were enabled that caused Wii U CPU to choke.

    As for why CPU encoding has better quality than GPU encoding, it is because both OpenCL and CUDA only excels at one thing, simple calculation at rapid speed. CPU encoding can do complex calculation (GPU can't and have to use simple calculation in place), which helps it retain the quality better.

    AAC sounds worse when you drop its bitrate. At low bitrate, even MP3 will sound better than AAC, but you cannot use MP3 inside MP4 container.

    Can you try this? Using handbrake, disable CABAC (lessen decoding stress but larger files).
     
  8. DiscostewSM
    OP

    Member DiscostewSM GBAtemp Psycho!

    Joined:
    Feb 10, 2009
    Messages:
    4,799
    Location:
    Sacramento, California
    Country:
    United States
    Hmm, I thought the x264 video encoder in MediaCoder was all CPU......

    Anyways, while I haven't tried disabling CABAC in Handbrake for encoding (for one reason, playback had no problem with encoding on that, but converting the MKV stopped prematurely), I did try something different with MediaCoder, and that was trying a different Preset. By default, it was set at Medium. I set it to Ultra-Fast (which disables CABAC, though the settings page did not reflect that, I had to check with MediaInfo after the conversion), which encoded about 4 times faster at the expense of a little less quality and gaining about 1.5GB on the final filesize. The video, however, did play just fine on the Wii U with no seeking problems, so it would seem it can only handle so much, though I am perplexed how that can be the case when seeking would cause the problem while playing from start to finish with no seeking wouldn't. Makes me think that while CABAC contributes to the overall problem, I think something else might be contributing to it too (since converting with Handbrake + CABAC enabled did not have problems).

    I'm currently attempting the Fast preset (73% done atm), which is between the Ultra-Fast and Medium presets. It does have CABAC enabled, but might have other features disabled. I'm also waiting for responses on the official MediaCoder forums, to see if they have any insight on this.

    edit:

    Just tested the transcoded version using the Fast preset on the Wii U, and I have yet to experience the problem within the 5 minutes of playback testing after seeking. Will do an extensive test in the morning. Quality was even less dissimilar from that encoded with Medium, and filesize is just about the same as Medium as well. If I continue to have no problems with this preset, then it'll likely be what I use for encoding Wii U videos from now on.

    Thanks for your help.
     
  9. trumpet-205

    Member trumpet-205 Embrace the darkness within

    Joined:
    Jan 14, 2009
    Messages:
    4,363
    Country:
    United States
    Mind posting information about that MP4 after converted with Fast preset. I want to see if there is any feature that was disabled.
     
  10. DiscostewSM
    OP

    Member DiscostewSM GBAtemp Psycho!

    Joined:
    Feb 10, 2009
    Messages:
    4,799
    Location:
    Sacramento, California
    Country:
    United States
    Here ya go.

    Code:
    General
    Format                        : MPEG-4
    Format profile                : Base Media
    Codec ID                      : isom
    File size                      : 2.94 GiB
    Duration                      : 1h 41mn
    Overall bit rate mode          : Variable
    Overall bit rate              : 4 161 Kbps
    Encoded date                  : UTC 2013-03-27 06:22:39
    Tagged date                    : UTC 2013-03-27 06:22:39
     
    Video
    ID                            : 1
    Format                        : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                : High@L4.1
    Format settings, CABAC        : Yes
    Format settings, ReFrames      : 3 frames
    Codec ID                      : avc1
    Codec ID/Info                  : Advanced Video Coding
    Duration                      : 1h 41mn
    Bit rate                      : 3 997 Kbps
    Maximum bit rate              : 36.8 Mbps
    Width                          : 1 920 pixels
    Height                        : 808 pixels
    Display aspect ratio          : 2.40:1
    Frame rate mode                : Constant
    Frame rate                    : 23.976 fps
    Color space                    : YUV
    Chroma subsampling            : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Progressive
    Bits/(Pixel*Frame)            : 0.107
    Stream size                    : 2.83 GiB (96%)
    Writing library                : x264 core 130 r2273 b3065e6
    Encoding settings              : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=4 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=20 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Encoded date                  : UTC 2013-03-27 06:22:39
    Tagged date                    : UTC 2013-03-27 06:26:20
     
    Audio
    ID                            : 2
    Format                        : AAC
    Format/Info                    : Advanced Audio Codec
    Format profile                : LC
    Codec ID                      : 40
    Duration                      : 1h 41mn
    Bit rate mode                  : Variable
    Bit rate                      : 160 Kbps
    Maximum bit rate              : 168 Kbps
    Channel(s)                    : 2 channels
    Channel positions              : Front: L R
    Sampling rate                  : 48.0 KHz
    Compression mode              : Lossy
    Stream size                    : 116 MiB (4%)
    Encoded date                  : UTC 2013-03-27 06:26:09
    Tagged date                    : UTC 2013-03-27 06:26:20
    
    I let this video run now for a good 20 minutes after seeking to a different part of the video, and it has had no problems, so that's good.

    I also let my computer run over night encoding the same video under the same Preset, except I increased the bitrate on both the video and audio (4,636Kbps for video, 320Kbps for audio). Unfortunately, that seemed to generate the same seeking problem as before. Though I'm not sure what's going on, what I'm going to do before I head to work is use Yamb, and try a combination of the 2 transcoded MP4s, one with only the video bitrate increased, and the other with only the audio bitrate increased, and then test them, just to see if anything crops up from them.

    edit:
    Just finished testing those 2 remuxes. the one with the lower video bitrate and the higher audio bitrate seems to work fine, but the higher video bitrate and lower audio bitrate does not after seeking.
     

Share This Page