Video header has empty length and file will not play

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

Video header has empty length and file will not play

william.l.metcalf
Hello all,

I am trying to take raw video and encode it into mp4 format.  I have a C
application that takes in raw video frame from a capture card and stores
them into buffer, and then I push those buffers into a gstreamer
application using appsrc.   My pipeline is translated to command line as
follows:

appsrc ! videoparse width=720 height=480 framerate=29/1 ! ffenc_mpeg4 !
qtmux ! filesink location=test.mp4

This pipeline executes correctly and doesn't report any errors, and it
produces the desired file.

I used the following pipeline to try and play the file:

gst-launch filesrc location="c:\\Encoder_Output\\test.mp4" ! decodebin !
glimagesink

This pipeline does not play the file, and produces the following output:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0: This
file is invalid and cannot be played.
Additional debug info:
..\..\..\..\..\Source\gst-plugins-good\gst\qtdemux\qtdemux.c(1804):
gst_qtdemux_loop_state_header ():
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
Header atom 'mdat' has empty length
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

After some research it seems that this problem usually occurs because of
how you exit the pipeline and end the stream.  My application works by
receiving 400 buffers.  After 400 buffers I call g_main_loop_quit(loop)
and gst_element_set_state(GST_STATE_NULL).  Is this not the correct way
to end the stream?  Can someone please provide me with some advice for
the correct way to end the stream so the header will be written
correctly and I can play the file?

Thank you in advance,
William Metcalf



_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Video header has empty length and file will not play

Edward Hervey
Administrator
Hi,

  In order for the muxer to properly 'close' the file (i.e. write the
headers), you need to send an EOS event via the source when you're done.

  gst_element_send_event(myappsrc, gst_event_new_eos());

    Edward

On Mon, 2011-07-11 at 17:40 -0500, William Metcalf wrote:

> Hello all,
>
> I am trying to take raw video and encode it into mp4 format.  I have a C
> application that takes in raw video frame from a capture card and stores
> them into buffer, and then I push those buffers into a gstreamer
> application using appsrc.   My pipeline is translated to command line as
> follows:
>
> appsrc ! videoparse width=720 height=480 framerate=29/1 ! ffenc_mpeg4 !
> qtmux ! filesink location=test.mp4
>
> This pipeline executes correctly and doesn't report any errors, and it
> produces the desired file.
>
> I used the following pipeline to try and play the file:
>
> gst-launch filesrc location="c:\\Encoder_Output\\test.mp4" ! decodebin !
> glimagesink
>
> This pipeline does not play the file, and produces the following output:
>
> Setting pipeline to PAUSED ...
> Pipeline is PREROLLING ...
> ERROR: from element
> /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0: This
> file is invalid and cannot be played.
> Additional debug info:
> ..\..\..\..\..\Source\gst-plugins-good\gst\qtdemux\qtdemux.c(1804):
> gst_qtdemux_loop_state_header ():
> /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
> Header atom 'mdat' has empty length
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> After some research it seems that this problem usually occurs because of
> how you exit the pipeline and end the stream.  My application works by
> receiving 400 buffers.  After 400 buffers I call g_main_loop_quit(loop)
> and gst_element_set_state(GST_STATE_NULL).  Is this not the correct way
> to end the stream?  Can someone please provide me with some advice for
> the correct way to end the stream so the header will be written
> correctly and I can play the file?
>
> Thank you in advance,
> William Metcalf
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel