s60sc / ESP32-CAM_MJPEG2SD

ESP32 Camera motion capture application to record JPEGs to SD card as AVI files and stream to browser as MJPEG. If a microphone is installed then a WAV file is also created. Files can be uploaded via FTP or downloaded to browser.
GNU Affero General Public License v3.0
888 stars 209 forks source link

Apologies and a little help please. #376

Closed OldYin closed 6 months ago

OldYin commented 7 months ago

Apologies as this is not necessarily an issue with software but I am having issues with the AVI output format.

Everything else pretty much OK just that when I download any of the captured videos to ANY device, the format is not recognised. I CAN play all videos with FFMPEG and VLC player but Media Player Film & TV (Windows 10) and any default apps on mobile phones and tablets (All Android) won't look at the files. I can hex edit any one of the files and change one byte and suddenly I can play the files across all devices. I don't know enough about the format to understand why, perhaps you can help?

regards, Alex

s60sc commented 7 months ago

What is the one byte change?

OldYin commented 7 months ago

Hex_Edit

Changing the last byte to anything other than '00' pretty much ensures that the video is readable by all default windows 10 players / editors. Actually make any of the values in column 5 non zero and that will work. I'm most likely doing nothing useful but it is a little faster than running it through ffmpeg and creating an MP4.

As for my Android devices; they are not natively able to decode MJPG files. The reason they are now is because in the last couple of days we installed a Smart Doorbell. The app associated with the Doorbell camera has installed a new default player which can decode MJPG. Sorry for that bit of misinformation.

Regards, Alex

s60sc commented 7 months ago

Changing that byte corrupts indexed chunk length but many players such as VLC can fix it on the fly. Apart from Media Player Film & TV which I dont have (but Media Player Classic works fine), what other specific apps can play the corrupted file but not the original file. Android doesnt play AVI files natively, but lots of third party video apps do.

OldYin commented 7 months ago

Thanks for having a look any way.

I was poking about a bit doing nothing useful as usual and found that incrementing the idx1 index size also has the same result.

Other than Media Player / Films & TV / Windows Media Player (is that classic?) I don't have much else installed which I use regularly. Movie Maker & AVS video converter also won't play the files.

Interestingly, doing a straight codec copy with ffmpeg results in a MJPG file which is totally playable with all of the windows apps. I'm not really getting any clues from the hex editor though. I guess I'll be installing VLC over everything now :)

Thanks again for looking.

Alex