jc-kynesim / rpi-ffmpeg

FFmpeg work for RPI
Other
111 stars 27 forks source link

HW accel decoding from dev/4.4/rpi_import_1 does not work with ffmpeg-4.4.3 #63

Closed graysky2 closed 1 year ago

graysky2 commented 1 year ago

Hi John. When I build ffmpeg-4.4.3 for RPi4 using your https://github.com/jc-kynesim/rpi-ffmpeg/tree/dev/4.4/rpi_import_1 branch (git diff n4.4), the resulting executable does not work.

This is trying to playback an HEVC file through vlc:

Assertion !avctx->hwaccel failed at libavcodec/pthread_frame.c:249

However, if I use the identical patch built against ffmpeg-4.4.2, everything works as expected. Any ideas?

graysky2 commented 1 year ago

When I build kodi with ffmpeg-4.4.3 patched as above, it seems to die on the same key error when trying to playback HEVC sample:

2022-12-19 16:53:05.842 T:117158   debug <general>: OnPlayMedia /mnt/media/4k-jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv
2022-12-19 16:53:05.860 T:117158   debug <general>: CPlayerCoreFactory::GetPlayers(/mnt/media/4k-jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv)
2022-12-19 16:53:05.861 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: system rules
2022-12-19 16:53:05.861 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: matches rule: system rules
2022-12-19 16:53:05.861 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: mms/udp
2022-12-19 16:53:05.861 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
2022-12-19 16:53:05.862 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: rtmp
2022-12-19 16:53:05.862 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
2022-12-19 16:53:05.862 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: streams
2022-12-19 16:53:05.862 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: dvd
2022-12-19 16:53:05.862 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: discimage
2022-12-19 16:53:05.863 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
2022-12-19 16:53:05.863 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: nsv
2022-12-19 16:53:05.863 T:117158   debug <general>: CPlayerSelectionRule::GetPlayers: considering rule: radio
2022-12-19 16:53:05.863 T:117158   debug <general>: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
2022-12-19 16:53:05.863 T:117158   debug <general>: CPlayerCoreFactory::GetPlayers: adding videodefaultplayer (VideoPlayer)
2022-12-19 16:53:05.864 T:117158   debug <general>: CPlayerCoreFactory::GetPlayers: for video=true, audio=false
2022-12-19 16:53:05.864 T:117158   debug <general>: CPlayerCoreFactory::GetPlayers: for video=true, audio=true
2022-12-19 16:53:05.864 T:117158   debug <general>: CPlayerCoreFactory::GetPlayers: added 1 players
2022-12-19 16:53:05.879 T:117158   debug <general>: Radio UECP (RDS) Processor - new CDVDRadioRDSData
2022-12-19 16:53:05.879 T:117158   debug <general>: Audio ID3 tag processor - new CVideoPlayerAudioID3
2022-12-19 16:53:05.879 T:117158    info <general>: VideoPlayer::OpenFile: /mnt/media/4k-jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv
2022-12-19 16:53:05.880 T:117307   debug <general>: Thread VideoPlayer start, auto delete: false
2022-12-19 16:53:05.880 T:117158   debug <general>: OnPlayBackStarted: CApplication::OnPlayBackStarted
2022-12-19 16:53:05.881 T:117308   debug <general>: Thread BackgroundLoader start, auto delete: false
2022-12-19 16:53:05.882 T:117307    info <general>: Creating InputStream
2022-12-19 16:53:05.895 T:117281   debug <general>: Loading settings for /mnt/media/4k-jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv
2022-12-19 16:53:05.900 T:117307   debug <general>: ScanForExternalSubtitles: Searching for subtitles...
2022-12-19 16:53:05.900 T:117307   debug <general>: ScanForExternalSubtitles: END (total time: 0 ms)
2022-12-19 16:53:05.900 T:117307    info <general>: Creating Demuxer
2022-12-19 16:53:05.901 T:117158   debug <general>: CVideoGUIInfo::InitCurrentItem(/mnt/media/4k-jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv)
2022-12-19 16:53:05.902 T:117158   debug <general>: CPlayerGUIInfo::InitCurrentItem(/mnt/media/4k-jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv)
2022-12-19 16:53:05.907 T:117307   debug <general>: Open - probing detected format [matroska,webm]
2022-12-19 16:53:05.908 T:117307   debug <general>: Open - avformat_find_stream_info starting
2022-12-19 16:53:05.918 T:117308   debug <general>: Thread BackgroundLoader 545563995456 terminating
2022-12-19 16:53:05.979 T:117307   debug <general>: Open - av_find_stream_info finished
2022-12-19 16:53:05.980 T:117307    info <general>: ffmpeg[0x55bcfa5a70]: Input #0, matroska,webm, from '/mnt/media/4k-jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv':
2022-12-19 16:53:05.980 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:   Metadata:
2022-12-19 16:53:05.980 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:     COMPATIBLE_BRANDS: iso4hvc1iso6
2022-12-19 16:53:05.980 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:     MAJOR_BRAND     : iso4
2022-12-19 16:53:05.980 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:     MINOR_VERSION   : 1
2022-12-19 16:53:05.981 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:     ENCODER         : Lavf56.3.100
2022-12-19 16:53:05.981 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:   Duration: 00:00:30.10, start: 0.067000, bitrate: 119845 kb/s
2022-12-19 16:53:05.981 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:   Stream #0:0(und): Video: hevc (Main 10), yuv420p10le(tv), 3840x2160 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 29.97 tbc (default)
2022-12-19 16:53:05.981 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:     Metadata:
2022-12-19 16:53:05.981 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:       CREATION_TIME   : 2016-02-05 13:00:09
2022-12-19 16:53:05.981 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:       LANGUAGE        : und
2022-12-19 16:53:05.982 T:117307    info <general>: ffmpeg[0x55bcfa5a70]:       HANDLER_NAME    : hevc@GPAC0.5.2-DEV-rev565-g71748d7-ab-suite
2022-12-19 16:53:05.982 T:117307   debug <general>: CDVDDemuxFFmpeg::AddStream ID: 0
2022-12-19 16:53:05.982 T:117307    info <general>: Opening stream: 0 source: 256
2022-12-19 16:53:05.983 T:117307    info <general>: Creating video codec with codec id: 173
2022-12-19 16:53:05.983 T:117307    info <general>: CDVDVideoCodecDRMPRIME::Open - using decoder HEVC (High Efficiency Video Coding)
2022-12-19 16:53:05.983 T:117307   debug <general>: CDVDVideoCodecDRMPRIME::Open - using drm device for av_hwdevice_ctx: /dev/dri/card1
2022-12-19 16:53:05.983 T:117307   debug <general>: ffmpeg[0x55bcfa5a70]: [hevc] Requested frame threading with a custom get_buffer2() implementation which is not marked as thread safe. This is not supported anymore, make your callback thread-safe.
2022-12-19 16:53:05.987 T:117307   debug <general>: ffmpeg[0x55bcfa5a70]: [src] sws_param option is deprecated and ignored
2022-12-19 16:53:05.988 T:117307   error <general>: ffmpeg[0x55bcfa5a70]: Impossible to convert between the formats supported by the filter 'src' and the filter 'auto_scaler_0'
2022-12-19 16:53:05.989 T:117307   error <general>: CDVDVideoCodecDRMPRIME::FilterOpen - avfilter_graph_config:  Function not implemented (-38)
2022-12-19 16:53:05.989 T:117307   debug <general>: CDVDVideoCodecDRMPRIME::FilterTest - no deinterlacing filter found
2022-12-19 16:53:05.990 T:117307   debug <general>: CVideoPlayerVideo::OpenStream - open stream with codec id: 173
2022-12-19 16:53:05.990 T:117307    info <general>: Creating video thread
2022-12-19 16:53:05.991 T:117317   debug <general>: Thread VideoPlayerVideo start, auto delete: false
2022-12-19 16:53:05.991 T:117317    info <general>: running thread: video_thread
2022-12-19 16:53:05.991 T:117317   debug <general>: CVideoPlayerVideo - CDVDMsg::GENERAL_PAUSE: false
2022-12-19 16:53:05.991 T:117307   debug <general>: ReadEditDecisionLists - Checking for edit decision lists (EDL) on local drive or remote share for: /mnt/media/4k-jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv
2022-12-19 16:53:05.992 T:117307   debug <general>: CVideoPlayer::SetCaching - caching state 2
2022-12-19 16:53:05.992 T:117307   debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2022-12-19 16:53:05.992 T:117307   debug <general>: CVideoPlayer::HandleMessages - player 2 reported state: 0
2022-12-19 16:53:05.994 T:117307   debug <general>: CVideoPlayer::SetCaching - caching state 1
2022-12-19 16:53:05.994 T:117307   debug <general>: CDVDClock::SetSpeedAdjust - adjusted:0.000000
2022-12-19 16:53:05.994 T:117317   debug <general>: CVideoPlayerVideo - Stillframe left, switching to normal playback
2022-12-19 16:53:06.002 T:117158   debug <general>: ------ Window Init (DialogBusy.xml) ------
2022-12-19 16:53:06.004 T:117307   debug <general>: CVideoPlayer::CheckContinuity - wrapback :2, prev:133000.000000, curr:0.000000, diff:-133000.000000
2022-12-19 16:53:06.088 T:117309   debug <general>: ffmpeg[0x0]: Assertion !avctx->hwaccel failed at src/libavcodec/pthread_frame.c:249
jc-kynesim commented 1 year ago

Sorry about the delay - pretty sure that is going to be the same assert I've fixed in 5.1.x - I'll get to that soon (hopefully without needing another branch)

graysky2 commented 1 year ago

Thanks John. I will watch for a push to your dev/4.4/rpi_import_1

graysky2 commented 1 year ago

https://github.com/jc-kynesim/rpi-ffmpeg/tree/release/4.4/rpi_import_1

Thanks, worked against 4.4.3 on RPi4.