Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here is a video file my Xbox 360 refuses to play:

$ MP4Box -info video.mp4
* Movie Info *
        Timescale 90000 - Duration 02:18:33.365
        Fragmented File no - 2 track(s)
        File Brand mp42 - version 0
        Created: GMT Sat Jul 21 07:08:55 2012

File has root IOD (9 bytes)
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: ISO Reserved Profile (0x7f)
Audio PL: High Quality Audio Profile @ Level 2 (0x0f)
No streams included in root OD

iTunes Info:
        Encoder Software: HandBrake 0.9.6 2012022800

Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 02:18:33.235
Media Info: Language "Undetermined" - Type "vide:avc1" - 199318 samples
Visual Track layout: x=0 y=0 width=1280 height=688
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 1280 x 688
        AVC Info: 1 SPS - 1 PPS - Profile High @ Level 4.1
        NAL Unit length bits: 32
Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 02:18:33.365
Media Info: Language "English" - Type "soun:mp4a" - 389689 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio MPEG-4 Audio AAC LC - 6 Channel(s) - SampleRate 48000
Synchronized on stream 1

$ avconv -i video.mp4
avconv version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav     developers
  built on Nov  6 2012 16:51:33 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2012-07-21 07:08:55
    encoder         : HandBrake 0.9.6 2012022800
  Duration: 02:18:33.36, start: 0.000000, bitrate: 2299 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 1280x688, 1973 kb/s, 23.98 fps, 90k tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 2012-07-21 07:08:55
    Stream #0.1(eng): Audio: aac, 48000 Hz, 5.1, s16, 319 kb/s
    Metadata:
      creation_time   : 2012-07-21 07:08:55
At least one output file must be specified

What tool, such as ffmpeg or mencoder, and what magic command line incantation should I use to transcode this file into a format Xbox 360 can play? I want the transcode process to retain as good video quality as possible.

With the help from slhck, I've managed to create a new mp4 file with the audio changed to two channels. However Xbox 360 still refuses to play it for some reason. Here is what MP4Box and ffmpeg says about the new file:

$ MP4Box -info final.mp4
* Movie Info *
        Timescale 1000 - Duration 02:18:33.343
        Fragmented File no - 2 track(s)
        File Brand isom - version 512
        Created: GMT Sat Jul 21 07:08:55 2012

File has root IOD (9 bytes)
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: Not part of MPEG-4 Visual profiles (0xfe)
Audio PL: Not part of MPEG-4 audio profiles (0xfe)
No streams included in root OD

iTunes Info:
        Encoder Software: Lavf53.21.0

Track # 1 Info - TrackID 1 - TimeScale 90000 - Duration 02:18:33.193
Media Info: Language "Undetermined" - Type "vide:avc1" - 199318 samples
Visual Track layout: x=0 y=0 width=1280 height=688
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 1280 x 688
        AVC Info: 1 SPS - 1 PPS - Profile High @ Level 4.1
        NAL Unit length bits: 32
Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 02:18:33.343
Media Info: Language "Undetermined" - Type "soun:mp4a" - 389688 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1
Alternate Group ID 1

$ avconv -i final.mp4   
avconv version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:33 with gcc 4.6.3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'final.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2012-07-21 07:08:55
    encoder         : Lavf53.21.0
  Duration: 02:18:33.34, start: 0.000000, bitrate: 2161 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 1280x688, 1973 kb/s, 23.98 fps, 90k     tbr, 90k tbn, 180k tbc
    Metadata:
      creation_time   : 2012-07-21 07:08:55
    Stream #0.1(und): Audio: aac, 48000 Hz, stereo, s16, 180 kb/s
    Metadata:
      creation_time   : 2012-07-21 07:08:55
At least one output file must be specified
share|improve this question

2 Answers 2

Per the Xbox Engineering Video Playback FAQ, the h.264 requirements are:

  • Video Profiles: Baseline, main, and high (up to Level 4.1) profiles.
  • Video Bitrate: 10 Mbps with resolutions of 1920 x 1080 at 30fps. See question number 11 for more information.
  • Audio Profiles: 2 channel AAC low complexity (LC)
  • Audio Max Bitrate: No restrictions.

Now, as a general command line, this should work:

ffmpeg -i input.mp4 -c:v libx264 -profile:v high -crf 23 -c:a libfaac -q:a 100 output.mp4

Change the -crf and -q:a parameters to vary the quality. Lower CRF means better. 23 is the default, but choose something between 18 and 28 and see if you like the quality. The audio quality for FAAC is in percent, so 100% is the default and higher means better.


In your specific case, all requirements are met, except for the number of audio channels. You have 5.1 audio and need to convert it to 2.0 stereo. We therefore copy the video bitstream and change the number of audio channels using the -ac option:

ffmpeg -i input.mp4 -c:a libfaac -q:a 100 -ac 2 -c:v copy output.mp4

Change the highlighted parts depending on what encoder you have—some FFmpeg versions might not bundle FAAC, so you could use the built-in encoder as well:

ffmpeg -i input.mp4 -c:a aac -strict experimental -ac 2 -c:v copy output.mp4

If you get an error about FFmpeg not being able to downmix 6-channel audio to 2-channels, what you have to do is extract the raw audio, then downsample it with FAAD.

ffmpeg -i input.mp4 -c:a copy audio-6.aac

Then, downsample to a PCM stereo WAV file:

faad -d -o audio-2.wav audio-6.aac

And remux it into the video you have. This will not re-encode the video, so it'll retain your original quality, but we'll have to encode the audio again. If you don't have libfaac, see above for the built-in alternative method using aac.

ffmpeg -i input.mp4 -i audio-2.wav -c:v copy -c:a libfaac -map 0:0 -map 1:0 output.mp4

If the video still doesn't play, you could try re-encoding the whole thing again.

share|improve this answer
    
Thanks. It almost works when I use avconv instead of ffmpeg. But then I get the error: Can not resample 6 channels @ 48000 Hz to 2 channels @ 48000 Hz –  Björn Lindqvist Dec 11 '12 at 20:17
    
Thanks but still no dice. Now I'm getting a different error on your last command: [mp4 @ 0x12aea20] Tag [1][0][0][0]/0x00000001 incompatible with output codec id '65536' –  Björn Lindqvist Dec 11 '12 at 20:41
    
Think I got it now. faad outputs PCM stereo audio, not AAC. We'll have to convert that one again. –  slhck Dec 11 '12 at 20:54
    
Alright. That creates a new video file which seem valid, but Xbox 360 still wont play it. I've updated my question with avconv and MP4Box info. –  Björn Lindqvist Dec 12 '12 at 21:38
    
Hm. I'm giving up. If I only had an Xbox to try with I'd surely help you, but as far as I can tell the file seems valid. Do you have other videos that actually play on the Xbox? We could take a look at what's different. Did you try re-encoding the (stereo audio) video bitstream as well, maybe even with ffmpeg -i input.mp4 -c:v libx264 -profile:v baseline -c:a copy output.mp4? This would give us a video stream with a lower profile. Although the Xbox supports up to High, this could be an issue as well. Or a file with no audio (-an option). At least we'd know if it's the video or audio part. –  slhck Dec 12 '12 at 21:45

I've been trying to do the same as the original poster. For whatever reason I didn't have any luck getting the instructions in slhck's answer to work. Maybe because my work laptop has ubuntu, which has replaced ffmpeg with avconv.

Anyway to cut a long story short, I gave up on using a command line solution and installed handbrake and converted the files using the Universal preset. This produced correctly formatted files in the mp4 format, but gives them m4v extensions. Rename the files to give them mp4 extensions. It means the same thing, but the xbox doesn't know that and will only read them if the extension is mp4.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.