Incorrect MJPEG stream

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Incorrect MJPEG stream

3,914 Views
BrilliantovKiri
Senior Contributor I

Hello!

I work with iMX53 Quick Start Board.

Server pipeline: gst-launch -v -v4l2src device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 !  mfw_ipucsc ! mfw_vpuencoder width=320 height=240 codec-type=std_mjpg ! rtpjpegpay ! udpsink host=192.168.255.1 auto-multicast=true port=5000 sync=false

Client pipeline: gst-launch -vvv  udpsrc port=5000 ! 'application/x-rtp, media=video, payload=96, clock-rate=90000, encoding-name=JPEG' ! rtpjpegdepay ! ffdec_mjpeg ! xvimagesink

I see next stream.jpg

As you can see image incorrect, but if I change mfw_vpuencoder on jpegenc I get correct image.

I try encode jpeg and save it to file:

gst-launch -v v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw-yuv,width=640,height=480 ! mfw_ipucsc ! mfw_vpuencoder width=640 height=480 codec-type=std_mjpg ! filesink location=q.jpg

And I get correct image q.jpg

How can I configure mfw_vpuencoder or rtpjpegpay for get correct MJPEG stream?

Thank you and excuse me my bad english.

Labels (1)
Tags (2)
0 Kudos
12 Replies

1,096 Views
BrilliantovKiri
Senior Contributor I

Problem solving with gst-plugins-good-0.10.31

One moment - I see correct image only via VLC 1.1.3 and GStreamer 0.10.30, my host system Debian GNU/Linux 6.0.7.

0 Kudos

1,096 Views
BrilliantovKiri
Senior Contributor I

FreeScale answer:

The following is the reply from CnM (regarding the restart markers in JPEG):

"stuffing bits value is fixed in jpeg rtl HW. It means Rita [i.MX53 - Yuri] has no way

to have 1's for stuffing value. For the time being, we were eagerly looking for any

workaround in fw side. But we found that there was no path in order to control the

value of stuff. Sorry for this unpleasant news."

So, VPU designers are aware of the issue but they don't have a solution. The app will

need ignore this stuffing or disable restart marker encoding.


0 Kudos

1,096 Views
weideding
Contributor II

hi, i am also facing this problem:

i am using vpu mjpeg encoder features on mx51 linux, but the format of .jpg file generated from vpu is not correct, so that rtp cannot use mjpeg:

gst-launch -e videotestsrc ! mfw_vpuencoder codec-type=7 ! multifilesink location=save_%d.jpeg


  use jpegsnoop.exe to check save_x.jpg, there are lots of errors, can any people help me? thanks.snoop_show_errors.JPG

0 Kudos

1,096 Views
BrilliantovKiri
Senior Contributor I

Hello, Yuri!

This is not solve problem because you change output stream on H264.

0 Kudos

1,096 Views
Yuri
NXP Employee
NXP Employee

As some kind of workaround (insert additional encode / decode elements) :

 

gst-launch v4l2src ! mfw_ipucsc ! mfw_vpuencoder codec-type=std_mjpg ! mfw_vpudecoder  ! mfw_vpuencoder ! rtph264pay ! udpsink host=192.168.2.113 auto-multicast=true port=5000 sync=false

0 Kudos

1,097 Views
Bhavana
Contributor II

can anyone please help me out in live streaming ..By using the gstreamer (or) ffserver.

0 Kudos

1,097 Views
Bhavana
Contributor II

I am also facing same problem.

Host linux pc:

gst-launch v4l2src ! 'video/x-raw-yuv, format=(fourcc)YUY2, width=640, height=480, framerate=(fraction)25/1' ! ffmpegcolorspace ! ximagesink

This command is working.

I am still facing streaming problem(Incorrect image on host linux pc).

Can any one help me.

-Thank you

0 Kudos

1,097 Views
Bhavana
Contributor II

Can anyone help me to resolve the issue i.e., am able to stream the video with incorrect image on the client side.

I followed the above

Server pipeline: gst-launch -v -v4l2src device=/dev/video0 ! video/x-raw-yuv,width=320,height=240 !  mfw_ipucsc ! mfw_vpuencoder width=320 height=240 codec-type=std_mjpg ! rtpjpegpay ! udpsink host=192.168.255.1 auto-multicast=true port=5000 sync=false

client pipeline:gst-launch -vvv  udpsrc port=5000 ! 'application/x-rtp, media=video, payload=96, clock-rate=90000, encoding-name=JPEG' ! rtpjpegdepay ! ffdec_mjpeg ! xvimagesink

Are there any properties to be changed or anything else...

Please help me out..

Thanks,

Prannoy

0 Kudos

1,097 Views
BrilliantovKiri
Senior Contributor I

$ gst-launch v4l2src ! 'video/x-raw-yuv, format=(fourcc)YUY2, width=640, height=480, framerate=(fraction)25/1' ! ffmpegcolorspace ! ximagesink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
Additional debug info:
gstbasesrc.c(2755): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...
Freeing pipeline ...

Without framerate I get correct image.

0 Kudos

1,097 Views
Yuri
NXP Employee
NXP Employee

Check if the camera works in host Linux:

gst-launch v4l2src ! 'video/x-raw-yuv, format=(fourcc)YUY2, width=640, height=480, framerate=(fraction)25/1' !
ffmpegcolorspace ! ximagesink



0 Kudos

1,097 Views
BrilliantovKiri
Senior Contributor I

If mfw_vpuencoder intended for raw image how I get correct image in file?

Yuri Muhin said:

Looks like USB cam provides jpeg data, whereas  "mfw-" codecs are intended for raw image.  

0 Kudos

1,097 Views
Yuri
NXP Employee
NXP Employee

Looks like USB cam provides jpeg data, whereas  "mfw-" codecs are intended for raw image.  

0 Kudos