[MEncoder-users] encoding video for the ipod 5g

Sebastiaan van Erk sebster at sebster.com
Sat Jul 18 09:37:53 CEST 2009


Hi,

Thanks again.

I downloaded and tried both xvidenc and h264enc with the ipod presets, 
and unfortunately my ipod is still not happy. Maybe my iPod's just 
foobar. I've tried so many different variations at the moment I don't 
know what else to try. And as you said, nobody else has complained that 
your presets don't work, so maybe it's my iPod.

Best regards,
Sebastiaan

Grozdan wrote:
> 2009/7/17 Sebastiaan van Erk <sebster at sebster.com>
>> Hi,
>>
>> Thanks for your tips. I tried them, but unfortunately my ipod still refuses to play the video...
>>
>> The commands I used were:
>>
>> mencoder $INFILE -sws 9 -of avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=300 -o /tmp/$INFILE_$$ -oac faac -vf scale=320:-2,expand=320:240:0:0:1::,harddup -faacopts mpeg=4:br=128:object=2 -srate 44100 -channels 2 -sub $SUBS -subalign 0 -subpos 75 -ofps 25 -ffourcc XVID -noodml
>> MP4Box -aviraw video /tmp/$INFILE_$$
>> MP4Box -aviraw audio /tmp/$INFILE_$$
>> mv /tmp/$INFILE_$$_audio.raw /tmp/$INFILE_$$_audio.aac
>> MP4Box -fps 25 -add /tmp/$INFILE_$$_video.cmp -add /tmp/$INFILE_$$_audio.aac -ipod -mpeg4 -new $OUTFILE
>> mp4creator -list $OUTFILE
>> rm -f /tmp/$INFILE_$$*
>>
>> I also tried the DX50 instead of XVID. The output text is attached as a text file, with "..." whenever it was printing progress info. I have no clue why my ipod isn't happy...
> 
> I've no idea why it refuses to play it. Your commands look alright to
> me. I've a bunch of scripts with iPod presets, which you may try out
> and see if it'll work for the g5. I don't have an iPod myself hence
> can't really test here
> 
> http://h264enc.sourceforge.net/index.html
> http://xvidenc.sourceforge.net/index.html
> 
> I haven't got any reports from users yet that the iPod presets in
> these scripts don't work
> 
> 
>>
>> Regards,
>> Sebastiaan
>>
>> Grozdan wrote:
>>> 2009/7/16 Sebastiaan van Erk <sebster at sebster.com>:
>>>> Hi,
>>>>
>>>> Thanks for your reply.
>>>>
>>>> I upgraded to the SVN version of mencoder:
>>>>
>>>> Warning unknown option subfont-text-scale at line 2
>>>> MPlayer SVN-r29418-4.3.2 (C) 2000-2009 MPlayer Team
>>>>
>>>> And I downloaded and installed MP4Box:
>>>>
>>>> MP4Box - GPAC version 0.4.4
>>>> GPAC Copyright: (c) Jean Le Feuvre 2000-2005
>>>>               (c) ENST 2005-200X
>>>>
>>>> I retried encoding the file, however, if I cannot get MP4Box to convert my
>>>> mencoder generated .avi to a .mp4:
>>>>
>>>> Video format FMP4 not supported - recompress the file first
>>>> Error importing /tmp/sample.avi: Feature Not Supported
>>>>
>>>> I'm using the following commandline:
>>>>
>>>> mencoder $INFILE -sws 9 -of avi -ovc lavc -lavcopts
>>>>> vcodec=mpeg4:vbitrate=300 -o /tmp/$INFILE.$$ -oac faac -vf
>>>>> scale=320:-2,expand=320:240:0:0:1::,harddup -faacopts
>>>>> mpeg=4:br=128:object=2
>>>>> -srate 44100 -channels 2 -sub $SUBS -subalign 0 -subpos 75 -ofps 25
>>>> If I use mp4creator first and then "fix" it with MP4Box -ipod I do get an
>>>> mp4 file that I can put on the ipod 5g, but again, it only plays the audio
>>>> track.
>>>>
>>>> I haven't tried the h264 video codec because it's an external dependency and
>>>> I'll have to compile it from source on my Ubuntu box, but according to the
>>>> apple spec MPEG-4 video should work too.
>>>>
>>>> Any ideas?
>>> You need to force the fourcc to something like DX50 or XVID since
>>> iPods have no clue about FMP4, nor does MP4Box. So add to your
>>> mencoder parameters -ffourcc DX50 -noodml
>>>
>>> if you don't want to re-encode the content again just to set a correct
>>> fourcc, then just copy both audio & video from your existing AVI and
>>> add the -ffourcc stuff, eg
>>>
>>> mencoder file.avi -ovc copy -oac copy -ffourcc DX50 -o output.avi
>>>
>>> Further, MP4Box does not accept AVIs so you first have to dump both
>>> the audio and video stream like this
>>>
>>> MP4Box -aviraw video file.avi
>>> MP4Box -aviraw audio file.avi
>>>
>>> In your case, since you're using AAC audio, MP4Box will dump the audio
>>> from the AVI to a file with a .raw extension. Rename that file to have
>>> .aac extension as MP4Box won't accept it else
>>>
>>> Then use:
>>> MP4Box -fps <value> -add video_file.cmp -add audio_file.aac -ipod
>>> -mpeg4 -new output.mp4
>>>
>>> (<value> is the FPS of your AVI file, so make sure it's correct when passing it)
>>>
>>>> Regards,
>>>> Sebastiaan
>>>>
>>>> Grozdan wrote:
>>>>> 2009/7/13 Sebastiaan van Erk <sebster at sebster.com>:
>>>>>> Hi,
>>>>>>
>>>>>> I know this question has been asked and answered 1000 times, and I
>>>>>> searched
>>>>>> the archives and tried pretty much everything I could find, but I still
>>>>>> can't get it working.
>>>>>>
>>>>>> PROBLEM:
>>>>>>
>>>>>> My iPod only plays the audio track but does not show the video.
>>>>>>
>>>>>> DESCRIPTION:
>>>>>>
>>>>>> I tried both the MPEG4 and H264 codecs for video. The mencoder commands I
>>>>>> used are listed below, and I make the mp4 file with mp4creator because
>>>>>> the
>>>>>> -of lavf -lavfopts format=mp4 was not working (even nautilus did not
>>>>>> recognize the file when I created it with mencoder, it listed the codec
>>>>>> as
>>>>>> unknown; also gtkpod-aac refused to upload it to the ipod). So I used the
>>>>>> procedure described in the mencoder docs at
>>>>>>
>>>>>> http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-quicktime-7.html#menc-feat-quicktime-7-remux
>>>>>> to create the final mp4.
>>>>>>
>>>>>> The commands I used:
>>>>>>
>>>>>> MPEG4:
>>>>>>
>>>>>> mencoder $INFILE -sws 9 -of avi -ovc lavc -lavcopts
>>>>>> vcodec=mpeg4:vbitrate=300 -o /tmp/$INFILE.$$ -oac faac -vf
>>>>>> scale=320:-2,expand=320:240:0:0:1::,harddup -faacopts
>>>>>> mpeg=4:br=128:object=2
>>>>>> -srate 44100 -channels 2 -sub $SUBS -subalign 0 -subpos 75 -ofps 25
>>>>>> mplayer /tmp/$INFILE.$$ -dumpvideo -dumpfile /tmp/$INFILE.$$.divx
>>>>>> mplayer /tmp/$INFILE.$$ -dumpaudio -dumpfile /tmp/$INFILE.$$.aac
>>>>>> mp4creator -create=/tmp/$INFILE.$$.divx -rate=25 $3
>>>>>> mp4creator -create=/tmp/$INFILE.$$.aac $3
>>>>>> mp4creator -list $OUTFILE
>>>>>> rm -f /tmp/$INFILE.$$*
>>>>>>
>>>>>> When I do mp4creator -list I get:
>>>>>>
>>>>>> $ mp4creator -list sample.mp4
>>>>>> Track   Type    Info
>>>>>> 1       video   MPEG-4 Simple @ L1, 61.000 secs, 299 kbps, 320x240 @
>>>>>> 25.000000 fps
>>>>>> 2       audio   MPEG-4 AAC LC, 61.068 secs, 126 kbps, 44100 Hz
>>>>>>
>>>>>> When I look at the specs of the 5g at
>>>>>>
>>>>>> http://www.everymac.com/systems/apple/consumer_electronics/stats/ipod-5th-generation-enhanced-specs.html
>>>>>> it seems to me it should be compatible:
>>>>>>
>>>>>> Video Support:  Apple reports that the iPod 5GE models support "H.264
>>>>>> video,
>>>>>> up to 1.5 Mbps, 640 by 480 pixels*, 30 frames per sec., Baseline
>>>>>> Low-Complexity Profile with AAC-LC audio up to 160 Kbps, 48 kHz, stereo
>>>>>> audio in .m4v, .mp4, and .mov file formats; H.264 video, up to 768 Kbps,
>>>>>> 320
>>>>>> by 240 pixels, 30 frames per sec., Baseline Profile up to Level 1.3 with
>>>>>> AAC-LC audio up to 160 Kbps, 48 kHz, stereo audio in .m4v, .mp4, and .mov
>>>>>> file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames
>>>>>> per
>>>>>> sec., Simple Profile with AAC-LC audio up to 160 Kbps, 48 kHz, stereo
>>>>>> audio
>>>>>> in .m4v, .mp4, and .mov file formats."
>>>>>>
>>>>>> H264:
>>>>>>
>>>>>> I also tried using H264, using the following commands:
>>>>>>
>>>>>> mencoder $INFILE -sws 9 -of avi -ovc x264 -x264encopts
>>>>>>
>>>>>> bitrate=300:vbv_maxrate=768:vbv_bufsize=244:nocabac:level_idc=13:me=umh:trellis=1:direct_pred=auto:level_idc=13:threads=2
>>>>>> -o /tmp/$INFILE.$$ -oac faac -vf
>>>>>> scale=320:-2,expand=320:240:0:0:1::,harddup
>>>>>> -faacopts mpeg=4:br=128:object=2 -srate 44100 -channels 2 -sub $2
>>>>>> -subalign
>>>>>> 0 -subpos 75 -ofps 25
>>>>>> mplayer /tmp/$INFILE.$$ -dumpvideo -dumpfile /tmp/$INFILE.$$.h264
>>>>>> mplayer /tmp/$INFILE.$$ -dumpaudio -dumpfile /tmp/$INFILE.$$.aac
>>>>>> mp4creator -create=/tmp/$INFILE.$$.h264 -rate=25 $3
>>>>>> mp4creator -create=/tmp/$INFILE.$$.aac $3
>>>>>> mp4creator -list $OUTFILE
>>>>>> rm -f /tmp/$INFILE.$$*
>>>>>>
>>>>>> This gives a file which mp4creator -list describes as follows:
>>>>>>
>>>>>> $ mp4creator -list sample.mp4
>>>>>> Track   Type    Info
>>>>>> 1       video   H264 Baseline at 1.3, 60.960 secs, 298 kbps, 320x240 @
>>>>>> 25.000000 fps
>>>>>> 2       audio   MPEG-4 AAC LC, 61.068 secs, 126 kbps, 44100 Hz
>>>>>>
>>>>>> OTHER INFO:
>>>>>>
>>>>>> My system info is:
>>>>>>
>>>>>> $ uname -a
>>>>>> Linux blauwoor 2.6.27-14-generic #1 SMP Tue Jun 30 19:57:39 UTC 2009 i686
>>>>>> GNU/Linux
>>>>>>
>>>>>> $ lsb_release -a
>>>>>> No LSB modules are available.
>>>>>> Distributor ID: Ubuntu
>>>>>> Description:    Ubuntu 8.10
>>>>>> Release:        8.10
>>>>>> Codename:       intrepid
>>>>>>
>>>>>> $ mencoder
>>>>>> MEncoder 2:1.0~rc2-0ubuntu17+medibuntu1 (C) 2000-2007 MPlayer Team
>>>>>> CPU: Genuine Intel(R) CPU           T2400  @ 1.83GHz (Family: 6, Model:
>>>>>> 14,
>>>>>> Stepping: 8)
>>>>>> CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
>>>>>> Compiled with runtime CPU detection.
>>>>>> No file given
>>>>>>
>>>>>> $ mp4creator -version
>>>>>> mp4creator - mpeg4ip version 1.6
>>>>>>
>>>>>> Any suggestions, tips, ideas are welcome.
>>>>>>
>>>>>> Thanks in advance,
>>>>>> Sebastiaan
>>>>>>
>>>>> Use MP4Box with the -ipod switch to create MP4s for iPods. mp4creator
>>>>> is highly outdated and a dead project
>>>>>
>>>>> Also, you're using a mencoder/mplayer version which is 2 years old.
>>>>> Upgrade to SVN. Ubuntu surely knows how to screw its users :)
>>>>>
>>>>>> _______________________________________________
>>>>>> MEncoder-users mailing list
>>>>>> MEncoder-users at mplayerhq.hu
>>>>>> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
>>>>>>
>>>>> _______________________________________________
>>>>> MEncoder-users mailing list
>>>>> MEncoder-users at mplayerhq.hu
>>>>> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
>>>> _______________________________________________
>>>> MEncoder-users mailing list
>>>> MEncoder-users at mplayerhq.hu
>>>> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
>>>>
>>> _______________________________________________
>>> MEncoder-users mailing list
>>> MEncoder-users at mplayerhq.hu
>>> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
>> MEncoder SVN-r29418-4.3.2 (C) 2000-2009 MPlayer Team
>> Warning unknown option subfont-text-scale at line 2
>> success: format: 0  data: 0x0 - 0x66b800
>> AVI file format detected.
>> [aviheader] Video stream found, -vid 0
>> [aviheader] Audio stream found, -aid 1
>> VIDEO:  [XVID]  624x352  12bpp  25.000 fps  744.8 kbps (90.9 kbyte/s)
>> [V] filefmt:3  fourcc:0x44495658  size:624x352  fps:25.000  ftime:=0.0400
>> ==========================================================================
>> Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
>> AUDIO: 48000 Hz, 2 ch, s16le, 112.0 kbit/7.29% (ratio: 14000->192000)
>> Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
>> ==========================================================================
>> Opening video filter: [expand osd=1]
>> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
>> Opening video filter: [harddup]
>> Opening video filter: [expand w=320 h=240 x=0 y=0 osd=1]
>> Expand: 320 x 240, 0 ; 0, osd: 1, aspect: 0.000000, round: 1
>> Opening video filter: [scale w=320 h=-2]
>> ==========================================================================
>> Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
>> Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
>> ==========================================================================
>> Forcing output FourCC to 44495658 [XVID].
>> VDec: vo config request - 624 x 352 (preferred colorspace: Planar YV12)
>> VDec: using Planar YV12 as output csp (no 0)
>> Movie-Aspect is 1.77:1 - prescaling to correct movie aspect.
>> [swscaler @ 0xa5ee460]Lanczos scaler, from yuv420p to yuv420p using MMX2
>> videocodec: libavcodec (320x240 fourcc=44495658 [XVID])
>> Pos:   0.0s      1f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
>> Writing header...
>> ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
>> Writing header...
>> ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
>> Pos: ...
>> Skipping frame!
>> Pos: ...
>> Skipping frame!
>> Pos: ...
>> Flushing video frames.
>> Writing index...
>> Writing header...
>> ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
>>
>> Video stream:  297.859 kbit/s  (37232 B/s)  size: 2271177 bytes  61.000 secs  1528 frames
>>
>> Audio stream:  128.020 kbit/s  (16002 B/s)  size: 977246 bytes  61.068 secs
>> Extracting AVI video (format XVID) to /tmp/4506_video.cmp
>> AVI Extract: ...
>> AVI Extract: ...
>> Indicated Profile: Simple Profile @ Level 1
>> Importing M4V: ...
>> AAC import - sample rate 44100 - MPEG-4 audio - 2 channels
>> Importing AAC: ...
>> Saving sample.mp4: 0.500 secs Interleaving
>> ISO File Writing: ...
>> 1       video   MPEG-4 Simple @ L1, 61.000 secs, 298 kbps, 320x240 @ 25.000000 fps
>> 2       audio   MPEG-4 AAC LC, 61.068 secs, 126 kbps, 44100 Hz
>>
>> _______________________________________________
>> MEncoder-users mailing list
>> MEncoder-users at mplayerhq.hu
>> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mencoder-users


More information about the MEncoder-users mailing list