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

Sebastiaan van Erk sebster at sebster.com
Mon Jul 13 10:34:17 CEST 2009


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


More information about the MEncoder-users mailing list