Problems with H.264 streaming

About encoding, codec settings, muxers and filter usage
MunEZ
New Cone
New Cone
Posts: 3
Joined: 16 Dec 2010 10:31

Problems with H.264 streaming

Postby MunEZ » 08 Feb 2011 13:12

Hi everyone!

I've encountered several problems with streaming h.264 video over the LAN.

The thing I am trying to accomplish is to encapsulate h.264 video directly into RTP (i.e. without using the TS container).
According to http://www.videolan.org/streaming-features.html it is possible.

I'm using the following commands:
vlc.exe sample_video.mpg --sout "#transcode{vcodec=h264, acodec=mp3}:rtp{mux=ts, dst=192.168.1.100, port=1234}"
vlc.exe sample_video.mpg --sout "#transcode{venc=x264}:rtp{muxt=ts, dst=192.168.1.100, port=1234}"


Both of them work fine until I remove the 'mux' parameter.

An interesting fact is that, according to WireShark software, packets are sent from the source and received at the destination, but the VLC client doesn't playback the video.

Mb somebody experienced the same issue and found a way to solve it?

Looking forward to your response.

Regards,
Sergey

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Problems with H.264 streaming

Postby Rémi Denis-Courmont » 08 Feb 2011 18:47

It works with the TS mux because TS carries codec parameters inband. If you don't use TS, you need to pass a valid SDP to the client/receiver. It can't just guess the codec parameters out of the blue!
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

MunEZ
New Cone
New Cone
Posts: 3
Joined: 16 Dec 2010 10:31

Re: Problems with H.264 streaming

Postby MunEZ » 08 Feb 2011 21:28

Can you please provide the correct syntax for this?

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Problems with H.264 streaming

Postby Rémi Denis-Courmont » 08 Feb 2011 22:22

No, I can't. I am not a computer and I don't know that by heart. Besides, I don't know your H.264 exact parameters.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

F1234K
New Cone
New Cone
Posts: 1
Joined: 10 Mar 2011 01:18

Re: Problems with H.264 streaming

Postby F1234K » 10 Mar 2011 01:37

I've been trying something similar with streaming without the TS mux option. I understand you need to do the SDP handshake to make this work, but that is what hinting tracks are for isn't it?
The files I am trying to stream have all been hinted and thus contain the sdp string inside the track atoms. This works using Darwin to quicktime player, but for the love of me I cannot get the video to work with VLC without the mux option and the transcode option turned on.

All I want to do is sent to packets via RTP and have the client do the work (no transcode). The audio is fine, but no video unless I enable transcode.

If I switch to the rtp with audio/video profile then nothing works (this where I was assuming the sdp string in the hinted tracks should be used, but doesn't appear to be).

The server seems to have no issues as it starts to stream regardless of options, but the client either does nothing or just does not display the video.

Another funny thing I noticed is that when using rtp over ts without transcoding even though the video doesn't play, the player opens the video window to the correct size like it wants to play, but then the picture just stays black. So something it working, but just not all the way. I am a little lost as to what is missing to make this work.

To give you some sort of idea this is what the sdp string looks like in the container for the video stream:
sdpText = m=video 0 RTP/AVP 96

b=AS:539

a=rtpmap:96 H264/90000

a=mpeg4-esid:1

a=control:trackID=3

a=fmtp:96 profile-level-id=42C00C; packetization-mode=1; sprop-parameter-sets=Z0LADJZ0Cgz8+AoEAAAPoAAC7UI8IhGo,aN48gA==

a=framesize:96 320-180

flew
New Cone
New Cone
Posts: 2
Joined: 12 Mar 2011 01:05

Re: Problems with H.264 streaming

Postby flew » 12 Mar 2011 01:34

Here is how I stream what I believe is a 3gp compatible stream using rtsp to send the sdp info and using no mux parameter. I use test-mpeg2 to grab HD video from a firewire enabled cable box and pipe it to vlc which transodes it to h264 with the x264 codec using the baeline profile for 3gp compatability.

This works with the built in player on my N900 over wifi or 3g and also with the quicktime player on a mac. The only problem I have with this is that audio is always out of sync by 1-3 seconds. When using mux=ts, audio sync is fine but then the my N900 can't playback the video.

test-mpeg2 -r 0 | vlc - -I Dummy --sout '#transcode{vcodec=h264,venc=x264{profile=baseline},vb=500,width=400,height=240,deinterlace,scale=1,acodec=mp4a,ab=96,channels=2,samplerate=44100,audio-sync,threads=16,high-priority=1}:rtp{sdp=rtsp://:8554/stream.sdp,mp4a-latm,timeout=60}'

qontranami
New Cone
New Cone
Posts: 4
Joined: 10 Sep 2010 01:33

Re: Problems with H.264 streaming

Postby qontranami » 17 Mar 2011 00:34

Hi Sergey and F1234K,

I don't understand why you don't want a TS container. What are you trying to achieve eventually?

From the streaming features page, I think you're looking at the third table (Muxer / audio and video formats matrix). If that is the case, the fact that RTP is checked for H.264 means that you are able to stream it using one of the containers on the left: TS, MP4 and MOV. I don't think it means that you can mux H.264 directly into RTP.

MunEZ
New Cone
New Cone
Posts: 3
Joined: 16 Dec 2010 10:31

Re: Problems with H.264 streaming

Postby MunEZ » 12 Apr 2011 14:24

Hi, qontranami!

I'm currently writing a thesis about videoconference optimization. The thing I'm trying to acomplish is to provide differenet QoS levels to various types of video packets (Right now I'm studying H.264 which has 4 different frame types).

The problem with TS encapsulation is that there could be several frames encapsulated in one IP packet, so I can provide only one QoS level to it. Contorary, using encapsulation directly in RTP, I can achieve one frame per packet videoflow segmentation...

Hope you get the idea...

fujian
New Cone
New Cone
Posts: 1
Joined: 13 Apr 2011 06:51

Re: Problems with H.264 streaming

Postby fujian » 15 Apr 2011 07:05

Hi Sergey,

Have you figured out a way to do this? I am also looking to do the streaming H264 over RTP as per
RFC3984(native RTP)

I'm a newbie to VLC though and would appreciate any help!

Thanks.

bobwolff68
New Cone
New Cone
Posts: 2
Joined: 22 Jul 2011 23:47

Re: Problems with H.264 streaming

Postby bobwolff68 » 22 Jul 2011 23:52

I am doing work in the realm of sending H.264 video on one RTP connection (non-encapsulated) and audio on a separate RTP port. We have seen some success on the PC vlc <---> vlc but when working with Android as a client, we have not had GOOD success yet - only limited. Any updates from anyone here?

bob


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 11 guests