We are working on MJPEG streaming and for that, we have used the below command to generate the 720p .jpg on iMX8mm:
Case 1) 5MP downscale to 720p using imxvideoconvert_g2d:
gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! 'video/x-raw, width=2592, height=1944, framerate=(fraction)2/1, format=(string)UYVY' ! imxvideoconvert_g2d ! 'video/x-raw, width=720, height=480, framerate=(fraction)2/1' ! queue ! jpegenc ! filesink location=test_videoscale.jpg
But on hexdump -C -n <size> test_videoscale.jpg > videoscale.txt (attached with mail)
Note: We have found that the jpeg header is ADOBE instead of JFIF.
Case 2) No downscaling without imxvideoconvert_g2d:
gst-launch-1.0 -v v4l2src device="/dev/video0" num-buffers=1 ! 'video/x-raw, width=(int)720, height=(int)480, format=(string)UYVY' ! jpegenc ! filesink location=/home/root/test_2lane.jpg
On hexdump -C -n <size> test_2lane.jpg > no_videoscale.txt (attached with mail) also can be found using https://www.onlinehexeditor.com/#
Note: We have found that jpeg header JFIF which is standard.
So for MJPEG streaming, we need a JFIF header which is standard for MJPEG streaming(live555) with Case 1 (downscaling)
Are there any imxvideoconvert_g2d properties that are changing the header of jpeg?
Please let us know if you need more information.