3

I am trying to play USB Webcam stream(not sure in which format it is..) using ffplay in windows. I can see the video without any issue, But I am keep getting below error in console.

ffplay.exe -f dshow -i video="Logitech HD Webcam C615" -loglevel debug

[mjpeg @97a118cc80] unable to decode APP fields: Invalid data found when processing input check logs for more details

Do I really need to worry about this error? Or any filter that I need to provide in command to get ride of this error .

Note: I tried to save stream to a file using ffmpeg getting the same issue.

Thanks in advance.

  • For what it's worth, I get the same behavior (the exact same message, repeated 15 times per second when I record at 15 frames per second) on the integrated webcam on my Thinkpad. It doesn't seem to affect output, but it's annoying because it's hiding ffmpeg normal output. – jpetazzo Apr 17 '19 at 10:07
  • Yes! its not affecting output. I just simply changed my webcam from "Logitech C615" to "Logitech C270" its gone. Still not sure what was the cause for Error. @jpetazzo – Syed Apr 18 '19 at 6:12
5

Those APP field messages are not errors. What you are seeing is Logitech's proprietary motion-jpeg format that they use in many of their web cameras. I have seen it in the C270 and the newer c922, for example. The mjpeg stream contains a sequence of jpeg images, some are key frames, the complete image, and some are other frames such as delta frames, describing the differences between frames. What Logitech does is embed an H264 stream into the mjpeg stream by attaching H264 data onto the jpeg frames as APP attachments, i.e. it's a stream within a stream. As you play or transcode data from the mjpeg stream, ffmpeg runs into these APP attachments and doesn't know what to do with them. I believe programs such as Skype are able to read both the outer mjpeg stream and the inner H264 stream.

If you want to see this for yourself, you can encode a small video from the mjpeg stream of your cam, then extract the jpeg images, then view the structure of the jpeg images and you will see the embedded video.

# create a small mp4, copying mjpeg stream off the cam for a second or two
$ ffmpeg -f v4l2 -input_format mjpeg -i /dev/video0 -c:v copy test.mp4

# extract the unaltered jpeg files inside the stream
$ ffmpeg -i test.mp4 -vcodec copy %03d.jpg

# view any of the jpeg files for APP attachments
$ exiv2 -pS 001.jpg

STRUCTURE OF JPEG FILE: 001.jpg address | marker       |  length | data
   0 | 0xffd8 SOI  
   2 | 0xffe0 APP0  |      33 | AVI1.....x.x....................
  37 | 0xffdb DQT   |      67 
 106 | 0xffdb DQT   |      67 
 175 | 0xffdd DRI   |       4 
 181 | 0xffe0 APP0  |       4 | ....
 187 | 0xffc0 SOF0  |      17 
 206 | 0xffda SOS  

See those APP0 attachments on the jpeg? That's the embedded H264 data that the decoders/players are complaining about.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.