[vlc-devel] [PATCH] decode an RTP/H264 elementary stream without using SDP

Tony Vankrunkelsven Tony.Vankrunkelsven at otnsystems.com
Mon Oct 4 09:43:46 CEST 2010


Hi Konstanty,

The second command ("vlc -vvv rtp://@:5006 -S none -4 --demux=h264") on the receiver looks okay. With the patch and h264 demux specified in the command the h264 demux module is selected.
The log looks pretty similar as in my test setup. If it is an H.264 stream it should look for a SPS/PPS (see log below). If this is found then it should start decoding.
Can you send a complete log?

A remark: the patch had an update which is also posted. But that should be similar with what you are using.

h264 debug: using 25.00 fps
main debug: looking for packetizer module: 21 candidates
main debug: using packetizer module "packetizer_h264"
main debug: TIMER module_need() : 0.224 ms - Total 0.224 ms / 1 intvls (Avg 0.224 ms)
main debug: using demux module "h264"
main debug: TIMER module_need() : 0.674 ms - Total 0.674 ms / 1 intvls (Avg 0.674 ms)
packetizer_h264 warning: waiting for SPS/PPS
packetizer_h264 warning: waiting for SPS/PPS
packetizer_h264 warning: waiting for SPS/PPS
packetizer_h264 warning: waiting for SPS/PPS
packetizer_h264 debug: found NAL_SPS (sps_id=0)
packetizer_h264 debug: found NAL_PPS (pps_id=0 sps_id=0)
main debug: selecting program id=0
main debug: looking for decoder module: 33 candidates
avcodec debug: libavcodec already initialized

Regards,
Tony

From: Konstanty [mailto:konstanty at gmail.com]
Sent: zaterdag 2 oktober 2010 2:39
To: Tony Vankrunkelsven
Subject: Re: [vlc-devel] [PATCH] decode an RTP/H264 elementary stream without using SDP

Hi Tony,

I'm currently looking at using h264 over rtp without a SDP file - and can see this patch being quite useful - So thank you for contributing it.

However I can't seem to be able to view video using this method

 vlc -vvv X.mkv -S none --sout '#rtp{dst=192.168.1.2,port=5004,sdp=file:///tmp/test.sdp}'
(SDP file just being discarded basically)

Which seems to create a audio stream on 5004 and video on 5006.

Then on the receiver, I use:

vlc -vvv rtp://@:5006 -S none
or
vlc -vvv rtp://@:5006 -S none -4 --demux=h264

After your patch it seems to get a bit further though:
[0x7f9cbc000b80] main stream debug: creating demux: access='' demux='h264' location='' file='(null)'
[0x7f9cb4000a70] main demux debug: looking for demux module: 1 candidate
[0x7f9cb4000a70] h264 demux error: this doesn't look like a H264 ES stream, continuing anyway
[0x7f9cb4000a70] h264 demux debug: using 25.00 fps
[0x7f9cb4000c90] main demux packetizer debug: looking for packetizer module: 21 candidates
[0x7f9cb4000c90] main demux packetizer debug: using packetizer module "packetizer_h264"
[0x7f9cb4000a70] main demux debug: using demux module "h264"

But video never displays.

Due to your experience with this, perhaps you could shed some light on what I am doing wrong,

Thanks,

Konstanty

On Tue, Sep 21, 2010 at 9:21 PM, Tony Vankrunkelsven <Tony.Vankrunkelsven at otnsystems.com<mailto:Tony.Vankrunkelsven at otnsystems.com>> wrote:
For H264 (without transport stream TS) the RTP payload type is in the dynamic range (not static assigned, http://www.iana.org/assignments/rtp-parameters) and in some cases other protocols (like SDP) for exchanging the payload format are not available. This modification allows to decode these kind of H264 (which are compatible with Annex B "Byte stream format" of ISO/IEC 14496-10) if the demux "h264" is specified in the MRL. An example of an MRL: "rtp/h264://@239.168.100.100:1234<http://239.168.100.100:1234>"

---
 modules/access/rtp/rtp.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 modules/access/rtp/rtp.c

diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
old mode 100644
new mode 100755
index 32e13b3..672808d
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -431,7 +431,6 @@ static void codec_decode (demux_t *demux, void *data, block_t *block)
        block_Release (block);
 }

-
 static void *stream_init (demux_t *demux, const char *name)
 {
    return stream_DemuxNew (demux, name, demux->out);
@@ -454,6 +453,11 @@ static void stream_decode (demux_t *demux, void *data, block_t *block)
    (void)demux;
 }

+static void *demux_init (demux_t *demux)
+{
+    return stream_init (demux, *demux->psz_demux ? demux->psz_demux : "unknown");
+}
+
 /*
 * Static payload types handler
 */
@@ -679,7 +683,28 @@ int rtp_autodetect (demux_t *demux, rtp_session_t *session,
        break;

      default:
-        return -1;
+        /*
+         * If the rtp payload type is unknown then check demux if it is specified
+         */
+        if (*demux->psz_demux)
+        {
+          if ((strcmp(demux->psz_demux, "h264") == 0) || (strcmp(demux->psz_demux, "ts") == 0))
+          {
+            msg_Dbg (demux, "rtp autodetect specified demux=%s", demux->psz_demux);
+            pt.init = demux_init;
+            pt.destroy = stream_destroy;
+            pt.decode = stream_decode;
+            pt.frequency = 90000;
+            break;
+          }
+          else
+          {
+            return -1;
+          }
+        }
+        else {
+          return -1;
+        }
    }
    rtp_add_type (demux, session, &pt);
    return 0;
--
1.7.1

_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20101004/cc9cc8eb/attachment.html>


More information about the vlc-devel mailing list