mirror of
https://github.com/motioneye-project/motioneye.git
synced 2026-03-02 22:57:06 -05:00
playback/timelapse by phone and windows unavailable for motioneye created files #938
Labels
No labels
Android app
Arch Linux
CI/CD
CSS
FreeBSD
HTML/HTTP
Home Assistant addon
JavaScript
Python
Raspberry Pi
Stale No Activity 60 Days
bug
code format
dependencies
dev branch
docker
documentation
duplicate
enhancement
feature
help wanted
i18n/l10n
invalid
legacy motionEye
meta
motion
motionEyeOS
notourproblem
python update
question
question
security
troubleshooting
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/motioneye#938
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @davebdb on GitHub (Sep 18, 2018).
I followed the directions several times for Ubuntu (running Lubuntu flavor of Ubuntu, to lighten the resource usage).
I tried both the native install and also built ffmpeg from source and also motion from source.
"preview" playback and timelapse work fine while using my linux based laptop, but when I try to play back or timelapse from a windows PC or my cellphone I get an error.
when doing a "timelapse" with phone (android running chrome) I get the following error:
It starts out with 1% then fails:
"The timelapse movie could not be created"
when doing a movie preview:
"Error: Media decode error or unsupported media features"
When using a motioneyeOS (Pi 3B version) all these features have no issues and work as planned. Since I want to put more than 1 or 2 cameras up and want to be able to run them with HD support I need to put them on a full size server.
Is there some library or configure option I am missing or need to enable/disable?
@davebdb commented on GitHub (Sep 18, 2018):
Additional info:
I forgot to add, that the video files are perfectly fine if I download and play them with the local player such as VLC. So the files themselves seem to be intact even for the failed system, but must be downloaded instead of "streamed" off the server. It would be nice to preview it before downloading.
@Klausoleum commented on GitHub (Oct 18, 2018):
I have a very similar problem.
1022
On a Linux (Ubuntu) laptop, the timelapse function only works sometimes.
Via Terminal I can always create timelapse videos
With debian and other distributions I have the same problems
With motioneyeOS it works flawlessly
@ccrisan commented on GitHub (Oct 19, 2018):
This is probably due to a video codec that's not supported by the browser. Make sure you're running ffmpeg and motion versions equal or close to those used by motionEyeOS and that ffmpeg is compiled with the codecs you're using.
@davebdb commented on GitHub (Nov 29, 2018):
Somehow missed this update, been a busy few months at my job. I've compiled ffmpeg with as close to the same ./configure switches as the motionEyeOS version (looking at the version info). Excluded the RPi / ARM specific switches. I'll try to post the switches I used a little later. Look for an update in the next day or 2 as I get the time to do that.
Will also give the version info and any other information I believe is significant.
@kunau commented on GitHub (Dec 9, 2018):
Running these versions:
motionEye Version | 0.39.3
Motion Version | 4.1.1
OS Version | motionEyeOS 20181129
Movie Format H.264 (.mp4)
With the same issues. Tracking appears to work but produces a movie that is not playable on any of my platforms, LINUX, IOS, or OSX. When a movie is selected in the browser is produces the error:
Error: Media format unsupported or otherwise unavilable/unsuitable for playing.
(sic, including the mis-spelling of unavailable.)
Will continue to monitor this thread and will respond if I can offer a fix.
Thanks,
@andresanches commented on GitHub (Jan 29, 2019):
@davebdb I had a similar issue when trying to view recorded footage (stream, not download) on my android phone (on chrome). I noticed that the playback almost started, even showing recording length in minutes and seconds but then crapped out. I also noticed that on an actual computer wired to the ethernet streaming stuttered a lot because buffering was slower than the playback speed (strange for a gigabit network), but ultimately it worked. This indicated it was not a corruption issue but some sort of bottleneck in the code causing a timeout and as it turns out, at least for me, it was
Looking at the code here I found that the
MoviePlaybackHandleruses the/tmpdirectory heavily, which in my vanilla debian stretch lite was set up on the good old hard drive. So I changed it to be mountedtmpfsinstead, as per this suggestionNow not only playback works fine on mobile but the stuttering on the computer is also gone
Hope this helps others who run into this issue
@Technaur commented on GitHub (Jul 26, 2019):
I am also getting the error message (While streaming on the web interface, downloads are fine)
Error: Media format unsupported or otherwise unavilable/unsuitable for playing.
I am running versions:
motionEye Version | 0.40
Motion Version | 4.1.1
OS Version | Raspbian 10
When I use to run motionEyeOS it worked fine.
I did also set up a custom path for my motioneye.conf file in directory /home/pi/motioneye/motioneye.conf
I did also set a custom path for the saved "Movies", in /media/pi/exthdd/MotionEye
Is some codec for streaming on the web interface missing or something?
With setup I did follow this guide.
https://github.com/ccrisan/motioneye/wiki/Install-On-Raspbian
and
https://github.com/ccrisan/motioneye/wiki/Running-As-Normal-User
@davebdb commented on GitHub (Dec 31, 2019):
@Technaur can you check to see if this solution works for you as well? It did for me
https://github.com/ccrisan/motioneye/issues/1067#issuecomment-443541808
I'm going to post the output of ffprobe on the 2 files. One that doesn't work (pre convert.sh script implementation) and one that works (after the script was added. They look the same to me, so not sure what the issue is exactly. Maybe someone can spot something that is different between the 2, other than file size because they are not the same file as they are different times.
DOES NOT WORK:
$ ffprobe -i 10-19-48.mp4 -show_format -hide_banner -show_streams
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '10-19-48.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Duration: 00:00:15.63, start: 0.036000, bitrate: 20640 kb/s
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p, 1280x720, 20637 kb/s, 23.60 fps, 24 tbr, 16k tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High 4:4:4 Predictive
codec_type=video
codec_time_base=1737/82000
codec_tag_string=avc1
codec_tag=0x31637661
width=1280
height=720
coded_width=1280
coded_height=720
has_b_frames=0
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuv420p
level=31
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24/1
avg_frame_rate=41000/1737
time_base=1/16000
start_pts=576
start_time=0.036000
duration_ts=250704
duration=15.669000
bit_rate=20637517
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=369
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=VideoHandler
[/STREAM]
[FORMAT]
filename=10-19-48.mp4
nb_streams=1
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.036000
duration=15.633000
size=40334212
bit_rate=20640548
probe_score=100
TAG:major_brand=isom
TAG:minor_version=512
TAG:compatible_brands=isomiso2avc1mp41
TAG:encoder=Lavf57.83.100
[/FORMAT]
WORKS:
$ ffprobe -i 16-06-50.mp4 -show_format -hide_banner -show_streams
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '16-06-50.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Duration: 00:00:12.64, start: 0.000000, bitrate: 1660 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1657 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/50
codec_tag_string=avc1
codec_tag=0x31637661
width=1280
height=720
coded_width=1280
coded_height=720
has_b_frames=2
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuv420p
level=31
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/12800
start_pts=0
start_time=0.000000
duration_ts=161792
duration=12.640000
bit_rate=1657942
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=316
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=VideoHandler
[/STREAM]
[FORMAT]
filename=16-06-50.mp4
nb_streams=1
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=12.640000
size=2622868
bit_rate=1660043
probe_score=100
TAG:major_brand=isom
TAG:minor_version=512
TAG:compatible_brands=isomiso2avc1mp41
TAG:encoder=Lavf57.83.100
[/FORMAT]
EDIT 1:
My convert.sh script I had to add an exception into it for JPEG files because it was also converting the JPEG files. If anyone has a better way of making this test feel free to give me suggstions. Now for some reason my converted files are running at like x2, so I think I need to add a -r (ffmpeg) for the frame rate.
EDIT 2:
(FIXED these in this current EDIT). Also made quality and frame rate being variables so they are easier to modify and put comments for the variables. Will probably make this convert-01 to convert-xx based on camera, otherwise all cameras tied to this script will have the same frame rate.
Hopefully this will not have to be done in future editions. The other thread made a comment this is involving 'motion' being the culprit. Hopefully this hack will work for those having this issue.
$ cat /etc/motioneye/convert.sh
#!/bin/bash
FILEPATH="$1"
FILETYPE=$(file -b "$FILEPATH") #get file type of FILEPATH
RATE=25 #set framerate
CRF=16 #set quality 0-51 (lower numbers better)
#avoid trying to convert JPEG detected files; if JPEG then exit with status 0
if
then
exit 0
fi
TMPPATH=$(mktemp).mp4
/usr/bin/ffmpeg -r "$RATE" -i "$FILEPATH" -pix_fmt yuv420p -vcodec libx264 -crf "$CRF" "$TMPPATH"
/bin/rm -f "$FILEPATH"
/bin/mv "$TMPPATH" "$FILEPATH"
@wx-watch commented on GitHub (Jan 10, 2020):
Your convert script helped me in an unrelated fashion. I could not play files from my RTSP camera on my Mac or iPhone and would get the "Error: Media decode error or unsupported media features" error. It worked on a Linux box. But I discovered that Quicktime can't play the High 4:4:4 Predictive profile that the RTSP camera was delivering.
So I forced the profile by adding "-profile:v high" to the ffmpeg command, and now they play fine!
@davebdb commented on GitHub (Jul 5, 2020):
@ccrisan question on how this can be resolved. I've noticed the thing that is different is the profile for the streams that have issues is the predictive 4:4:4
Below is the snippet from my 2 outputs just of this part
NOT WORK
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p, 1280x720, 20637 kb/s, 23.60 fps, 24 tbr, 16k tbn, 48 tbc (default)
WORKS
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 1657 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Is this something that can be fixed in the MotionEye or is there someplace else this need to be resolved in. I'm wondering if the 4:4:4 Predictive profile is the main culprit here and if there is a way to modify it. If I know where to look, be it a config file or code, I can give it a try. If I can make it a per camera, I could test easily on a less critical camera before deploying to all cameras. Some insight as to how MotionEye sets the profile would be great. Thanks
-Dave