create h263, h264 video from rtp pcap

Manfred Ehgartner manfred.ehgartner at gmx.net
Fri Aug 16 06:18:16 PDT 2013


Hello Chuck,
thanks a lot for your answer. I tried your hint, but still no luck. I adapted your pipe to my pcapfile resulting in:
gst-launch filesrc location=simpsons.pcap ! 'raw/x-pcap' ! queue ! pcapparse src-ip=192.168.30.150 src-port=49428 dst-ip=192.168.30.9 dst-port=5006 ! 'application/x-rtp,media=video,payload=96,clock-rate=90000,encoding-name=H264' ! rtph264depay byte-stream=true ! video/x-h264 ! ffdec_h264 fakesink.

I tried it also using different sinks,also using the absolute path to the sourcefile but no luck. The output I am getting is:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2543): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
streaming task paused, reason not-linked (-1)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Maybe I am still doing something wrong? Is it possible to provide you my pcap file for a quick test?

Thanks a lot for your help

Manfred

----------------------------------------------------------------------

Date: Wed, 14 Aug 2013 18:13:29 -0400
From: Chuck Crisler <ccrisler at mutualink.net>
To: Discussion of the development of and with GStreamer
	<gstreamer-devel at lists.freedesktop.org>
Subject: Re: create h263, h264 video from rtp pcap
Message-ID:
	<CALXOHKr2vHg7MH=UqDgNhjW7MaJ6EwLWHcnUi4mW_igfxj4LyQ at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

According to the documentation for PCAPPARSE, you need to supply the source
and destination IP address and port, so it can pick out the correct
packets. You also need to specify the payload type to the depayloader. Here
is my pipeline:

gst-launch filesrc location=$1 ! 'raw/x-pcap' ! queue ! pcapparse src-ip=$2
src-port=$3 dst-ip=$4 dst-port=$5 ! \

'application/x-rtp,media=video,payload=104,clock-rate=90000,encoding-name=H264'
! \
    rtph264depay byte-stream=true ! video/x-h264 ! ffdec_h264 ! xvimagesink

My pipeline doesn't play well. It plays way too fast, but I haven't had the
time to figure out how to slow it down. Perhaps some else can make a
suggestion? The problem is that there isn't a clock, so the filesrc reads
as fast as it can.

Chuck


On Wed, Aug 14, 2013 at 4:48 PM, Manfred Ehgartner <
manfred.ehgartner at gmx.net> wrote:

> Hello,****
>
> I am currently working in a project, where I have pcaps containing h263,
> h264 and mpeg I/II audio streams. For some of them I have additionally
> signaling info with a session description (SDP), for some of them just the
> rtp streams.  I need to create something playable out oft it (mpeg, AVI
> container file).****
>
> So I think I have two situations****
>
> **1)      **SDP not available (the hard case)****
>
> After trying several things, I succeeded for H264 using the tool
> videosnarf combined with ffmpeg. The output raw file of videosnarf could be
> converted to a MPEG or avi file using ffmpeg. Unfortunately, videosnarf
> doesn't support h263 and mpeg audio, so I thought gstreamer could help me
> in this case even if I know, that without SDP and with dynamic payload it
> might be quite hard or impossible to get something playable.****
>
> So using wireshark I separated the pcap just containing the udp packets
> for a single rtp stream and I tried to feed gstreamer using:****
>
> gst-launch-0.10 filesrc location=input.pcap ! pcapparse ! rtph264depay****
>
> ! ffdec_h264 ! filesink location=output.mpeg, but for almost every pcap I
> got an error. Even just using the simple pipe  gst-launch-0.10 filesrc
> location=input.pcap ! pcapparse was not working for most pcaps (and I know,
> that they are ok). The error is always something like ERROR: pipeline
> doesn't want to preroll.****
>
> So I think the problem is already in the pcapparse plugin. I tried to use
> the attributes for ip and port, but the same behaviour. Maybe I am missing
> something?****
>
> But I could skip the pcap part, as I have a script which is just taking
> the udp payload (rtp header + rtp payload) and dumping these rtp packets in
> a file. Could I maybe use some gstreamer pipeline using this rtp packet
> file as input?****
>
> ** **
>
> **2)      **SDP available: When I use my script,  I have a file
> containing rtp packets of a video streaming session (e.g. h263) and
> additionally the sdp file, my goal is to create a playable video file out
> of it (the container doesn't matter) using gstreamer.****
>
> I am not experienced using sdp, but as far as I understood, inside the sdp
> file the parameter c = IN IP4 Host defines the network parameters for the
> player which is opening the sdp. So the player is using this parameters to
> wait for incoming rtp packets fitting to the description inside the SDP, am
> I right?****
>
> So I would need to replay the rtp stream locally and use gstreamer to
> capture  the packets on the NIC for writing the container file? Or is it
> possible somehow directly feed gstreamer with the sdp + the file containing
> the already captured rtp packets and take this two input parameters for
> generating the output container directly?****
>
> ** **
>
> Thanks in advance for your help****
>
> ** **
>
> Manfred****


More information about the gstreamer-devel mailing list