i.MX6Q poor quality MJPEG decoding

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX6Q poor quality MJPEG decoding

跳至解决方案
4,664 次查看
timothybean
Contributor IV

Hello,

I am decoding video from an IP camera. H.264 video looks good, but, for some reason when I pull the MJPEG stream the quality is very bad. When I view the MJPEG stream on the computer in VLC and such, the video looks great. I have tried with jpegdec and vpudec. Both provide the same poor quality on the screen.

Thanks

Tim

标签 (3)
1 解答
3,634 次查看
timothybean
Contributor IV

I found the issue was in the rtpjpegdepay element. Update is here if anyone else needs it:

http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=e9040e90a59c4f540a03e10566e8c227a8...

在原帖中查看解决方案

5 回复数
3,634 次查看
LeonardoSandova
Specialist I

Please post the pipeline you are using.

Leo

0 项奖励
回复
3,634 次查看
timothybean
Contributor IV

Sorry for the late reply

gst-launch rtspsrc=rtsp://IP/mjpg latency=300 ! rtpjpegdepay ! vpudec low-latency=true ! mfw_v4lsink sync=true device/dev/video17

I have also tried:

gst-launch rtspsrc=rtsp://IP/mjpg latency=300 ! rtpjpegdepay ! jpegdec ! mfw_v4lsink sync=true device/dev/video17\

and get the exact same results.

Below is an image of my screen. You can see there IS video but it is very badly pixelated.

IMG_20130530_144627_278.jpg

Thanks

Tim

0 项奖励
回复
3,634 次查看
LeonardoSandova
Specialist I

Not sure if it works, but try this pipeline:

gst-launch playbin2 uri=rtsp://IP/mjpg

Some questions:

what is the resolution for the stream data?

what is the resolution on the vpudec's sink caps (add -v to your pipeline to check this)?

what are the values you are providing to VLC when the playback is done on your PC?

Could you try streaming other codec data (like h264)?

Take a look at this page, GStreamer Streaming it uses other elements (gstrtpbin) but you may use it in your project.


Leo

0 项奖励
回复
3,634 次查看
timothybean
Contributor IV

playbin2 pipeline is same results

video is 720x480

Yes, H.264 works, but only if I set the disp-height to 8 minus the resolution

here is with -v option:

[INFO]  Product Info: i.MX6Q/D/S

vpudec versions :smileyhappy:

        plugin: 3.0.5

        wrapper: 1.0.28(VPUWRAPPER_ARM_LINUX Build on May  3 2013 09:30:59)

        vpulib: 5.4.10

        firmware: 2.1.8.34588

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0: latency = 200

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0: buffer-mode = slave (1)

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1: timeout = 5000000

Pipeline is live and does not need PREROLL ...

Setting pipeline to PLAYING ...

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0.GstGhostPad:send_rtcp_src_0: caps = application/x-rtcp

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0/GstRtpSession:rtpsession0.GstPad:send_rtcp_src: caps = application/x-rtcp

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSink:udpsink1.GstPad:sink: caps = application/x-rtcp

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0.GstGhostPad:send_rtcp_src_0.GstProxyPad:proxypad2: caps = application/x-rtcp

New clock: GstSystemClock

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstUDPSrc:udpsrc1: timeout = 0

/GstPipeline:pipeline0/GstRtpJPEGDepay:rtpjpegdepay0.GstPad:sink: caps = application/x-rtp, media=(string)video, payload=(int)26, clock-rate=(int)90000, encoding-name=(

string)JPEG, packetization-mode=(string)1, a-cliprect=(string)\"0\\,0\\,480\\,720\", a-framesize=(string)\"96\\ 720-480\", npt-start=(guint64)0, play-speed=(double)1, p

lay-scale=(double)1

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0.GstGhostPad:recv_rtp_src_0_769379304_26: caps = application/x-rtp, media=(string)video, payload=(int)26, clock-rate=(int)9000

0, encoding-name=(string)JPEG, packetization-mode=(string)1, a-cliprect=(string)\"0\\,0\\,480\\,720\", a-framesize=(string)\"96\\ 720-480\", npt-start=(guint64)0, play-

speed=(double)1, play-scale=(double)1

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0.GstGhostPad:recv_rtp_src_0_769379304_26.GstProxyPad:proxypad4: caps = application/x-rtp, media=(string)video, payload=(int)26

, clock-rate=(int)90000, encoding-name=(string)JPEG, packetization-mode=(string)1, a-cliprect=(string)\"0\\,0\\,480\\,720\", a-framesize=(string)\"96\\ 720-480\", npt-s

tart=(guint64)0, play-speed=(double)1, play-scale=(double)1

/GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0/GstRtpBin:rtpbin0.GstGhostPad:recv_rtp_src_0_769379304_26.GstProxyPad:proxypad3: caps = application/x-rtp, media=(string)vide

o, payload=(int)26, clock-rate=(int)90000, encoding-name=(string)JPEG, packetization-mode=(string)1, a-cliprect=(string)\"0\\,0\\,480\\,720\", a-framesize=(string)\"96\

\ 720-480\", npt-start=(guint64)0, play-speed=(double)1, play-scale=(double)1

/GstPipeline:pipeline0/GstRtpJPEGDepay:rtpjpegdepay0.GstPad:src: caps = image/jpeg, framerate=(fraction)0/1, width=(int)720, height=(int)480

[INFO]  bitstreamMode 1, chromaInterleave 0, mapType 0, tiled2LinearEnable 0

/GstPipeline:pipeline0/GstVpuDec:vpudec0.GstPad:sink: caps = image/jpeg, framerate=(fraction)0/1, width=(int)720, height=(int)480

/GstPipeline:pipeline0/GstVpuDec:vpudec0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)720, height=(int)480, pixel-aspect-ratio=(fraction)1/1, cro

p-top=(int)0, crop-left=(int)0, crop-right=(int)0, crop-bottom=(int)0, num-buffers-required=(int)7, framerate=(fraction)30/1, alignment=(int)1

>>V4L_SINK: Actually buffer status:

        hardware buffer : 7

        software buffer : 0

/GstPipeline:pipeline0/MFW_GST_V4LSINK_INFO_T:mfw_gst_v4lsink_info_t0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)720, height=(int)480, pixel-a

spect-ratio=(fraction)1/1, crop-top=(int)0, crop-left=(int)0, crop-right=(int)0, crop-bottom=(int)0, num-buffers-required=(int)7, framerate=(fraction)30/1, alignment=(i

nt)1

full screen size:1280x720



0 项奖励
回复
3,635 次查看
timothybean
Contributor IV

I found the issue was in the rtpjpegdepay element. Update is here if anyone else needs it:

http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=e9040e90a59c4f540a03e10566e8c227a8...