Log in

View Full Version : H.264 for iPod touch 2G with VLC and x264?


ipodrookie
30th December 2008, 05:00
Hi!

Does anybody know working options to transcode DVD videos to iPod touch 2G firmware v2.2?

The main problem seems to be iTunes 8.0.2.20 is preventing syncronisation of transcoded H.264 files to iPod. (Like former days without special Apple UUIDs/atoms with iPod 5.5G and iTunes 7.)
Error message is like "The file xxx.mov wasn't transferred because playback isn't possible on this device." (because this is the only existing error message - independant from true reason).

But perhaps it's a coding issue, after all?

My VLC 0.8.6i command line command is:
vlc.exe "dvdsimple://D:\@1" :audio-track=1 :sout=#transcode{vcodec=h264,venc=x264{keyint=250,min-keyint=25,bframes=0,nob-adapt,b-bias=0,nobpyramid,nocabac,ref=1,nf,deblock=0:0,level=30,
nointerlaced,crf=0,qpmin=22,qpmax=51,qpstep=4,ratetol=100.0,ipratio=1.40,pbratio=1.30,qcomp=1.60,partitions=none,
direct=none,noweightb,me=umh,merange=16,subme=1,mixed-refs,mixed-ref=1,no8x8dct,trellis=0,nofast-pskip,nodct-decimate,nr=0,nopsnr,nossim},
vb=1200,fps=15.0,width=640,height=480,deinterlace}
:duplicate{dst=std{access=file,mux=mp4,dst="C:\ipodtest.m4v"}}


I've done all important settings, I think (even many tests with other values and much less options):
-nocabac
-nobframes
-level=30
-ref=1 (up to 5 or 6 should be possible with newer iPods)
-partitions=none (and additionally tested slow, fast, all)
-maximum rate: vb=1200
-width=640, height=480
-deblock=0:0

This more simple command doesn't work, too:
vlc.exe "dvdsimple://D:\@1" :audio-track=1 :sout=#transcode{vcodec=h264,venc=x264{bframes=0,nob-adapt,b-bias=0,nocabac,ref=1,nf,deblock=0:0,level=30,
crf=0,partitions=none,direct=none,me=umh,merange=12}, vb=1200,fps=15.0,width=640,height=480,deinterlace}
:duplicate{dst=std{access=file,mux=mp4,dst="C:\ipodtest.m4v"}}


By the way, mp4v is working properly (VLC 0.8.6i, too):
vlc.exe "dvdsimple://D:\@1" :audio-track=1
:sout=#transcode{vcodec=mp4v,vb=1300,width=640,height=480,acodec=mp4a,ab=128,samplerate=44100,channels=2}
:duplicate{dst=std{access=file,mux=mp4,dst="C:\ipodtest-086i-MP4V-640x480-AAC.m4v"}}



Thanks,
ipodrookie

Episodio1
30th December 2008, 15:32
If Level = 30 is referring to the profile... I guess this would be the bad option. ;)

kemuri-_9
30th December 2008, 18:03
If Level = 30 is referring to the profile... I guess this would be the bad option. ;)

no, the spec bitstream-wise treats level numbers as 10x their actual level value to have it all as int values. so level 3 becomes 30 internally,
3.1 -> 31, etc...

ACoolie
30th December 2008, 18:07
I believe level is set to a short in vlc so floats are not accepted. 30 = 3.0, 41 = 4.1, etc.
You do have some funny stuff going on with qcomp and ratetol though.
You might have better results writing the vlc stream to a raw h264 file then using MP4Box to mux to an mp4.

MP4Box -ipod -add movie.h264 -add audio.aac movie.mp4

ipodrookie
1st January 2009, 19:43
Hi Episodio1!

If Level = 30 is referring to the profile... I guess this would be the bad option. ;)

Thanks for your idea!

The level 3.0 should be ok for the newer iPods, and syntax is ok (=30 for 3.0, =13 for 1.3), too (checked with MediaInfo):
Tech specs iPod touch 2G from Apple:
Video:
- MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
- H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per second, Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats
- H.264 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Baseline Profile up to Level 3.0 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats

But by the way: as far as I know the level= option only sets the tag, it doesn't result in 3.0 profile conformity. It's the users job to set matching options, too.


ipodrookie

ipodrookie
1st January 2009, 20:37
Hi ACoolie!
You do have some funny stuff going on with qcomp and ratetol though.
You might have better results writing the vlc stream to a raw h264 file then using MP4Box to mux to an mp4.

MP4Box -ipod -add movie.h264 -add audio.aac movie.mp4

Thank you very much for your (working) idea! I've done some early tests with MP4Box muxing, now.

A mp4 file muxed with MP4Box is syncable with iTunes, now! Strike! Even without "-ipod" switch. (So it's a muxing issue with VLC!)

Playback of my first H.264 test files is sometimes ok - but at most iPod crashes (!).
Strange: The first playback usually runs. At the second attempt (and following) the iPod crashes.
(Ok, I've to do some more matching transcoding / find some better H.264 options here.)

This are my test commands (at first low bandwidth and profile 1.3 but's the same with 3.0 and 1.5Mbps):

vlc.exe "dvdsimple://D:\@1" :audio-track=2 :start-time=10 :stop-time=70 :sout=#transcode{venc=x264{bframes=0,nocabac,ref=1,nf,level=13,crf=24,partitions=none},vcodec=h264,fps=24,vb=640,width=320,height=240,acodec=none}:duplicate{dst=std{access=file,mux=raw,dst="C:\testdvd-320x240.h264"}} vlc://quit

vlc.exe "dvdsimple://D:\@1" :audio-track=2 :start-time=10 :stop-time=70 :sout=#transcode{vcodec=none,fps=24,acodec=mp4a,ab=128,samplerate=44100,channels=2}:duplicate{dst=std{access=file,mux=mp4,dst="C:\testdvd-mp4a-mp4.aac"}} vlc://quit

MP4box.exe -ipod -fps 24 -add testdvd-320x240.h264 -add testdvd-mp4a-mp4.aac testdvd-320-h264.mp4

By the way: creating the audio file with VLCs mux=raw results in a not playable (iPod and even QT) MP4Box muxed file, I've to use mux=mp4 (so muxed twice, theoretically). (What's the problem with raw audio?)
But even a MB4Box muxed file without audio forces iPod to crash.


ipodrookie