I try to use deepstream decode sample mp4 like this:
pipeline = gst_pipeline_new ("dstest1-pipeline");
/* Source element for reading from the file */
source = gst_element_factory_make ("filesrc", "file-source");
//source = gst_element_factory_make ("uridecodebin", "file-source");
/* Since the data format in the input file is elementary h264 stream,
* we need a h264parser */
h264parser = gst_element_factory_make ("h264parse", "h264-parser");
/* Use nvdec_h264 for hardware accelerated decode on GPU */
decoder = gst_element_factory_make ("nvdec_h264", "nvh264-decoder");
/* Finally render the osd output */
sink = gst_element_factory_make ("nveglglessink", "nvvideo-renderer");
if (!pipeline || !source || !h264parser || !decoder
|| !sink) {
g_printerr ("One element could not be created. Exiting.\n");
return -1;
}
//g_object_set (G_OBJECT (source), "uri", "https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm",NULL);
/* we set the input filename to the source element */
g_object_set (G_OBJECT (source), "location","file:///home/tms/software/DeepStream_Release/samples/streams/sample_720p.h264", NULL);
/* Set up the pipeline */
/* we add all elements into the pipeline */
gst_bin_add_many (GST_BIN (pipeline),
source, h264parser, decoder, sink, NULL);
if (!gst_element_link_many (source, h264parser, decoder, sink, NULL)) {
g_printerr ("Elements could not be linked. Exiting.\n");
return -1;
}
it will be show “Elements could not be linked”,but it’s ok for .h264 file. so how to product mp4 file ?I try to read test1 but I couldn’t found difficult like me .so anybody can show me the right way?