In Gstreamer-0.10 the pipeline
gst-launch tvsrc ! queue ! deinterlace mode=1 ! vpuenc bitrate=5000000 ! matroskamux ! filesink location=./test.mp4
produces MPEG-4 file which could be played with
gst-launch filesrc location=./test.mp4 typefind=true ! aiurdemux ! queue ! vpudec ! imxv4l2sink
In Gstreamer-1.0 the equivalent pipeline
gst-launch-1.0 imxv4l2videosrc device=/dev/video0 ! deinterlace ! imxipuvideotransform ! imxvpuenc_h264 bitrate=5000 ! avimux ! filesink location=/tmp/test.mp4
produces MPEG-4 file with the framerate of 30 for both PAL and NTSC video inputs. Also, an attempt to play it with the pipeline
gst-launch-1.0 filesrc location=/tmp/test.mp4 do-timestamp=true typefind=true ! avidemux ! queue ! imxvpudec ! queue ! imxg2dvideosink
produces the following result:
Setting pipeline to PAUSED ...
[INFO] Product Info: i.MX6Q/D/S
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data flow error.
Additional debug info:
/opt/oe-toradex/build/out-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/gstreamer1.0/1.4.5-r0/gstreamer-1.4.5/libs/gst/base/gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
Still, the same file can be played with
gst-launch-1.0 playbin uri=file:///tmp/test.mp4 video-sink="imxg2dvideosink"
So, my 2 questions are:
1. How can I set the correct framerate in the encoded .mp4 files?
2. How to create a pipeline equivalent to what playbin creates?
Hello,
Please refer to section 7.3 (Multimedia use cases) of "i.MX_Linux_User's_Guide.pdf"
regarding Gstreamer usage.
Have a great day,
Yuri
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Yuri,
I have downloaded and built FSL plugins. I was able to build a working playback pipeline, but these plugins created more problems for me than resolved.
1. Recording using imxv4l2src is always set at 30fps. Not good for PAL signals.
2. If I record PAL video using 'imxv4l2videosrc fps-n=25’, playback still happens at 30 fps, but the file can be played with VLC at 25 fps.
3. Example playback pipelines using aiurdemux (7.3.1.2, 7.3.1.3) don't work for me. I have tried them on both files created by gstreamer, and downloaded from the web (sintel mp4 trailer).The same pipeline using matroskademux works OK. In Gstreamer-0.10 I did not have aiurdemux problems.
Pipeline
gst-launch-1.0 filesrc location=/tmp/test.mp4 ! matroskademux ! queue ! vpudec ! queue ! imxv4l2sink
works.
Pipeline
gst-launch-1.0 filesrc location=/tmp/test.mp4 ! aiurdemux ! queue ! vpudec ! queue ! imxv4l2sink
resulted in the following errors:
(gst-launch-1.0:1327): GStreamer-CRITICAL **: gst_element_class_add_pad_template: assertion 'GST_IS_PAD_TEMPLATE (templ)' failed
(gst-launch-1.0:1327): GStreamer-CRITICAL **: gst_pad_new_from_template: assertion 'GST_IS_PAD_TEMPLATE (templ)' failed
(gst-launch-1.0:1327): GStreamer-CRITICAL **: gst_pad_set_activate_function_full: assertion 'GST_IS_PAD (pad)' failed
(gst-launch-1.0:1327): GStreamer-CRITICAL **: gst_pad_set_activatemode_function_full: assertion 'GST_IS_PAD (pad)' failed
(gst-launch-1.0:1327): GStreamer-CRITICAL **: gst_pad_set_chain_function_full: assertion 'GST_IS_PAD (pad)' failed
(gst-launch-1.0:1327): GStreamer-CRITICAL **: gst_pad_set_event_function_full: assertion 'GST_IS_PAD (pad)' failed
(gst-launch-1.0:1327): GStreamer-CRITICAL **: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed
[INFO] Product Info: i.MX6Q/D/S
====== IMXV4L2SINK: 4.0.8 build on Jan 4 2016 10:37:23. ======
0:00:00.169867934 1327 0x1bfb360 ERROR GST_PIPELINE grammar.y:616:gst_parse_perform_link: could not link filesrc0 to aiurdemux0
WARNING: erroneous pipeline: could not link filesrc0 to aiurdemux0
Best Regards,
Alexander
Hello,
looks like You are right : imxv4l2videosrc frame rate issue · Issue #72 · Freescale/gstreamer-imx · GitHub
Regards,
Yuri.