AW: End Of stream issue while playing mp4 file

Thornton, Keith keith.thornton at zeiss.com
Fri Nov 18 13:57:09 UTC 2016


Hi, you have to wait for EOS to reach the filesink. When you have received the EOS Message, the MP4 file is complete. Then you can stop your pipeline.

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org] Im Auftrag von ebrahim
Gesendet: Freitag, 18. November 2016 13:26
An: gstreamer-devel at lists.freedesktop.org
Betreff: End Of stream issue while playing mp4 file

Hi,
The issue i am facing is , Iam not able to playback the mp4 file created .
The code is shown below.
This issue is happen when i use mp4mux. 
Instead of using /mp4mux/ if i use /mpegtsmux/ (currently commented) then i am able to playback the recorded video.

Another thing i have noticed is if i use videotestsrc with mp4mux, then  i am able to playback the recorded video.

/
#include <gst/gst.h>
#include <unistd.h>

int main(int argc, char *argv[]) {

	GstElement *pipeline, *source, *capsfilter, *h264parse, *mux, *sink, *encoder;
	//	GstBus *bus;
	//	GstMessage *msg;
	//	GstPad *blockpad;
	GstCaps *Cap;
	gst_init (NULL,NULL);
	Cap =
gst_caps_from_string("video/x-h264,stream-format=(string)byte-stream,width=320,height=240,framerate=30/1");

	//source = gst_element_factory_make("videotestsrc","source");
	source = gst_element_factory_make("v4l2src","source");
	capsfilter = gst_element_factory_make("capsfilter","caps");
	h264parse = gst_element_factory_make("h264parse","h264parse");
	//	mux = gst_element_factory_make("mpegtsmux","mux");
	mux = gst_element_factory_make("mp4mux","mux");
	sink = gst_element_factory_make("filesink","sink");
	encoder = gst_element_factory_make("x264enc","encoder");
	g_object_set(G_OBJECT(source), "num-buffers",300, NULL);
	
	g_object_set(sink, "location" , "test1.mp4",NULL);


	g_object_set(capsfilter,"caps",Cap,NULL);
	pipeline = gst_pipeline_new("test-pipeline");

	gst_bin_add_many(GST_BIN(pipeline),
source,encoder,capsfilter,h264parse,mux,sink,NULL);


	gst_element_link_many(source,encoder,capsfilter,h264parse,mux,sink,NULL);

	gst_element_set_state (pipeline, GST_STATE_PLAYING);
	GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "stream_graph_file");
	sleep(8);

	gst_element_send_event(source, gst_event_new_eos ());
	gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_NULL);

	gst_object_unref(GST_OBJECT(pipeline));
	return 0;

}/
vlc test1.mp4
VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28) [0x1af7118] main libvlc: Running vlc with the default interface. Use 'cvlc'
to use vlc without interface.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9f54c21280] moov atom not found [0x7f9f54c21a18] mp4 demux error: MP4 plugin discarded (no moov,foov,moof
box)
[0x7f9f54c21a18] mp4 demux error: MP4 plugin discarded (no moov,foov,moof
box)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9f54002340] moov atom not found [0x7f9f54c21a18] avformat demux error: Could not open
/home/sha/gstreamer/gstreamer/test1.mp4: Unknown error 1094995529




  gst-launch-1.0 filesrc location=test1.mp4 ! decodebin name=dec !
videoconvert ! autovideosink

(gst-plugin-scanner:8543): GStreamer-CRITICAL **: gst_structure_new_empty:
assertion 'gst_structure_validate_name (name)' failed
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element
/GstPipeline:pipeline0/GstDecodeBin:dec/GstQTDemux:qtdemux0: Invalid atom
size.
Additional debug info:
isomp4/1.2/qtdemux.c(3064): gst_qtdemux_loop_state_header ():
/GstPipeline:pipeline0/GstDecodeBin:dec/GstQTDemux:qtdemux0:
Header atom 'mdat' has empty length
ERROR: from element
/GstPipeline:pipeline0/GstDecodeBin:dec/GstQTDemux:qtdemux0: This file
contains no playable streams.
Additional debug info:
isomp4/1.2/qtdemux.c(577): gst_qtdemux_post_no_playable_stream_error ():
/GstPipeline:pipeline0/GstDecodeBin:dec/GstQTDemux:qtdemux0:
no known streams found
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/End-Of-stream-issue-while-playing-mp4-file-tp4680763.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list