Page 1 of 1

MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 10 Jun 2009 14:56
by liilo
Hi all,

I'm working on a live video streaming to new iPhone 3.0 os project.

As mentioned in the apple dev center, I have to use Apple Media Segmentrer to cut the video in multiples short files.

Apple Media Segmenter take as input a h264+AAC stream muxed in MPEG2 TS.

My question is : does vlc capable to do the transcoding job?
With a simple try thanks to the broadcast/transcode assistant, I've got tones of error messages with Apple Media Segmenter like :
error in pid 44 (audio) - cc value should be 13 is 15
change of pmap pid- new is 400
unknown type 2 in pid - 32767
audio pid change to 50
no start access unit
error in pid 50 (audio) - cc value should be 4 is 1
no start access unit
no start access unit
unknown type 2 in pid - 32767
no start access unit
change of pmap pid- new is 42
audio pid change to 44
no start access unit
change of pmap pid- new is 400
unknown type 2 in pid - 32767
audio pid change to 50
no start access unit
no start access unit
unknown type 2 in pid - 32767
etc...

Do you have any idea about how to do the job?

Thanks

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 10 Jun 2009 17:57
by Jean-Baptiste Kempf
Paste your command line.

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 10 Jun 2009 22:04
by liilo
Currently, I only use the streaming assistant, I tried the following command line with the same result:

Code: Select all

vlc udp://@224.1.1.201:1234 --sout='#transcode{vcodec=h264,vb=800,scale=.5,deinterlace,acodec=mp4a,ab=128}:standard{access=udp,mux=ts,dst=127.0.0.1}'
thanks for your help

liilo

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 11 Jun 2009 12:41
by Jean-Baptiste Kempf
VLC version?

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 11 Jun 2009 13:19
by liilo
0.9.8 for Mac OSX intel

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 12 Jun 2009 11:51
by liilo
I just tried with vlc 0.9.9a and the following command line :

Code: Select all

VLC udp://@224.1.1.201:1234 --sout='#transcode{vcodec=h264,vb=800,scale=0.5,acodec=mp4a,ab=128,deinterlace,channels=2}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:1234}}'
but I cant read the stream @ 127.0.0.1

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 16 Jun 2009 09:03
by jaimed
hello, I have the same problem but with a different result. I use VLC to encode the video as required by the apple segmenter (H.264+AAC), and all seems to works correctly, but the iPhone simulator doesn't show the video, only the audio. Tried to use different bitrates but got the same result. I think the video codec from VLC is not compatible with iPhone, since I made it work with another coding software.

Is there any posibility of changing/adding codecs in VLC?

thanks!

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 17 Jun 2009 12:52
by vannman
I'm experiencing a similar issue.

Running VLC 0.9.9a on Mac OS X 10.5.7 Intel.

I start the Apple segmenter using the following command:

mediastreamsegmenter -b http://172.0.0.2/stream -s 3 -D -f /stream 127.0.0.1:20000

Then I start VLC capturing from EyeTV and transcoding to h.264 and finally starting a unicast stream to the segmenter:

/Applications/VLC.app/Contents/MacOS/VLC -vlm-conf=/tmp/vlm.conf

where /tmp/vlm.conf contains the following:

new channel1 broadcast enabled
setup channel1 input 'eyetv:// :eyetv-channel=1'
setup channel1 output #transcode{venc=x264{keyint=50,min-keyint=5,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},vcodec=h264,vb=512,acodec=mp4a,width=512,height=288,audio-sync}:standard{access=udp,mux=ts,dst=127.0.0.1:20000}
control channel1 play

The Segmenter immediately outputs the following error message:

recv buf size is 42080
read pmap 42
audio pid set at 44
video pid set at 45
no start access unit
no start access unit
no start access unit
no start access unit
... and so forth

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 17 Jun 2009 13:07
by jaimed
Hello vanman

I resolved your same problem with a little trick; opening with VLC a TS video file (encoded with another software), and emitting it without doing transcoding. The segmenter won't throw the access unit error with the following files.

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 21 Jun 2009 21:39
by simonsea
This has been driving me crazy for days, has anyone actually got this to work?

In the mediastreamsegmenter readme, it doesn't mention whether the .m3u8 file needs to be manually created or whether it's created automatically when mediastreamsegmenter is correctly run in Terminal.

This is the launch script I have created:

/Applications/Utilities/MSS/mediastreamsegmenter -b 127.0.0.1/stream -s 3 -D -f /Library/WebServer/Documents/stream 127.0.0.1:1234

This is the Terminal output:

recv buf size is 42080
read pmap 42
audio pid set at 44
unknown type 2 in pid - 68

This is doing my head in.....

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 22 Jun 2009 09:36
by jaimed
hello simonsea,

seems like your video stream is not exactly what the segmenter is waiting for. Read my post above yours :)

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 22 Jun 2009 13:54
by The DJ
jaimed, so you open another mpeg-ts stream, to start the streamsegmenter? and then switch back to vlc transcoded mpeg-ts ?

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 23 Jun 2009 10:40
by jaimed
jaimed, so you open another mpeg-ts stream, to start the streamsegmenter? and then switch back to vlc transcoded mpeg-ts ?
yes, that's the way I get the segmenter to work. Strange.

Anyway, iPhone will play only the first video because of the encoding

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 23 Jun 2009 11:10
by Blatman
I am having the same issue with VLC1.0RC4, audio is ok but no video :(. Please help :)

Thank you

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 16 Jul 2009 12:55
by jaimed
"Even with correct settings it won't work as VLC does not generate NAL units to the output stream"

that's the answer from the apple forums to the "no start access unit" problem

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 17 Aug 2009 14:11
by jaimed
from viewtopic.php?f=4&t=63082&p=210918#p212377 :

In "Tools" -> "Preferences", select "All" in the Show settings box to display the advanced options. Then go to "Input/Codecs" -> "Video Codecs" -> "x264", and at the bottom of the list, tick the "Access unit delimiters" box. This will generate the NAL units required by the segmenter.

The segmenter doesn't give errors any more! but the video won't play on the iPhone, as before :( This is my command line:

Code: Select all

"/Applications/VLC.app/Contents/MacOS/VLC" -vvv -I dummy "/Users/ajln/Desktop/batman.mp4" --sout='#transcode{vcodec=h264,venc=x264{no-cabac,level=3.0,subme=5,trellis=1,merange=16,min-keyint=25,scenecut=40,ipratio=0.71,ratetol=20k,vbv-maxrate=96k,vbv-bufsize=96k,qcomp=0.6,qpmin=10,qpmax=51,qpstep=4,keyint=30,ref=1,deblock=0:0,aud},scale=1,acodec=mp4a,ab=128,samplerate=48000,channels=2,width=320,height=240}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:1234}}'

Re: MPEG2 TS output with h264+AAC (iPhone + apple segmenter)

Posted: 18 Aug 2009 12:27
by ILEoo
As mentioned on other thread, add --sout-x264-aud (or venc=x264{aud}) option on transcode-chain to get Access unit delimiters.

For video part, vlc/x264 doesn't by default generate baseline profile or correct level (not sure what profile/level iphone supports, but baseline should work level 1.2 or so).
So you could try transcode-lines from mobile-streaming in wiki to get correct options for baseline and correct level (basicly no b-frames, resolution about 320x240, no 8x8dct, no-cabac, vbv-maxrate/buffsize correctly if youre not using nightly builds). and see what level/profile x264 info tells when encoding starts.