Attract-Mode Support Forum
Attract-Mode Support => General => Topic started by: tonberryhunter on December 11, 2016, 05:07:48 PM
-
I'm running into an issue with the video snaps in Attract Mode only playing for a few seconds then freezing. The audio keeps playing but video stops. Is this a possible memory issue or perhaps a codec problem? Is there a video size limit? I downloaded some lower res videos intended for Hyperspin. They are pretty crap quality already. Perhaps they are too long? Also I noted the static video is pausing then resuming. Sometimes when the video halts the screen turns grey as well.
Model is : RPI 2 model B 1gb memory.
-
i see this happening sometimes also i have a Pi3 it might be too much for the pi to handle or AM needs more optimization, if its optimization then that will come with time and we will just have to wait. its not that bad on the pi 3 though so i can live with it. have you tried over clocking the cpu a bit (pi isnt really that much of an over clocker but a little bit might help )
-
i see this happening sometimes also i have a Pi3 it might be too much for the pi to handle or AM needs more optimization, if its optimization then that will come with time and we will just have to wait. its not that bad on the pi 3 though so i can live with it. have you tried over clocking the cpu a bit (pi isnt really that much of an over clocker but a little bit might help )
Yeah its weird cause it happens almost random. I notice some of my longer videos play fine while others dont. Seems regardless of file size. I edited a video with Adobe Premiere and replaced it on the pi and that seemed to help. It almost feels like a codec/ram limitation more than a cpu limitation. Yeah with all that said my RPi 3 has far less issues with the videos. So Im guessing its this Pi thats holding me back. I wonder if it would be possible to use animated gifs for the snaps? That would solve some issues with memory and cpu? Gifs can look pretty good and possibly better than these low quality MP4 videos. So rather than a video of the game just have the gif playthough a few static images of various games for said system.
-
The best solution is to install FFmpeg and then enable mmal hardware encoding in Attractmode. This will fix your issue. https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-%28Raspbian-Jessie%29
-
i had the same issue but converting to 240p solved it for me, its really not the filesize, because when i first converted the files where actually bigger due to lack of compression.
and some videos also where 59fps, didnt check if that makes a difference.
anyway im running 240p 25 fps .mp4 and the pi seems happy with it
-
so i tried to install ffmpeg anyway, but when i go into configure->general the video decoder is still software and i cannot chose otherwise.
what i did is install attract mode from retropie experimental packages and then installed ffmpeg with method 2 from your link.
maybe attract mode and ffmpeg is not in the same folder? does that make a difference?
-
so i tried to install ffmpeg anyway, but when i go into configure->general the video decoder is still software and i cannot chose otherwise.
what i did is install attract mode from retropie experimental packages and then installed ffmpeg with method 2 from your link.
maybe attract mode and ffmpeg is not in the same folder? does that make a difference?
Folder locations aren't your issue. Attractmode needs to be compiled with ffmpeg installed to use the mmal option. Since you installed ffmpeg after attractmode you need to update/reinstall attractmode. You can do this by using the retropie setup and and under attractmode choose "Update from source". You could also follow the steps in the wiki link for just attractmode.
When you are using software decoding you will get this when you run "attract -v".
Attract-Mode v2.2.0 (Linux, SFML 2.3 +FontConfig +RPi +SWF)
Using Libav for Audio and Video.
avcodec 56.1.0 / avformat 56.1.0 / swscale 3.0.0 / avresample 2.1.0
Shaders are not available.
When you are using hardware decoding you will get this when you run "attract -v".
Attract-Mode v2.2.0 (Linux, SFML 2.3 +FontConfig +RPi +SWF)
Using FFmpeg for Audio and Video.
avcodec 57.67.100 / avformat 57.59.100 / swscale 4.3.101 / swresample 2.4.100
Shaders are not available.
The hardware decoding really makes a big difference on the Pi.
-
ok i get it thanks a lot :)
-
Hey Progets, out of curiousity, with your build of ffmpeg, if you do ...
ffmpeg -codecs | grep h264_mmal
do you get anything?It was necessary last time I got MMAL to (crappily) work on attractmode but I'm wondering if its a red herring for me getting it to work right now.
-
You don't need to run "ffmpeg -codecs | grep h264_mmal" to get it to work. Following the steps in the wiki should be enough for a new install or a upgrade install. You must compile attractmode after you install ffmpeg so attractmode knows it's there.
Here's the output of "ffmpeg -codecs | grep h264_mmal"
ffmpeg version git-2016-12-13-d84e635 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --enable-mmal --disable-debug --enable-memalign-hack --enable-shared
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 67.100 / 57. 67.100
libavformat 57. 59.100 / 57. 59.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
D.V.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_mmal )
-
I had issues following the steps and recompiling AM and not having mmal show up. Which is fine, I'll fuss around with it and figure it out, but knowing I don't have to chase after ffmpeg like that as the possible cause of the issue cuts a HUGE amount of time out of stuff (especially since ffmpeg easily takes the longest to compile). So thanks a ton for clearing that up for me, hopefully I can get this working now.
edit: actually double checking, ffmpeg is definitely the problem. D.V.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_mmal ) doesn't show up and I got library misconfigurations a mile long. Clearly something is installed somewhere that's fucking things up and I just gotta try and figure it out I guess.
-
So still kicking this trying to figure out whats up. When I compile it my results look like..
ffmpeg version git-2016-12-18-02aa070 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --enable-mmal --disable-debug --enable-memalign-hack --enable-shared
WARNING: library configuration mismatch
avutil configuration: --pkg-config-flags=--static --extra-cflags='-fPIC -I/root/ffmpeg_build/include' --extra-ldflags=-L/root/ffmpeg_build/lib --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
avcodec configuration: --pkg-config-flags=--static --extra-cflags='-fPIC -I/root/ffmpeg_build/include' --extra-ldflags=-L/root/ffmpeg_build/lib --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
avformat configuration: --pkg-config-flags=--static --extra-cflags='-fPIC -I/root/ffmpeg_build/include' --extra-ldflags=-L/root/ffmpeg_build/lib --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
avdevice configuration: --pkg-config-flags=--static --extra-cflags='-fPIC -I/root/ffmpeg_build/include' --extra-ldflags=-L/root/ffmpeg_build/lib --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
avfilter configuration: --pkg-config-flags=--static --extra-cflags='-fPIC -I/root/ffmpeg_build/include' --extra-ldflags=-L/root/ffmpeg_build/lib --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
swscale configuration: --pkg-config-flags=--static --extra-cflags='-fPIC -I/root/ffmpeg_build/include' --extra-ldflags=-L/root/ffmpeg_build/lib --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
swresample configuration: --pkg-config-flags=--static --extra-cflags='-fPIC -I/root/ffmpeg_build/include' --extra-ldflags=-L/root/ffmpeg_build/lib --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
postproc configuration: --pkg-config-flags=--static --extra-cflags='-fPIC -I/root/ffmpeg_build/include' --extra-ldflags=-L/root/ffmpeg_build/lib --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-pic --extra-ldexeflags=-pie --enable-shared
libavutil 55. 43.100 / 55. 29.100
libavcodec 57. 68.100 / 57. 54.101
libavformat 57. 61.100 / 57. 48.101
libavdevice 57. 2.100 / 57. 0.102
libavfilter 6. 68.100 / 6. 58.100
libswscale 4. 3.101 / 4. 1.100
libswresample 2. 4.100 / 2. 1.100
libpostproc 54. 2.100 / 54. 0.100
This is an old install (from Wheezy) that's been upgraded to Jessie and has all sorts of experimenting done on it. The idea of starting from scratch is terrible but I might have to do it at this rate. Trying to find old or unnecessary packages that might be interfering with things.
-
so i have the mmal option now for video decoding but for some reason it works worse then before.
-
I just built the latest attract mode and ffmeg from source as per the tutorial for an RPI3. I too am experiencing this issue with a number of the snap videos. I switched over to mmal for testing and, although the intro played fine, now many of the videos that worked just show a corrupted black/grey screen BUT the videos that locked up, at least one of them now plays fine.
Not sure if i'm now missing another switch or option or need to recompile ffmpeg to make this all better :/ any thoughts anyone?
-
I just did this today and it had a major improvement. I have some video skipping issues but the audio is fine. I used retropie's experimental packages tool to recompile attract mode.
Im using 480p video snaps from emu movies with Nevato on a PI3
-
For anyone interested here's a super quick bash script that I'm using on my RPI3 to convert videos so they work with attract mode on that platform with the MMAL mode turned on. Under software mode my videos would play 1-2 seconds and stop and the same videos under MMAL would just be a green screen with sound. I converted one using FFMPEG, compiled on the RPI3 to run in hardware mode, and the result was a working video under both software and hardware playback.
This really simple script just iterates through the videos directory converting the video and placing it in the videos2 directory. If FFMPEG is successful it deletes the original file for space reasons. Obviously you can hack this up anyway you feel fit I'm just presenting what worked for me. Once it's converted what it can you can copy the files from videos2 back to videos and , as long as your paths are ok, everything should work.
#!/bin/bash
for file in ./video/*.mp4
do
filename=$(basename "$file")
ffmpeg -i $file -s 640x480 ./video2/$filename
if [ $? -eq 0 ]
then
echo "Video converted!"
rm $file
else
echo "Failed to convert Video!"
fi
done
echo "Script completed"
A quick calculation for me was the 500 plus videos I have for my cut down romset of "common" games was about a 4hr conversion time on the RPI3 , you could test this on better hardware obviously.