JairajJangle / motioneye-android

motionEye Android app - available on Google Play Store and F-Droid
https://play.google.com/store/apps/details?id=com.jairaj.janglegmail.motioneye
GNU General Public License v3.0
55 stars 15 forks source link

Error: media decode error or unsupported codec on Android #48

Closed mallory98e closed 1 year ago

mallory98e commented 1 year ago

Hello,

I'm glad that this app is still developed. I have opened a simlar thread about this issue on the original motion github didn't get much back. The point is after adding an mJPEG camera I realized that the video playback does work there even on Android just not on some of my other cameras where I get the mentioned error.

I assume that Android app uses some built in video player to try to play the video and that does not recognize the codec. Can you please fix this in the new version.

Broken video:

General
Count                                    : 322
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Video_Format_List                        : AVC
Video_Format_WithHint_List               : AVC
Codecs Video                             : AVC
Complete name                            : BROKENVID_07-12-45.mp4
File name                                : BROKENVID_07-12-45
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : isom
Codec ID                                 : isom (isom/iso2/avc1/mp41)
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
CodecID_Compatible                       : isom/iso2/avc1/mp41
Codec                                    : MPEG-4
Codec                                    : MPEG-4
Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
File size                                : 2197876
File size                                : 2.10 MiB
File size                                : 2 MiB
File size                                : 2.1 MiB
File size                                : 2.10 MiB
File size                                : 2.096 MiB
Duration                                 : 1218
Duration                                 : 1 s 218 ms
Duration                                 : 1 s 218 ms
Duration                                 : 1 s 218 ms
Duration                                 : 00:00:01.218
Duration                                 : 00:00:02:07
Duration                                 : 00:00:01.218 (00:00:02:07)
Overall bit rate                         : 14435967
Overall bit rate                         : 14.4 Mb/s
Frame rate                               : 10.000
Frame rate                               : 10.000 FPS
Frame count                              : 27
Stream size                              : 1172
Stream size                              : 1.14 KiB (0%)
Stream size                              : 1 KiB
Stream size                              : 1.1 KiB
Stream size                              : 1.14 KiB
Stream size                              : 1.145 KiB
Stream size                              : 1.14 KiB (0%)
Proportion of this stream                : 0.00053
HeaderSize                               : 40
DataSize                                 : 2196712
FooterSize                               : 1124
IsStreamable                             : No
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00
File last modification date              : UTC 2023-04-01 05:17:47
File last modification date (local)      : 2023-04-01 07:17:47
Writing application                      : Lavf57.56.101
Writing application                      : Lavf57.56.101

Video
Count                                    : 334
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : High 4:4:4 Predictive@L2.2
Format settings                          : 1 Ref Frames
Format settings, CABAC                   : No
Format settings, CABAC                   : No
Format settings, ReFrames                : 1
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=5
Internet media type                      : video/H264
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Codec                                    : AVC
Codec                                    : AVC
Codec/Family                             : AVC
Codec/Info                               : Advanced Video Codec
Codec/Url                                : http://developers.videolan.org/x264.html
Codec/CC                                 : avc1
Codec profile                            : High 4:4:4 Predictive@L2.2
Codec settings                           : 1 Ref Frames
Codec settings, CABAC                    : No
Codec_Settings_RefFrames                 : 1
Duration                                 : 1218
Duration                                 : 1 s 218 ms
Duration                                 : 1 s 218 ms
Duration                                 : 1 s 218 ms
Duration                                 : 00:00:01.218
Duration                                 : 00:00:02:07
Duration                                 : 00:00:01.218 (00:00:02:07)
Bit rate                                 : 6508753
Bit rate                                 : 6 509 kb/s
Width                                    : 640
Width                                    : 640 pixels
Height                                   : 480
Height                                   : 480 pixels
Sampled_Width                            : 640
Sampled_Height                           : 480
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.333
Display aspect ratio                     : 4:3
Rotation                                 : 0.000
Frame rate                               : 10.000
Frame rate                               : 10.000 FPS
Frame count                              : 27
Resolution                               : 8
Resolution                               : 8 bits
Colorimetry                              : 4:2:0
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Interlacement                            : PPF
Interlacement                            : Progressive
Bits/(Pixel*Frame)                       : 2.119
Stream size                              : 2196704
Stream size                              : 2.09 MiB (100%)
Stream size                              : 2 MiB
Stream size                              : 2.1 MiB
Stream size                              : 2.09 MiB
Stream size                              : 2.095 MiB
Stream size                              : 2.09 MiB (100%)
Proportion of this stream                : 0.99947
Writing library                          : x264 - core 148 r2748 97eaef2
Writing library                          : x264 core 148 r2748 97eaef2
Encoded_Library_Name                     : x264
Encoded_Library_Version                  : core 148 r2748 97eaef2
Encoding settings                        : cabac=0 / ref=1 / deblock=0:0:0 / analyse=0:0 / me=dia / subme=0 / psy=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / tr
ellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=0 / threads=4 / lookahead_threads=4 / sliced_threads=1 / slices=4 / nr=0 / decimate=
1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=5 / keyint_min=1 / scenecut=0 / intra_refresh=0 / rc=cqp / mbtree=0 / qp
=0
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00

Working video:

General
Count                                    : 322
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Video_Format_List                        : AVC
Video_Format_WithHint_List               : AVC
Codecs Video                             : AVC
Complete name                            : WORKINGVID_18-45-13.mp4
File name                                : WORKINGVID_18-45-13
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : isom
Codec ID                                 : isom (isom/iso2/avc1/mp41)
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
CodecID_Compatible                       : isom/iso2/avc1/mp41
Codec                                    : MPEG-4
Codec                                    : MPEG-4
Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
File size                                : 616926
File size                                : 602 KiB
File size                                : 602 KiB
File size                                : 602 KiB
File size                                : 602 KiB
File size                                : 602.5 KiB
Duration                                 : 11019
Duration                                 : 11 s 19 ms
Duration                                 : 11 s 19 ms
Duration                                 : 11 s 19 ms
Duration                                 : 00:00:11.019
Duration                                 : 00:00:12:00
Duration                                 : 00:00:11.019 (00:00:12:00)
Overall bit rate mode                    : VBR
Overall bit rate mode                    : Variable
Overall bit rate                         : 447900
Overall bit rate                         : 448 kb/s
Frame rate                               : 2.000
Frame rate                               : 2.000 FPS
Frame count                              : 24
Stream size                              : 1074
Stream size                              : 1.05 KiB (0%)
Stream size                              : 1 KiB
Stream size                              : 1.0 KiB
Stream size                              : 1.05 KiB
Stream size                              : 1.049 KiB
Stream size                              : 1.05 KiB (0%)
Proportion of this stream                : 0.00174
HeaderSize                               : 40
DataSize                                 : 615860
FooterSize                               : 1026
IsStreamable                             : No
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00
File last modification date              : UTC 2023-04-01 05:17:26
File last modification date (local)      : 2023-04-01 07:17:26
Writing application                      : Lavf57.56.101
Writing application                      : Lavf57.56.101

Video
Count                                    : 334
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format/Url                               : http://developers.videolan.org/x264.html
Commercial name                          : AVC
Format profile                           : Baseline@L2.2
Format settings, CABAC                   : No
Format settings, CABAC                   : No
Format settings, GOP                     : N=1
Internet media type                      : video/H264
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Codec                                    : AVC
Codec                                    : AVC
Codec/Family                             : AVC
Codec/Info                               : Advanced Video Codec
Codec/Url                                : http://developers.videolan.org/x264.html
Codec/CC                                 : avc1
Codec profile                            : Baseline@L2.2
Codec settings, CABAC                    : No
Duration                                 : 11019
Duration                                 : 11 s 19 ms
Duration                                 : 11 s 19 ms
Duration                                 : 11 s 19 ms
Duration                                 : 00:00:11.019
Duration                                 : 00:00:12:00
Duration                                 : 00:00:11.019 (00:00:12:00)
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Bit rate                                 : 410568
Bit rate                                 : 411 kb/s
Width                                    : 640
Width                                    : 640 pixels
Height                                   : 480
Height                                   : 480 pixels
Sampled_Width                            : 640
Sampled_Height                           : 480
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.333
Display aspect ratio                     : 4:3
Rotation                                 : 0.000
Frame rate                               : 2.000
Frame rate                               : 2.000 FPS
Frame count                              : 24
Resolution                               : 8
Resolution                               : 8 bits
Colorimetry                              : 4:2:0
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 8
Bit depth                                : 8 bits
Scan type                                : Progressive
Scan type                                : Progressive
Interlacement                            : PPF
Interlacement                            : Progressive
Bits/(Pixel*Frame)                       : 0.668
Stream size                              : 615852
Stream size                              : 601 KiB (100%)
Stream size                              : 601 KiB
Stream size                              : 601 KiB
Stream size                              : 601 KiB
Stream size                              : 601.4 KiB
Stream size                              : 601 KiB (100%)
Proportion of this stream                : 0.99826
Writing library                          : x264 - core 148 r2748 97eaef2
Writing library                          : x264 core 148 r2748 97eaef2
Encoded_Library_Name                     : x264
Encoded_Library_Version                  : core 148 r2748 97eaef2
Encoding settings                        : cabac=0 / ref=1 / deblock=0:0:0 / analyse=0:0 / me=dia / subme=0 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=4 / lookahead_threads=4 / sliced_threads=1 / slices=4 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=1 / keyint_min=1 / scenecut=0 / intra_refresh=0 / rc=crf / mbtree=0 / crf=25.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=0
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00

I mean we are in 2023 how come a recent phone running Android 13 can't play some codec from a camera made over 10 years ago.

JairajJangle commented 1 year ago

@mallory98e could you please confirm the below?

  1. Does the video play on different Android devices?
  2. Can you update the "Android System Webview" and your default browser to the latest version and check if the video with the broken AVC codec plays?
  3. Does the video play on a desktop browser?
JairajJangle commented 1 year ago

Closing the issue as there was no response from the issue author.

mallory98e commented 1 year ago

BTW I can confirm that you can download the video on Android and load it manually into VLC player but it's just a major pain in the ass. Can't you just make the def player VLC then and release a new app?

Thanks.

JairajJangle commented 1 year ago

Changing the default video player app cannot be done from within a third-party Android app(like the motionEye app) without special permissions(which may require root access which is not what we want to do as it may compromise device security). You will need to manually set the default video player through Android system settings.

You may find this guide useful: How to Change the Default Video Player App in Android

mallory98e commented 11 months ago

It is literally impossible to change it anymore on Android 13 however I found a solution!!!

You have to change the VIDEO RECORDING CODEC to HEVC.mp4 what Andorid can play back without any issues.

Now ironically neither Firefox nor Chrome can play this :D but fixing it on PC still easier so I'm sure there will be a solution for that.