AnsweredAssumed Answered

gstreamer cannot pause imxv4l2videosrc,  audio and video delayed

Question asked by Chris Roed on Aug 23, 2016
Latest reply on Aug 28, 2016 by igorpadykov

Wandboard 3.14.28 kernel

Arch linux,

gstreamer-imx commit 76c15a0e4380f5499a8476685aaede24aac4894c
                         Merge: 77d81f7 b5a607c
                         Author: dv1 <dv@pseudoterminal.org>
                         Date: Thu Aug 11 08:58:37 2016 +0200

 

 

I'm having an odd error with gstreamer.  I'm streaming an audio/video stream to a file and finding out that the imxv4l2videosrc element has some issues.  First of all, the audio is about 2 seconds out of sync with the video.  I was able to solve this by inserting a queue into pipeline (see bold below)

 

gst-launch-1.0 \
      flvmux streamable=true name=muxer ! \
      filesink location=test.mp4 \
   imxv4l2videosrc queue-size=7 fps-n=30 ! queue ! \
      imxipuvideotransform ! imxvpuenc_h264 quant-param=31 ! h264parse ! \
      muxer.video \

   alsasrc ! audio/x-raw,channels=1 ! queue ! \
      audioconvert ! \
      faac rate-control=2 ! \
      muxer.audio

 

However, that added queue element causes the imxv4l2src to not got into paused state, which blocks gstreamer from closing the stream.

 

0:00:12.946507050 3886 0xc73c00 INFO GST_STATES gstbin.c:2316:gst_bin_element_set_state:<imxv4l2videosrc0> current PLAYING pending VOID_PENDING, desired next PAUSED  <<<----- I NEVER GET PAST HERE WHEN QUEUE ELEMENT IS PRESENT


0:00:12.946672394 3886 0xc73c00 INFO GST_STATES gstelement.c:2372:gst_element_continue_state:<imxv4l2videosrc0> completed state change to PAUSED


0:00:12.946795402 3886 0xc73c00 INFO GST_STATES gstelement.c:2277:_priv_gst_element_state_changed:<imxv4l2videosrc0> notifying about state-cha
nged PLAYING to PAUSED (VOID_PENDING pending)


0:00:12.946975747 3886 0xc73c00 INFO GST_STATES gstbin.c:2807:gst_bin_change_state_func:<pipeline0> child 'imxv4l2videosrc0' changed state to 3(PAUSED) successfully without preroll

 

 

 

Has anyone seen this?  I'm also open to a different solution to sync the audio and video that doesn't involve the queue.

Outcomes