jc-kynesim / rpi-ffmpeg

FFmpeg work for RPI
Other
111 stars 27 forks source link

Help with preparing a patch to apply to official ffmpeg on RPi4 #17

Closed graysky2 closed 3 years ago

graysky2 commented 3 years ago

Hi John. My git skills are lacking. I'd like to prepare a patch of your code to the official ffmpeg tag 'n4.3.2' but I am not sure why I cannot pull their tags.

What I did: Cloned your repo and added ffmpeg upstream.

git checkout test/4.3.2/rpi_main
git remote add ffmpeg-upstream git@github.com:FFmpeg/FFmpeg.git
git fetch ffmpeg-upstream

I planned to generate the patch with a git diff ... but cannot find the n4.3.2 target. What am I missing?

% git diff ffmpeg-upstream/<<TAB>>
completing remote head
ffmpeg-upstream/master        ffmpeg-upstream/release/0.9   ffmpeg-upstream/release/2.4   ffmpeg-upstream/release/3.3 
ffmpeg-upstream/oldabi        ffmpeg-upstream/release/1.0   ffmpeg-upstream/release/2.5   ffmpeg-upstream/release/3.4 
ffmpeg-upstream/release/0.10  ffmpeg-upstream/release/1.1   ffmpeg-upstream/release/2.6   ffmpeg-upstream/release/4.0 
ffmpeg-upstream/release/0.11  ffmpeg-upstream/release/1.2   ffmpeg-upstream/release/2.7   ffmpeg-upstream/release/4.1 
ffmpeg-upstream/release/0.5   ffmpeg-upstream/release/2.0   ffmpeg-upstream/release/2.8   ffmpeg-upstream/release/4.2 
ffmpeg-upstream/release/0.6   ffmpeg-upstream/release/2.1   ffmpeg-upstream/release/3.0   ffmpeg-upstream/release/4.3 
ffmpeg-upstream/release/0.7   ffmpeg-upstream/release/2.2   ffmpeg-upstream/release/3.1   ffmpeg-upstream/release/4.4 
ffmpeg-upstream/release/0.8   ffmpeg-upstream/release/2.3   ffmpeg-upstream/release/3.2                               
graysky2 commented 3 years ago

Ah, I see, do not prefix the command:

git diff n4.3.2 > /path/to/foo.patch
graysky2 commented 3 years ago

@jc-kynesim - I got the patch to apply and it compiles fine, but how can I get ffplay to use HW decoding from the shell?

% ffplay /mnt/media/jellyfish-90-mbps-hd-hevc.mkv
ffplay version n4.3.2 Copyright (c) 2003-2021 the FFmpeg developers
  built with gcc 11.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-shared --enable-version3 --host-cflags='"-fPIC"' --enable-librsvg
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, matroska,webm, from '/mnt/media/jellyfish-90-mbps-hd-hevc.mkv':
  Metadata:
    COMPATIBLE_BRANDS: iso4hvc1iso6
    MAJOR_BRAND     : iso4
    MINOR_VERSION   : 1
    ENCODER         : Lavf56.3.100
  Duration: 00:00:30.10, start: 0.067000, bitrate: 90155 kb/s
    Stream #0:0(und): Video: hevc (Main), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 29.97 tbc (default)
    Metadata:
      CREATION_TIME   : 2016-02-05 03:50:09
      LANGUAGE        : und
      HANDLER_NAME    : hevc@GPAC0.5.2-DEV-rev565-g71748d7-ab-suite

That just struggles to play without HW decoding. Thanks.