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

About encoding, codec settings, muxers and filter usage
liilo
New Cone
New Cone
Posts: 5
Joined: 10 Jun 2009 12:16

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

Postby liilo » 10 Jun 2009 14:56

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

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 10 Jun 2009 17:57

Paste your command line.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

liilo
New Cone
New Cone
Posts: 5
Joined: 10 Jun 2009 12:16

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

Postby liilo » 10 Jun 2009 22:04

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

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 11 Jun 2009 12:41

VLC version?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

liilo
New Cone
New Cone
Posts: 5
Joined: 10 Jun 2009 12:16

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

Postby liilo » 11 Jun 2009 13:19

0.9.8 for Mac OSX intel

liilo
New Cone
New Cone
Posts: 5
Joined: 10 Jun 2009 12:16

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

Postby liilo » 12 Jun 2009 11:51

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

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

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

Postby jaimed » 16 Jun 2009 09:03

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!

vannman
New Cone
New Cone
Posts: 3
Joined: 17 Jun 2009 12:38

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

Postby vannman » 17 Jun 2009 12:52

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

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

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

Postby jaimed » 17 Jun 2009 13:07

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.

simonsea
New Cone
New Cone
Posts: 1
Joined: 21 Jun 2009 21:28

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

Postby simonsea » 21 Jun 2009 21:39

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.....
Last edited by simonsea on 22 Jun 2009 17:35, edited 1 time in total.

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

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

Postby jaimed » 22 Jun 2009 09:36

hello simonsea,

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

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

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

Postby The DJ » 22 Jun 2009 13:54

jaimed, so you open another mpeg-ts stream, to start the streamsegmenter? and then switch back to vlc transcoded mpeg-ts ?
Don't use PMs for support questions.

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

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

Postby jaimed » 23 Jun 2009 10:40

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

Blatman
New Cone
New Cone
Posts: 2
Joined: 06 May 2009 17:01

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

Postby Blatman » 23 Jun 2009 11:10

I am having the same issue with VLC1.0RC4, audio is ok but no video :(. Please help :)

Thank you

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

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

Postby jaimed » 16 Jul 2009 12:55

"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

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

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

Postby jaimed » 17 Aug 2009 14:11

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}}'

ILEoo
Developer
Developer
Posts: 91
Joined: 05 Nov 2008 16:29

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

Postby ILEoo » 18 Aug 2009 12:27

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.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 11 guests