Author Topic: Video snaps play for a few seconds then stop. RPI2  (Read 7339 times)

tonberryhunter

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Video snaps play for a few seconds then stop. RPI2
« 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.

cruz1383

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #1 on: December 11, 2016, 05:51:05 PM »
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 )

tonberryhunter

  • Full Member
  • ***
  • Posts: 45
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #2 on: December 11, 2016, 06:11:22 PM »
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.   

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #3 on: December 11, 2016, 06:18:04 PM »
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

ozboss

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #4 on: December 12, 2016, 02:56:25 AM »
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
« Last Edit: December 12, 2016, 03:01:34 AM by ozboss »

ozboss

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #5 on: December 12, 2016, 04:44:44 AM »
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?

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #6 on: December 13, 2016, 12:34:49 AM »
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".
Code: [Select]
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".
Code: [Select]
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.
« Last Edit: December 13, 2016, 12:41:26 AM by progets »

ozboss

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #7 on: December 13, 2016, 02:31:38 AM »
ok i get it thanks a lot  :)

Kayin

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #8 on: December 17, 2016, 02:58:24 AM »
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.

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1015
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #9 on: December 17, 2016, 10:22:43 AM »
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"
Code: [Select]
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 )

Kayin

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #10 on: December 17, 2016, 10:24:00 PM »
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.
« Last Edit: December 18, 2016, 02:44:21 AM by Kayin »

Kayin

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #11 on: December 18, 2016, 01:23:02 PM »
So still kicking this trying to figure out whats up. When I compile it my results look like..

Code: [Select]
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.

ozboss

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #12 on: December 22, 2016, 06:33:35 AM »
so i have the mmal option now for video decoding but for some reason it works worse then before.

couchpotato

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #13 on: December 30, 2016, 04:51:53 AM »
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?

tekn0

  • Full Member
  • ***
  • Posts: 36
    • View Profile
Re: Video snaps play for a few seconds then stop. RPI2
« Reply #14 on: December 31, 2016, 12:11:46 AM »
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