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
393 stars 115 forks source link

Some Videos Fail to Decode #423

Open Enverex opened 6 years ago

Enverex commented 6 years ago

Ran into an issue where some videos (primarily PSP videos from EmuMovies) refused to play using the hardware encoders (VDPAU/VAAPI). The command line showed the messages:

FFmpeg: hardware accelerator failed to decode picture
Error decoding video
Error initializing video thread

So I assumed there was an issue with the videos themselves and they had something not quite right done during encoding, but FFMPEG seems to think they're fine:

  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.20.100
  Duration: 00:00:36.24, start: -0.012000, bitrate: 1895 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 1696 kb/s, 60 fps, 60 tbr, 15360 tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

Playing them with MPlayer (using VDPAU) also went without issue...

libavformat version 57.83.100 (external)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  854x480  24bpp  60.000 fps  1696.8 kbps (207.1 kbyte/s)
==========================================================================
Forced video codec: ffh264vdpau
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 57.107.100 (external)
Selected video codec: [ffh264vdpau] vfm: ffmpeg (FFmpeg H.264 (VDPAU))
==========================================================================
Clip info:
 major_brand: isom
 minor_version: 512
 compatible_brands: isomiso2avc1mp41
 encoder: Lavf57.20.100
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, floatle, 192.0 kbit/6.25% (ratio: 24006->384000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] 48000Hz 2ch floatle (4 bytes per sample)
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 854x480 => 854x480 H.264 VDPAU acceleration
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 854x480 => 854x480 H.264 VDPAU acceleration

It does, however, play the sound, there's just no video.

Any ideas what AttractMode in particular may be struggling with here? I can upload an example video if that would help as they're pretty small.

ankuradhikari08 commented 6 years ago

i also face same problem. is compatible_brands: isomiso2avc1mp41 creating any issue ??

mickelson commented 6 years ago

Most likely is that attract mode hasn't implemented the hw accel decoding correctly. I can't find good documentation or examples of how to do hwaccel in FFmpeg and the API seems to always be shifting and changing. I find it a real challenge. I'll plug away at fixing it when I get a chance, however I do find this aspect of the program very frustrating.