Recently I've been working on decoding a video using MJPEG. The problem I encountered is that some of the buffers (JPEG images) were syntactically correct, meaning that the header and EOI code were correct, but the decoder wasn't able to decode it. This happened randomly, without a specific pattern or order. Looking around on the internet I found this:http://linux.omap.com/pipermail/davinci-linux-open-source/2010-December/021286.htmlWe implemented that solution on Diego Dompe's plugins branch for the DM365 and can confirm this behavior, we also noticed that adding less than 1024 bytes to the buffer wouldn't work as well.
Is there an explanation for this? If so, is there a "cleaner" way to solve this issue? I can provide example images for both cases.
Are the images encoded with the DM365 JPEG Encoder only?
It would be great if you could send some samples across so that we can examine them and try to establish the cause of the problem.
I will also need the version number of the JPEG Decoder & Encoder and the parameters for the JPEG Encoder (if using DM365 based one).
Can you also detail the steps you've taken so far?
I'm attaching some sample images that were encoded using the DM365 JPEG codec, files 0 and 3 can be decoded while 1 and 2 can't.
The encoder/decoder version used is the one in DVSDK 4.02, according to the codec release notes both the decoder and the encoder version is 01.00.00 and the parameters used are the default ones.
Now the steps:1. Recorded a video usinggst-launch -e videotestsrc ! 'video/x-raw-yuv,format=(fourcc)UYVY,width=720,height=480,pitch=736' ! dmaienc_mjpeg qValue=30 ! queue ! qtmux ! filesink location=test_mjpeg.mp4
2. Tried to decode using gst-launch filesrc location = test_mjpeg.mp4 ! qtdemux name=demux .video_00 ! queue ! dmaidec_mjpeg ! 'video/x-raw-yuv, format=(fourcc)NV12' ! fakesink
3. Adding DMAI_DEBUG=2 to the previous pipeline got this error messages:
@0x000f4f82:[T:0x41b28490] ti.sdo.dmai - [Idec1] IMGDEC1_process() failed with error (-1 ext: 0x8800)
@0x000f87a4:[T:0x41b28490] ti.sdo.dmai - [Idec1] IMGDEC1_process() failed with error (-1 ext: 0xc000)
4. Separated the video in different images (buffers) using:
gst-launch filesrc location = test_mjpeg.mp4 ! qtdemux name=demux .video_00 ! queue ! multifilesink location=test_%d.jpeg
5. Tried to decode the images individually using:
DMAI_DEBUG=2 gst-launch filesrc location = test_X.jpeg ! dmaidec_jpeg ! fakesink
@0x00068c70:[T:0x4125a490] ti.sdo.dmai - [Idec1] IMGDEC1_process() failed with error (-1 ext: 0x8800)
Apologies for the delay.
I checked your files with version 1.00.00.10 of the JPEG Decoder and they are decoding fine.
Were you using a large input buffer as inidicated on the link above? (http://linux.omap.com/pipermail/davinci-linux-open-source/2010-December/021286.html).Thanks,
I tried with both cases - with a much larger input buffer and with an input buffer which is the exact size of the codec requirement.
I am also working on JPEG decoder and I am also getting a similar error.
I am using dvsdk_4_02_00_06 and linux 188.8.131.52.
I am getting an extended error as "err: 0x8800" (XDM_FATALERROR) according to user guide.
Can anyone please tell me the reason for this error and how to avoid this error??
Thanks a lot
Dis you follow the link on the very first post in this thread? They used a larger buffer and it worked fine, also that worked for me.Regards,
Extended error code "0x8800" corresponds to corrupted input JPEG data. Please check the input buffer size and make sure to provide complete JPEG frame data to decoder.
thanks for the reply. Even if I increase the buffer size, the same problem is observed but little later.
1. I observed that when the decoder fails the bytes consumed by the decoder are less than the actual number of bytes present in the buffer. i.e even if the data is present in the buffer the decoder is not reading the complete buffer. Any idea why this might be happening?
2. Is there any "End of Frame" or "Start of frame" sequence in case of MJPEG encoded data which I can look for? If there is please let me know.
3. I am also running H.264 decoder along with JPEG decoder. Can these two be run simultaneously? Is any synchronization required between these two?
4. Once the JPEG decoder fails with FATAL_ERROR, it does not recover. I tried XDM_RESET but it didn't help. Is there any way to recover the Jpeg decoder if it fails once?
Thanks for help.
Thanks and Regards,
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.