aydinkn
Posts: 3
Joined: Thu Jun 23, 2016 8:10 am

Gstreamer Openmax Horizontal Distortion

Thu Jun 23, 2016 8:28 am

Hello guys,

I'm using Gstreamer 1.0 and gst-omx 1.2 with following pipeline:

Code: Select all

gst-launch-1.0 --gst-debug=3 -ev v4l2src device=/dev/video0 do-timestamp=true norm=PAL-B ! queue ! videoscale ! video/x-raw,width=1280,height=720 ! queue ! videoconvert ! omxh264enc control-rate=variable target-bitrate=2000000 periodicty-idr=50 interval-intraframes=50 ! h264parse config-interval=2 ! video/x-h264,level=\(string\)3.1,profile=main ! queue ! mux. \
alsasrc device=hw:0,0 do-timestamp=true provide-clock=false ! audio/x-raw ! queue ! voaacenc bitrate=96000 ! aacparse ! queue ! \
flvmux name=mux streamable=true ! queue ! filesink location=test.flv
Sometimes i see horizontal distortion like the preview image. Anybody can help about this problem?
Screen Shot 2016-06-23 at 11.18.01.jpg
Screen Shot 2016-06-23 at 11.18.01.jpg (56.18 KiB) Viewed 2914 times

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Gstreamer Openmax Horizontal Distortion

Thu Jun 23, 2016 9:25 am

What is your V4L2 source? The fact that you're requesting PAL-B implies a USB analogue TV tuner.
Have you made sure that these artifacts aren't present when just using the device via V4L2?
What is the native V4L2 resolution that you want to scale it to 1280x720? Can your V4L2 device not deliver that as a source resolution? videoscale will be quite an intensive operation that is running on the ARM.
PAL-B is also interlaced, so is this just an artifact of a sub-optimal deinterlacing algorithm?
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

aydinkn
Posts: 3
Joined: Thu Jun 23, 2016 8:10 am

Re: Gstreamer Openmax Horizontal Distortion

Thu Jun 23, 2016 2:19 pm

Thanks for your reply.
You are right, when i change v4l2src to videotestsrc (with pattern 0) this artifacts not happened. So, i guess this is not related with openmax, it is related with V4L2.
V4L2 source is a usb video capture card (EasyCAP). I test this device on windows OBS encoder with PAL-B norm and everything ok. On raspbian, v4l2-ctl tell me: this device has 720 x 576 native resolution. I remove videoscale and add avdeinterlace but problem still continue.
When i remove videoscale and change the caps filter with video/x-raw,width=720,height=576 then much more artifacts

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6513
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Gstreamer Openmax Horizontal Distortion

Thu Jun 23, 2016 3:33 pm

Results with USB video capture cards is very variable on Pi - a quick search on the forums generally will show those up and has some recommendations.
It looks like part of the USB transaction has been dropped or otherwise corrupted. Much too far down the USB stack for my knowledge.

Confirm with v4l2-ctl what your device is doing about interlacing - there are several options. v4l2-ctl -V should list the current "field" option, and you should be able to change it which may help. This was discussed recently under viewtopic.php?f=67&t=15080.

Also note that your device is likely to be producing YUYV which is not supported by omxh264enc, but I guess your videoconvert is dealing with that.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

aydinkn
Posts: 3
Joined: Thu Jun 23, 2016 8:10 am

Re: Gstreamer Openmax Horizontal Distortion

Fri Jun 24, 2016 8:29 am

v4l2-ctl show me, field is interlaced and only this supported.
I guess, i need an HDMI to CSI module for clean video recording / streaming.

Return to “OpenMAX”