Gapless play on imx6q

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Gapless play on imx6q

1,081 Views
onurcalili
Contributor I

Hello community,

I have Karo-tx6q-1010 Module. I managed to save a sample video encoded with h264 algorithm using

gst-launch-1.0 -vvv videotestsrc pattern=1 ! video/x-raw,format="I420", framerate=25/1, width=720, height=576 ! timeoverlay text="Stream time:" shaded-background=false ! imxvpuenc_h264 bitrate=32500 gop_size=0 ! avimux name=avimuxer ! filesink location=/home/root/test.avi

.The sample video can be played without problem using;

gst-play-1.0 test.avi

It only gives me a warning which is "g2d_alloc: alloc memory fail with size 16!". But when i use

gst-play-1.0 --videosink imxipuvideosink test.avi

the warning is gone and gain video played without any problem.

My problem is, when i use

gst-play-1.0 --videosink imxipuvideosink --gapless test.avi test.avi

which uses "about-to-finish" signal of "playbin", the two video is played consequently and in expected duration but between video transitions i think playing stops approximately 300 ms because screen hangs for a visible duration and the start time of "timeoverlay" is nearly 0:00:00:300 as far as i can see. When i tried the same command on my pc using the same command video transition is very smooth.

I have to play my consequent videos gaplessly. How can i overcome this problem?

Best regards

Onur

Labels (4)
0 Kudos
2 Replies

778 Views
onurcalili
Contributor I

Thank you for your response Victor.

I tried the code in the given link. But my problem continues. Actually the  playback is gapless in both "gst-play-1.0" and "test-loop" but in my case video hangs for some duration. In my condition I use 

gst-launch-1.0 videotestsrc pattern=0 num-buffers=250 ! 'video/x-raw,format=(string)I420,width=720,height=576,framerate=(fraction)25/1' ! timeoverlay text="Stream time:" shaded-background=true ! imxvpuenc_h264 bitrate=32500 gop_size=0 ! queue ! mux. audiotestsrc num-buffers=440 ! audioconvert ! 'audio/x-raw,rate=44100,channels=2' ! queue ! mux. avimux name=mux ! filesink location=/home/root/test.avi

to record 10 seconds of video and audio. If I play video for one time time overlay shows "0:00:09:960" in last frame but when I try gapless playback audio plays with no hang but video hangs in time "0:00:08:880" or "0:00:08:920" then it starts at "0:00:00:000". Video playing hangs for more then one second in replay transitions at the signal "about-to-finish". I attached the media file that I created.

In addition if i record the video without audio the hang duration reduces nearly to 300 ms and they are not in the end of the video but in the beginning of the video.

Best regards,

Onur

0 Kudos

778 Views
b36401
NXP Employee
NXP Employee

You can use gapless playback instead of seek back operation since there may be timing issue in the seek operation.
Please take the following sample code for reference how to implement the gapless playback even for a single media file:

https://github.com/w-flo/gstreamer-gapless-test/blob/master/test-loop.c

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos