AnsweredAssumed Answered

gstreamer: video fails to play when opened for second time

Question asked by Lachezar Nikolov on Feb 13, 2014
Latest reply on Apr 9, 2014 by Yixing Kong

Hello,

 

I am not very experienced with gstreamer but I am for sure experiencing some strange behavior on my i.MX6 board that I am not experiencing on a normal ubuntu machine. I have an application that does the following:

1. when started initializes the gstreamer framework, using gst_init_check() function.

2. When a command is sent to load a file, the following pipeline is constructed:

filesrc->aiurdemux->...(here the pipeline devides)

...->queue->beepdec->audioconvert->audioresample->volume->alsasink

...->queue->vpudec->ffmpegcolorspace->mfw_v4lsink

the audio and video branch are connected dynamically when aiurdemux emits the pad-added signal.

Also the stream is set first to paused state, then it is played for 2 frames (hack to make the first frame appear) and then it is paused again.

3. The stream is set in PLAYING state. Now everything works perfectly.

4. The stream is stopped by doing the following:

- The state is set to GST_STATE_NULL

- the pipeline is unref-ed (in my tests this unrefs all the elements in the pipeline).

 

Now when I try to do the same, I don't get video input. The messages from gstreamer say "hardware buffer : 0" (when it is working normally it says "hardware buffer : 9"). Everything begins working again when the application is restarted. Here are the messages from the gstreamer:

 

MFW_GST_V4LSINK_PLUGIN 3.0.5 build on Oct 22 2013 15:33:00.

set stretch:0.

vpudec versions

  plugin: 3.0.5

  wrapper: 1.0.28(VPUWRAPPER_ARM_LINUX Build on Oct 22 2013 15:28:56)

  vpulib: 5.4.10

  firmware: 2.1.8.34588

Aiur: 3.0.5

Core: MKVPARSER_01.04.01  build on Dec 10 2012 15:43:34

  mime: video/x-matroska ; video/webm

  file: /usr/lib/imx-mm/parser/lib_mkv_parser_arm11_elinux.so

Content Info:

  URI:

       file:///jci/mms/test_video

  Idx File:

       /root/.aiur/.jci.mms.test_video.aidx

  Seekable  : Yes

  Size(byte): 211312391

Movie Info:

  Seekable  : Yes

  Live      : No

  Duration  : 0:22:50.721000000

  ReadMode  : Track

  Track     : 5

 

 

Track 00 [video_000000] Enabled

  Duration: 0:22:50.721000000

  Language: und

  Mime:

       video/x-h264, parsed=(boolean)true, width=(int)720, height=(int)400, framerate=(

       fraction)29/1, codec_data=(buffer)00000001674d40339e2101686742000007d20001d4c11e

       3065400000000168ee3c80

Track 01 [audio_000000] Enabled

  Duration: 0:22:50.721000000

  Language: eng

  Mime:

       audio/mpeg, mpegversion=(int)1, framed=(boolean)true, channels=(int)2, rate=(int

       )48000, bitrate=(int)0

Track 02 [audio_000001] Enabled

  Duration: 0:22:50.721000000

  Language: jpn

  Mime:

       audio/mpeg, mpegversion=(int)1, framed=(boolean)true, channels=(int)2, rate=(int

       )48000, bitrate=(int)0

Track 03 [subtitle]: Disabled

  Codec: 0, SubCodec: 0

Track 04 [subtitle]: Disabled

  Codec: 0, SubCodec: 0

Beep: 3.0.5

Core: MP3 decoder Wrapper  build on Nov 29 2012 14:50:12

  mime: audio/mpeg, mpegversion = (int)1

  file: /usr/lib/imx-mm/audio-codec/wrap/lib_mp3d_wrap_arm12_elinux.so

CODEC: BLN_MAD-MMCODECS_MP3D_ARM_02.13.00_CORTEX-A8  build on Dec  5 2012 09:45:19.

>>V4L_SINK: Actually buffer status:

  hardware buffer : 9

  software buffer : 0

full screen size:800x480

[V4L Update Display]: left=0, top=20, width=800, height=440

Running time 0:00:00.064000000 render fps 31.250

full screen size:800x480

Running time 0:00:05.216000000 render fps 28.949

Total rendered:151

[--->FINALIZE aiurdemux

MFW_GST_V4LSINK_PLUGIN 3.0.5 build on Oct 22 2013 15:33:00.

set stretch:0.

vpudec versions

  plugin: 3.0.5

  wrapper: 1.0.28(VPUWRAPPER_ARM_LINUX Build on Oct 22 2013 15:28:56)

  vpulib: 5.4.10

  firmware: 2.1.8.34588

Aiur: 3.0.5

Core: MKVPARSER_01.04.01  build on Dec 10 2012 15:43:34

  mime: video/x-matroska ; video/webm

  file: /usr/lib/imx-mm/parser/lib_mkv_parser_arm11_elinux.so

Content Info:

  URI:

       file:///jci/mms/test_video

  Idx File:

       /root/.aiur/.jci.mms.test_video.aidx

  Seekable  : Yes

  Size(byte): 211312391

Movie Info:

  Seekable  : Yes

  Live      : No

  Duration  : 0:22:50.721000000

  ReadMode  : Track

  Track     : 5

Track 00 [video_000000] Enabled

  Duration: 0:22:50.721000000

  Language: und

  Mime:

       video/x-h264, parsed=(boolean)true, width=(int)720, height=(int)400, framerate=(

       fraction)29/1, codec_data=(buffer)00000001674d40339e2101686742000007d20001d4c11e

       3065400000000168ee3c80

Track 01 [audio_000000] Enabled

  Duration: 0:22:50.721000000

  Language: eng

  Mime:

       audio/mpeg, mpegversion=(int)1, framed=(boolean)true, channels=(int)2, rate=(int

       )48000, bitrate=(int)0

Track 02 [audio_000001] Enabled

  Duration: 0:22:50.721000000

  Language: jpn

  Mime:

       audio/mpeg, mpegversion=(int)1, framed=(boolean)true, channels=(int)2, rate=(int

       )48000, bitrate=(int)0

Track 03 [subtitle]: Disabled

  Codec: 0, SubCodec: 0

Track 04 [subtitle]: Disabled

  Codec: 0, SubCodec: 0

Beep: 3.0.5

Core: MP3 decoder Wrapper  build on Nov 29 2012 14:50:12

  mime: audio/mpeg, mpegversion = (int)1

  file: /usr/lib/imx-mm/audio-codec/wrap/lib_mp3d_wrap_arm12_elinux.so

CODEC: BLN_MAD-MMCODECS_MP3D_ARM_02.13.00_CORTEX-A8  build on Dec  5 2012 09:45:19.

>>V4L_SINK: Actually buffer status:

  hardware buffer : 0

  software buffer : 0

 

 

full screen size:800x480

[V4L Update Display]: left=0, top=20, width=800, height=440

Running time 0:00:01.024000000 render fps 0.000

Total rendered:0

[--->FINALIZE aiurdemux

Outcomes