Freescale / gstreamer-imx

GStreamer 1.0 plugins for i.MX platforms
Other
182 stars 127 forks source link

Pipeline does not go into PREROLLING. #292

Closed jugurthab closed 3 years ago

jugurthab commented 3 years ago

Hi,

I have the following gst-launch command which works well :

gst-launch-1.0 filesrc location=test.mkv ! decodebin ! imxvideoconvert_ipu ! tee name=tee-test-raw \ tee-test-raw. ! queue max-size-buffers=2 leaky=downstream silent=false ! imxv4l2sink name=imxv4l2sink-rear device=/dev/OUT

and produces the following output (video file shown on the screen) :

Setting pipeline to PAUSED ... display(/dev/fb0) resolution is (800x480). Pipeline is PREROLLING ... Core: MKVPARSER_01.08.08 build on Oct 13 2020 05:39:32 file: /usr/lib/imx-mm/parser/lib_mkv_parser_arm11_elinux.so.3.1

Track 00 [video_0] Enabled Duration: 0:00:22.197000000 Language: und Mime: video/x-h264, parsed=(boolean)true, alignment=(string)au, stream-format=(string)avc, width=(int)1024, height=(int)864, framerate=(fraction)25/1, codec_data=>(buffer)014d4028ffe1001c674d4028eca020036d80b501010140000003004000afc803c60c658001000568eae132c8

[INFO] Product Info: i.MX6Q/D/S [INFO] Product Info: i.MX6Q/D/S ====== VPUDEC: 4.5.7 build on May 31 2021 12:05:47. ====== wrapper: 3.0.0 (VPUWRAPPER_ARM_LINUX Build on May 31 2021 10:24:29) vpulib: 5.4.39 firmware: 3.1.1.46076 [INFO] bitstreamMode 1, chromaInterleave 1, mapType 0, tiled2LinearEnable 0 Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock v4l2sink need allocate 3 buffers. Pipeline is PREROLLING ...Got EOS from element "pipeline0". Execution ended after 0:00:22.211666669 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Total showed frames (6), playing for (0:00:22.214250336), fps (0.270). Freeing pipeline ...

However, when I implement the same setting in python, the pipline never go to prerolling. The python code is shown below : ` class Capture(Gst.Pipeline): def init(self, camera_settings): Gst.Pipeline.init(self, name=camera_name) self.sourceVideoCapsFilter = None self.camera_name = camera_name self.src = Gst.ElementFactory.make('filesrc') self.src.set_property('location', 'test.mkv') self.sourceVideoCapsFilter = Gst.ElementFactory.make('decodebin') self.src_convert = Gst.ElementFactory.make('imxvideoconvert_ipu') self.tee = Gst.ElementFactory.make("tee") self.tee.set_property("allow-not-linked", True) self.queue = Gst.ElementFactory.make("queue") self.queue.set_property("max-size-buffers", 2) self.queue.set_property("leaky", "downstream") self.queue.set_property("silent", False) self.video_preview_sink = Gst.ElementFactory.make("imxv4l2sink") self.video_preview_sink.set_property("device", "/dev/OUT")
self.add(self.src) self.add(self.sourceVideoCapsFilter) self.add(self.src_convert) self.add(self.tee) self.add(self.queue) self.add(self.video_preview_sink) self.src.link(self.sourceVideoCapsFilter) self.sourceVideoCapsFilter.link(self.src_convert) self.src_convert.link(self.tee) self.tee.link(self.queue) self.queue.link(self.video_preview_sink)

GObject.type_register(Capture) gstelementfactory = (("capture", Gst.Rank.NONE, Capture),("videopreview", Gst.Rank.NONE, VideoPreview))

pipeline = Gst.Pipeline.new()
camera_test = Capture("test_cam") pipeline.add(camera_test) pipeline.set_state(Gst.State.PLAYING)

bus = pipeline.get_bus()

g_loop = GLib.MainLoop() g_loop.run() `

which produces only the following output (and the video is never read):

  Core: MKVPARSER_01.08.08  build on Oct 13 2020 05:39:32

file: /usr/lib/imx-mm/parser/lib_mkv_parser_arm11_elinux.so.3.1 Track 00 [video_0] Enabled Duration: 0:00:22.197000000 Language: und Mime: video/x-h264, parsed=(boolean)true, alignment=(string)au, stream-format=(string)avc, width=(int)1024, height=(int)864, framerate=(fraction)25/1, codec_data=>(buffer)014d4028ffe1001c674d4028eca020036d80b501010140000003004000afc803c60c658001000568eae132c8

[INFO] Product Info: i.MX6Q/D/S [INFO] Product Info: i.MX6Q/D/S ====== VPUDEC: 4.5.7 build on May 31 2021 12:05:47. ====== wrapper: 3.0.0 (VPUWRAPPER_ARM_LINUX Build on May 31 2021 10:24:29) vpulib: 5.4.39 firmware: 3.1.1.46076 [INFO] bitstreamMode 1, chromaInterleave 1, mapType 0, tiled2LinearEnable

Any help will be appreciated.

Thanks

dv1 commented 3 years ago

gst-launch-1.0 filesrc location=test.mkv ! decodebin ! imxvideoconvert_ipu ! tee name=tee-test-raw tee-test-raw. ! queue max-size-buffers=2 leaky=downstream silent=false ! imxv4l2sink name=imxv4l2sink-rear device=/dev/OUT

You are using the NXP imx-gst1.0-plugin package. This project here is gstreamer-imx - an entirely different set of plugins. I cannot support the NXP package, since it is not my code. Please ask in the NXP forums about this.

Or, you can try if gstreamer-imx works for you. The equivalents would be: imxvideoconvert_ipu -> imxipuvideotransform ; imxv4l2sink -> imxv4l2videosink . But please note that having both imx-gst1.0-plugin and gstreamer-imx installed on the same platform is not guaranteed to work well.

dv1 commented 3 years ago

Closing this for now since this involves other plugins (not gstreamer-imx). Reopen if this issue persists when using gstreamer-imx instead of imx-gst1.0-plugin .