libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.35k stars 1.84k forks source link

ffmpeg recording video rotated and bad aspect ratio for vertical games #4819

Open scarlion1 opened 7 years ago

scarlion1 commented 7 years ago

Description

I followed the guide mentioned below to set up recording of live game play, but with vertical games the video comes out rotated 90 degrees and the aspect ratio is wrong too (not rotated with the video). With the recording config, if i used the bgr24 pix_fmt as suggested in the guide, the video would come out black/blank (audio still came through), so when i changed pix_fmt to rgb24 then the video started coming through, but the orientation is off. See actual behavior image below.

pi@retropie:~ $ cat /dev/shm/runcommand.log
Parameters:
Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-fbalpha/fbalpha_libretro.so --record /tmp/recording_lr-fbalpha_$(date +%Y-%m-%d-%H%M%S).mkv --recordconfig /home/pi/RetroPie/recording/config.cfg --config /opt/retropie/configs/arcade/retroarch.cfg "/home/pi/RetroPie/roms/arcade/mspacman.zip" --appendconfig /dev/shm/retroarch.cfg
[libx264rgb @ 0x582ac0] using SAR=27/28
[libx264rgb @ 0x582ac0] using cpu capabilities: ARMv6 NEON
[libx264rgb @ 0x582ac0] profile High 4:4:4 Predictive, level 2.1, 4:4:4 8-bit
[libx264rgb @ 0x582ac0] 264 - core 148 r2762 90a61ec - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:1:1 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
[matroska @ 0x582360] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[matroska @ 0x582360] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[libx264rgb @ 0x582ac0] frame I:10    Avg QP: 0.00  size: 36141
[libx264rgb @ 0x582ac0] frame P:2367  Avg QP: 0.00  size:  7912
[libx264rgb @ 0x582ac0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264rgb @ 0x582ac0] mb P  I16..4: 53.0%  0.0%  0.0%  P16..4:  2.8%  0.0%  0.0%  0.0%  0.0%    skip:44.2%
[libx264rgb @ 0x582ac0] coded y,u,v intra: 4.9% 4.6% 15.9% inter: 2.7% 2.5% 3.3%
[libx264rgb @ 0x582ac0] i16 v,h,dc,p: 99%  1%  0%  0%
[libx264rgb @ 0x582ac0] kb/s:3854.61
pi@retropie:~ $ cat RetroPie/recording/config.cfg
format = matroska
threads = 3
vcodec = libx264rgb
video_preset = ultrafast
video_tune = animation
pix_fmt = rgb24
video_qp = 0
acodec = flac

Expected behavior

video should be oriented with aspect ratio like this screenshot

Actual behavior

frame from ffmpeg video

Steps to reproduce the bug

  1. rebuild retroarch with ffmpeg enabled
  2. configure recording options using above values from recording/config.cfg
  3. launch any vertical game (tried with Ms. Pacman and Galaga)

Version/Commit

You can find this information under Information/System Information

Environment information

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/44051216-ffmpeg-recording-video-rotated-and-bad-aspect-ratio-for-vertical-games?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github).
4n0nct commented 3 years ago

I have the same problem 2021-08-22_19-48 Videos are rotated and enlarged

4n0nct commented 3 years ago

So there's no solution ?