Hello,
I try to make my own PCIE gstreamer source.
My goal is to feed an mpeg2ts stream to gstreamer pipeline on my IMX8M som.(kernel 4.9.88)
In order to do that, i've created my own source based on GstBaseSrc.
On many stream i get no problem....but on others my pipeline doesn't want to work and it seems that MPEG2 parser is the problem.
This is the log of the failure :
root@cl-som-imx8:/home/sefram/debug# gst-launch-1.0 pciesrc do-timestamp=false blocksize=4096 ! queue ! tee ! typefind ! aiurdemux program-number=5901 name=d ! fakesink async=false
0:00:00.409990158 13052 0x7f72d0 LOG aiurdemux aiurdemux.c:478:gst_aiurdemux_init:<GstAiurDemux@0x8202e0> gst_aiurdemux_init
Setting pipeline to PAUSED ...
0:00:00.413664153 13052 0x7f72d0 LOG aiurdemux aiurdemux.c:519:gst_aiurdemux_change_state:<d> change_state transition=a
0:00:00.413973989 13052 0x7f72d0 DEBUG aiurdemux aiurdemux.c:508:gst_aiurdemux_change_state:<d> change_state READY_TO_PAUSED
0:00:00.414040469 13052 0x7f72d0 LOG aiurdemux aiurdemux.c:894:aiurdemux_sink_activate:<d:sink> activating push
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
0:00:00.416130963 13052 0x7f72d0 LOG aiurdemux aiurdemux.c:519:gst_aiurdemux_change_state:<d> change_state transition=1c
New clock: GstSystemClock
0:00:00.417412908 13052 0x8124a0 LOG aiurdemux aiurdemux.c:669:gst_aiurdemux_handle_sink_event:<d> gst_aiurdemux_handle_sink_event event=280e
0:00:00.434010267 13052 0x8124a0 DEBUG aiurdemux aiurdemux.c:1082:gst_aiurdemux_setcaps:<d> gst_aiurdemux_setcaps=video/mpegts, systemstream=(boolean)true, packetsize=(int)188
====== AIUR: 4.3.5 build on Jan 21 2019 17:47:10. ======
Core: BLN_MAD-MMLAYER_MPG2PARSER_04.05.16 build on Sep 14 2017 02:37:53
file: /usr/lib/imx-mm/parser/lib_mpg2_parser_arm_elinux.so.3.1
0:00:00.434538141 13052 0x8124a0 INFO aiurdemux aiurdemux.c:1094:gst_aiurdemux_setcaps:<d> Container: MPEG
0:00:00.434606900 13052 0x8124a0 DEBUG aiurdemux aiurdemux.c:596:gst_aiurdemux_handle_sink_event:<d> handling new segment from0
0:00:00.571159247 13052 0x812280 LOG aiurdemux aiurdemux.c:1197:aiurdemux_loop_state_init:<d> aiurdemux_loop_state_init SUCCESS
0:00:00.571239646 13052 0x812280 DEBUG aiurdemux aiurdemux.c:1518:aiurdemux_set_readmode:<d> read mode = track mode
0:00:00.571300125 13052 0x812280 LOG aiurdemux aiurdemux.c:1979:aiurdemux_parse_streams:<d> aiurdemux_parse_streams ret=0
0:00:00.571578522 13052 0x812280 LOG aiurdemux aiurdemux.c:1308:aiurdemux_loop_state_header:<d> aiurdemux_loop_state_header SUCCESS
0:00:00.571616321 13052 0x812280 LOG aiurdemux aiurdemux.c:1313:aiurdemux_loop_state_header:<d> aiurdemux_loop_state_header FAILED
0:00:00.571648601 13052 0x812280 LOG aiurdemux aiurdemux.c:1061:aiurdemux_push_task:<d> pausing task, reason error
0:00:00.571694320 13052 0x812280 WARN aiurdemux aiurdemux.c:1068:aiurdemux_push_task:<d> error: streaming stopped, reason error, state 2
WARNING: from element /GstPipeline:pipeline0/GstAiurDemux:d: Delayed linking failed.
Additional debug info:
../../../git/gst/parse/grammar.y(510): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstAiurDemux:d:
failed delayed linking some pad of GstAiurDemux named d to some pad of GstFakeSink named fakesink0
ERROR: from element /GstPipeline:pipeline0/GstAiurDemux:d: GStreamer encountered a general stream error.
Additional debug info:
../../../git/plugins/aiurdemux/aiurdemux.c(1068): aiurdemux_push_task (): /GstPipeline:pipeline0/GstAiurDemux:d:
streaming stopped, reason error, state 2
Execution ended after 0:00:00.155683236
Setting pipeline to PAUSED ...
0:00:00.572143715 13052 0x7f72d0 LOG aiurdemux aiurdemux.c:519:gst_aiurdemux_change_state:<d> change_state transition=23
Setting pipeline to READY ...
0:00:00.572622629 13052 0x7f72d0 LOG aiurdemux aiurdemux.c:519:gst_aiurdemux_change_state:<d> change_state transition=1a
0:00:01.571911494 13052 0x7f72d0 DEBUG aiurdemux aiurdemux.c:528:gst_aiurdemux_change_state:<d> change_state PAUSED_TO_READY
Setting pipeline to NULL ...
0:00:01.573297478 13052 0x7f72d0 LOG aiurdemux aiurdemux.c:519:gst_aiurdemux_change_state:<d> change_state transition=11
Freeing pipeline ...
0:00:01.573816591 13052 0x7f72d0 LOG aiurdemux aiurdemux.c:486:gst_aiurdemux_finalize:<d> gst_aiurdemux_finalize
I've recorder this stream . On this stream only program 5902 is working. Others programs gives errors.
I just add that reading this file with "filesrc" gives no error (it just do many seek before decoding):
root@cl-som-imx8:/home/sefram/debug# gst-launch-1.0 filesrc location=/home/sefram/TS/essai.ts ! queue ! tee ! typefind ! aiurdemux program-number=5901 name=d ! fakesink
0:00:00.083554268 13082 0x66e460 LOG aiurdemux aiurdemux.c:478:gst_aiurdemux_init:<GstAiurDemux@0x670270> gst_aiurdemux_init
Setting pipeline to PAUSED ...
0:00:00.086178037 13082 0x66e460 LOG aiurdemux aiurdemux.c:519:gst_aiurdemux_change_state:<d> change_state transition=a
0:00:00.086412994 13082 0x66e460 DEBUG aiurdemux aiurdemux.c:508:gst_aiurdemux_change_state:<d> change_state READY_TO_PAUSED
0:00:00.086458473 13082 0x66e460 LOG aiurdemux aiurdemux.c:894:aiurdemux_sink_activate:<d:sink> activating push
Pipeline is PREROLLING ...
0:00:00.093662346 13082 0x654cf0 LOG aiurdemux aiurdemux.c:669:gst_aiurdemux_handle_sink_event:<d> gst_aiurdemux_handle_sink_event event=280e
0:00:00.108879842 13082 0x654cf0 DEBUG aiurdemux aiurdemux.c:1082:gst_aiurdemux_setcaps:<d> gst_aiurdemux_setcaps=video/mpegts, systemstream=(boolean)true, packetsize=(int)188
====== AIUR: 4.3.5 build on Jan 21 2019 17:47:10. ======
Core: BLN_MAD-MMLAYER_MPG2PARSER_04.05.16 build on Sep 14 2017 02:37:53
file: /usr/lib/imx-mm/parser/lib_mpg2_parser_arm_elinux.so.3.1
0:00:00.109289877 13082 0x654cf0 INFO aiurdemux aiurdemux.c:1094:gst_aiurdemux_setcaps:<d> Container: MPEG
0:00:00.109348556 13082 0x654cf0 DEBUG aiurdemux aiurdemux.c:608:gst_aiurdemux_handle_sink_event:<d> Pushing newseg rate 1, format 3, start 0:00:00.000000000, stop 99:99:99.999999999
0:00:00.109487395 13082 0x654a30 DEBUG aiurdemux aiurcontent.c:576:aiurcontent_query_content_info: can not mkdir /home/root/.aiur
0:00:00.132204560 13082 0x654a30 DEBUG aiurdemux aiurcontent.c:351:aiurcontent_callback_seek_push: seek to 0
0:00:00.132278479 13082 0x654a30 DEBUG aiurdemux aiurstreamcache.c:340:gst_aiur_stream_cache_seek: Flush cache, backward seek addr 0, cachestart 2814646, offset 200010
0:00:00.132311118 13082 0x654a30 INFO aiurdemux aiurstreamcache.c:365:gst_aiur_stream_cache_seek: stream cache try seek to 0
0:00:01.133119765 13082 0x654cf0 DEBUG aiurdemux aiurdemux.c:608:gst_aiurdemux_handle_sink_event:<d> Pushing newseg rate 1, format 3, start 0:00:00.000000000, stop 99:99:99.999999999
0:00:01.179763321 13082 0x654a30 DEBUG aiurdemux aiurcontent.c:351:aiurcontent_callback_seek_push: seek to 0
0:00:01.179851879 13082 0x654a30 DEBUG aiurdemux aiurstreamcache.c:340:gst_aiur_stream_cache_seek: Flush cache, backward seek addr 0, cachestart 3666614, offset 200010
0:00:01.179895199 13082 0x654a30 INFO aiurdemux aiurstreamcache.c:365:gst_aiur_stream_cache_seek: stream cache try seek to 0
0:00:02.180303771 13082 0x654cf0 DEBUG aiurdemux aiurdemux.c:608:gst_aiurdemux_handle_sink_event:<d> Pushing newseg rate 1, format 3, start 0:00:00.000000000, stop 99:99:99.999999999
0:00:02.182863220 13082 0x654a30 DEBUG aiurdemux aiurcontent.c:351:aiurcontent_callback_seek_push: seek to 130314240
0:00:02.182958379 13082 0x654a30 INFO aiurdemux aiurstreamcache.c:365:gst_aiur_stream_cache_seek: stream cache try seek to 130314240
0:00:02.183825128 13082 0x654cf0 DEBUG aiurdemux aiurdemux.c:608:gst_aiurdemux_handle_sink_event:<d> Pushing newseg rate 1, format 3, start 0:00:00.130314240, stop 99:99:99.999999999
0:00:02.185594987 13082 0x654a30 DEBUG aiurdemux aiurcontent.c:351:aiurcontent_callback_seek_push: seek to 130052096
0:00:02.185642026 13082 0x654a30 DEBUG aiurdemux aiurstreamcache.c:340:gst_aiur_stream_cache_seek: Flush cache, backward seek addr 130052096, cachestart 130314240, offset 131072
0:00:02.185683666 13082 0x654a30 INFO aiurdemux aiurstreamcache.c:365:gst_aiur_stream_cache_seek: stream cache try seek to 130052096
0:00:02.186139900 13082 0x654cf0 DEBUG aiurdemux aiurdemux.c:608:gst_aiurdemux_handle_sink_event:<d> Pushing newseg rate 1, format 3, start 0:00:00.130052096, stop 99:99:99.999999999
0:00:02.192078748 13082 0x654a30 DEBUG aiurdemux aiurcontent.c:351:aiurcontent_callback_seek_push: seek to 0
0:00:02.192145227 13082 0x654a30 DEBUG aiurdemux aiurstreamcache.c:340:gst_aiur_stream_cache_seek: Flush cache, backward seek addr 0, cachestart
I hope somebody could help me because i don't really understand the problem.
I can use transweb if needed to send the file.
BR
Frédéric
Hello,
I just add that i believe that the problem come from lib_mpg2_parser :
====== AIUR: 4.3.5 build on Feb 21 2019 14:18:30. ======
Core: BLN_MAD-MMLAYER_MPG2PARSER_04.05.16 build on Sep 14 2017 02:37:53
file: /usr/lib/imx-mm/parser/lib_mpg2_parser_arm_elinux.so.3.1
0:00:00.296950467 6689 0x6a2190 INFO aiurdemux aiurdemux.c:1094:gst_aiurdemux_setcaps:<d> Container: MPEG
0:00:00.297012854 6689 0x6a2190 DEBUG aiurdemux aiurdemux.c:596:gst_aiurdemux_handle_sink_event:<d> handling new segment from0
0:00:00.456419971 6689 0x65ced0 INFO aiurdemux aiurdemux.c:1276:aiurdemux_loop_state_header: Movie duration [ 0].
0:00:00.456514152 6689 0x65ced0 DEBUG aiurdemux aiurdemux.c:1527:aiurdemux_set_readmode:<d> read mode = track mode
0:00:00.456544746 6689 0x65ced0 INFO aiurdemux aiurdemux.c:1283:aiurdemux_loop_state_header: IParser->getNumTracks: parser_result[ 0].
0:00:00.456577019 6689 0x65ced0 INFO aiurdemux aiurdemux.c:1292:aiurdemux_loop_state_header: IParser->getNumPrograms: [ 1].
which just find 1 program whereas there is 6 programs.
Using tsdemux instead of aiurdemux, it seems working....
Is it possible that there is a bug in aiurdemux or lib_mpg2_paser ??
Hello,
Just to say that I am reviewing this. Unfortunately, the only way that we could help you is with the gstreamer sources that are on our BSP.
Best regards,
Diego.
Hello,
You can try with the below gstreamer pipeline with tour respective file. That worked for me.
# gst-launch-1.0 filesrc location=POINTSETTA_4K_x264.m2ts ! video/mpegts ! tsdemux ! queue ! vpudec ! queue ! kmssink
Regarding the aiurdemux, let me see that internally. I am also having problems with this.
Hope this can help you.
Best regards,
Diego.
Hello Diego,
Where i can download the file POINTSETTA_4K_x264.m2ts ?
Regarding aiurdemux or mpeg2 parser, i have always problems...
Hello,
I apologize, that was a video that I encoded into m2ts format. I used the "any video converter" program.
By the way, I am still waiting for an internal answer.
Best regards,
Diego.
Ok keep me in touch please if you've an answer...
BR
Frédéric
Hello
The problem is solved, please find the solution below:
Gplay is reading successfully my m2ts video example. With the following option, I can save the pipeline to .dot format and investigate the pipeline.
export
GST_DEBUG_DUMP_DOT_DIR=/path
I extracted the pipeline used by gplay-1.0 for running the m2ts video.
In the gplay-1.0 pipeline, aiurdemux is used while reading the video correctly.
I noticed a difference in the caps property: "systemstream=true"
Using the following command, I have been able to play the video with aiurdemux
gst-launch-1.0 filesrc location=POINTSETTA_4K_x264.m2ts ! "video/mpegts,systemstream=true" ! aiurdemux name=demux demux. ! queue ! vpudec ! queue ! waylandsink
When using TSdemux, it looks like this property is the only possible to set:
However, this solution only worked with the L4.14.78 Linux distribution. I suggest you change to that BSP.
Best regards,
Diego.
Hello,
Thanks for your answer.
I'll try myself and give you news asap.
BR
Frédéric