Live transcoding for Iphone

About encoding, codec settings, muxers and filter usage
zaide
New Cone
New Cone
Posts: 2
Joined: 06 Nov 2009 16:07

Live transcoding for Iphone

Postby zaide » 06 Nov 2009 17:07

Hello,
I'm working for a chip but efficient solution. I have a farm of WindowsMedia Encoders, i would like to get the WMV/WMA stream, transcode and resize it to a H264/MP3 320x240 in a TS container. This to provide this stream, to the iphone.
So i launch this command:
vlc --sout-x264-bpyramid -I dummy -v mmsh://10.196.130.162:8989 --sout='#transcode{vcodec=h264,venc=x264{aud,no-cabac,level=3,subme=5,trellis=1,merange=16,min-keyint=25,scenecut=40,ipratio=0.71,ratetol=20k,vbv-maxrate=512k,vbv-bufsize=96k,qcomp=0.6,qpmin=10,qpmax=51,qpstep=4,keyint=30,ref=1,deblock=0:0},vb=712,scale=1,acodec=mp3,ab=56,samplerate=48000,channels=1,width=320,height=240,fps=25}:duplicate{dst=std{access=http,mux=ts,dst=:5555}}'

The transcoding are done, when i launch VLC on the 5555 tcp port, i can watch my new video format.

So next, I save this stream, to a .ts file, and launch a segmenter (http://svn.assembla.com/svn/legend/segm ... egmenter.c), on this file. and the x264 lib from the segmenter print this warning messages:
[h264 @ 0x1775360]error, non monotone timestamps 7433737149 >= 7433737149
Warning: Could not write frame of stream
[h264 @ 0x1775360]error, non monotone timestamps 7433744349 >= 7433744349
Warning: Could not write frame of stream
[h264 @ 0x1775360]error, non monotone timestamps 7433758749 >= 7433758749
Warning: Could not write frame of stream
[h264 @ 0x1775360]error, non monotone timestamps 7433765949 >= 7433765949
Warning: Could not write frame of stream
[NULL @ 0x174da40]brainfart cropping not supported, this could look slightly wrong ...
[h264 @ 0x1775360]error, non monotone timestamps 7433798349 >= 7433798349
Warning: Could not write frame of stream
[h264 @ 0x1775360]error, non monotone timestamps 7433805549 >= 7433805549
Warning: Could not write frame of stream
[h264 @ 0x1775360]error, non monotone timestamps 7433812749 >= 7433812749
Warning: Could not write frame of stream

And it give me .ts files, but when i copy it to my http server, the iphone download one, and print a message: "This movie could not be played."

Does someone have make a good transcoding for Iphone with vlc? Can he provide me this options, especially for the X264.
I have not found solution to select the "baseline" profile.

If you need others informations tell me.

Thanks for your help, i'm sure i'm close to the solution.

forzaphil
New Cone
New Cone
Posts: 8
Joined: 06 Nov 2009 20:07

Re: Live transcoding for Iphone

Postby forzaphil » 06 Nov 2009 20:23

I've been working on something similar, using the Apple Stream Segmenter, rather than the open source segmenter you're using. Looking at your command line, I don't think you'll get h.264 and MP3 to work on the iPhone. I think it has to be AAC-LC.

If you go into VLC preferences and choose "all" then choose video codecs > x264, you can set the profile to baseline and the level to 3.0 which is supported. For the Apple segmenter you have to also ensure that Access Unit Delimiters is set in the VLC x264 preferences (thanks to others on this board who found that out).

I've got everything working with the apple segmenter, but for some reason the 64k AAC audio sounds terrible. For what it's worth, here's my command line:

/Applications/VLC.app/Contents/MacOS/VLC -vvv -I dummy "/Users/<me>/desktop/foo400mpeg4.mp4" --sout="#transcode{vcodec=h264,samplerate=44100,vb=400,fps=30,acodec=mp4a,ab=64,height=240,width=320,scale=1}:standard{access=file,mux=ts,dst='-'}" | mediastreamsegmenter -f /users/<me>/desktop/output -t 30 -p

If you have an iPhone you can check out my test stream at http://www.pja.co.uk/iphone3/test.htm

zaide
New Cone
New Cone
Posts: 2
Joined: 06 Nov 2009 16:07

Re: Live transcoding for Iphone

Postby zaide » 09 Nov 2009 11:30

I don't know why you think MP3 couldn't be play inside a video on the iphone. It work fine from an Inlet encoder+segmenter for my first tests, so it's fine to play MP3 inside video.

I have already activated the "Access Unit Delimiters" option in my command line, it's the "aud" option inside the x264 segment.

I'm going to test the Apple segmenter, but i use a Linux server to transcode everything and using the Apple segmenter need me to install a Mac Os X server... sik

forzaphil
New Cone
New Cone
Posts: 8
Joined: 06 Nov 2009 20:07

Re: Live transcoding for Iphone

Postby forzaphil » 09 Nov 2009 16:27

I don't know why you think MP3 couldn't be play inside a video on the iphone.
I've only used AAC-LC. I just quoted from the iPhone specs.

From Apple website:

Video formats supported: 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; 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


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 13 guests