record h264 rtp to a mp4 file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

record h264 rtp to a mp4 file

Terry Leung-2
Hi all,

I create a pipeline to record the h264 rtp stream into a mp4 file like below:

gst-launch -m -v ffmux_mp4 name=mux ! filesink location = /home/video/test.mp4 \
{ udpsrc name=videoudp num-buffers=1000 port=23456
caps="application/x-rtp, media=(string)video, clock-rate=(int)90000,
encoding-name=(string)H264, profile-level-id=(string)42c00d,
sprop-parameter-sets=(string)\"Z0LADZp0Cg/YCIAAAAMAgAAAD0eKFVA\\=\\,aM48gA\\=\\=\",
payload=(int)96" !  rtph264depay ! video/x-h264,width=352,height=240 !
ffdec_h264 ! videorate ! x264enc } ! mux.


The pipeline work nicely without error, but the file is not good
It can be played, but nothing can be seen(the recorded file is attached)

Anyone know what's missed in the pipeline??

version: gstreamer-0.10.22 (other plugin are the source package
downloaded in the website)

Regards,
Terry

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

test.mp4 (112K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: record h264 rtp to a mp4 file

Terry Leung-2
Hi all,

I just checked the source code of rtph264depay
I found the following comment

/* FIXME, non-bytestream handling is freaking out ffmpeg. Apparently we need to
 * group all NAL units belonging to one frame together */

I also found that there is no mechanism to group NAL unit of a frame
together (just like what it describe in the comment)
Is this the reason for my pipeline not working correctly?
Also anyone know how to group the NAL unit of the same frame together?

I have also written something like a h264depay, I use the rtp
timestamp to know if it is the same frame
However, I dont see any timestamp related stuff in the rtph264depay
source code. Anyone know how to do that in gstreamer?

Terry

On Mon, May 11, 2009 at 4:06 PM, Terry Leung <[hidden email]> wrote:

> Hi all,
>
> I create a pipeline to record the h264 rtp stream into a mp4 file like below:
>
> gst-launch -m -v ffmux_mp4 name=mux ! filesink location = /home/video/test.mp4 \
> { udpsrc name=videoudp num-buffers=1000 port=23456
> caps="application/x-rtp, media=(string)video, clock-rate=(int)90000,
> encoding-name=(string)H264, profile-level-id=(string)42c00d,
> sprop-parameter-sets=(string)\"Z0LADZp0Cg/YCIAAAAMAgAAAD0eKFVA\\=\\,aM48gA\\=\\=\",
> payload=(int)96" !  rtph264depay ! video/x-h264,width=352,height=240 !
> ffdec_h264 ! videorate ! x264enc } ! mux.
>
>
> The pipeline work nicely without error, but the file is not good
> It can be played, but nothing can be seen(the recorded file is attached)
>
> Anyone know what's missed in the pipeline??
>
> version: gstreamer-0.10.22 (other plugin are the source package
> downloaded in the website)
>
> Regards,
> Terry
>

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel