mickelson / attract

A graphical front-end for command line emulators that hides the underlying operating system and is intended to be controlled with a joystick or gamepad.
http://attractmode.org
GNU General Public License v3.0
392 stars 113 forks source link

MP4 Videos Play Back Stuttering/Freezing. #655

Open duy64 opened 3 years ago

duy64 commented 3 years ago

I have checked the forum for an answer, but found nothing so I reported here. Video Snaps playing with skipping frames or sometimes freezes, while the audio still playing. Attract Mode 2.6.1 and the nightly builds on windows 10. This is just an example of the many videos I got from the Arcade Database website. Videos can be found here videos The SD videos play fine, it's just the HD videos are not playing properly in Attract Mode. I have tested the videos outside of Attract Mode and they seem to play fine. I have pasted the video info below.

General Complete name : D:\Downloads\sf2hf.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 12.8 MiB Duration : 43 s 122 ms Overall bit rate mode : Variable Overall bit rate : 2 495 kb/s Movie name : Street Fighter II': Hyper Fighting (World 921209) [MAME] Performer : Progetto VideoSnaps by motoschifo & AntoPISA [gameplay by AntoPISA] Genre : MAME video preview (shortplay) Writing application : Lavf54.20.4 Comment : Created with: Mame version 0.165, / Played by: AntoPISA, / Game name: sf2hf - Street Fighter II': Hyper Fighting (World 921209), / Date game played: 11 settembre 2015, / Date video creation: 2 dicembre 2015, / Genre: Fighter, / Type: shortplay single-screen, / Manufacturer: Capcom, / Display resolution: 384x224px, / Driver status: GOOD (emulation good, graphic good, color good, sound good), / Link for info: http://adb.arcadeitalia.net/?mame=sf2hf, / Copyright (C) - All rights reserved - Tutti i marchi e loghi appartengono ai rispettivi proprietari

Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High 4:4:4 Predictive@L5.1 Format settings : CABAC / 16 Ref Frames Format settings, CABAC : Yes Format settings, Reference : 16 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 43 s 110 ms Bit rate : 2 307 kb/s Width : 1 848 pixels Height : 1 080 pixels Display aspect ratio : 4:3 Frame rate mode : Constant Frame rate : 29.970 (29970/1000) FPS Chroma subsampling : 4:4:4 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.039 Stream size : 11.9 MiB (92%) Writing library : x264 core 142 r2389 956c8d8 Encoding settings : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=4 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.25 / aq=1:1.00 Codec configuration box : avcC

Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : mp4a-40-2 Duration : 43 s 122 ms Duration_LastFrame : -15 ms Bit rate mode : Variable Bit rate : 182 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Stream size : 960 KiB (7%) Default : Yes Alternate group : 1

getnick80 commented 3 years ago

I have run into the same issue. Emulation Station seems to run the .mp4 snaps just fine, but attract mode will lag or freeze. This occurs with all video clips. The audio does run fine however.

I'm running a pi 4, 4gb with 200gb SanDisk Ultra card.

oomek commented 3 years ago

Emulation Station is using an omxplayer to play videos which is using a hardware overlay on top of the ES. This is fast enough to handle 1080p videos, but has some limitations. You can only display the video in a rectangle ( no perspective transforms allowed ) It's always on top, so you cannot draw any overlay, text or icon on top. AM uses MMAL which does not do zero copy video decoding. Even RPI4 is just too slow to do 1080p smoothly rendered on a texture.

I'm gonna try another approach soon and see if it helps with the performance.

duy64 commented 3 years ago

I hope you can fix for windows port too, or atleast give us the option to choose the default media player or decoder for video playback. I know there is an option to choose the decoder but it is limited to just hardware dxva2 and software but it doesn't specifies which one.