#7272(undetermined:new): encoding with hevc_amf results in video where forwarting is a mess
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Type: defect Status: new | Priority: important Component: | Version: undetermined | unspecified Keywords: hevc_amf | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Hi, I recode videos on nvidia and AMD cards in x265. The nvidia output is nice and ok (in example for ref). The AMD output looks OK. But you can not fast forward in it. It uses 100% CPU and needs minutes. The funny thing is that for the nvidia compile I used an old version of ffmpeg and for the amd I used the newest version. Are there missing parameters by the AMD ffmpeg command or is it a bug with compiling with hevc_amf? EXAMPLETIME ----------- For example I have cut a 3 minute video and compiled it both ways. Original clip: https://sheepchen.net/nextcloud/index.php/s/Nku5EUrTZ37BzAo ENC NVIDIA (good): https://sheepchen.net/nextcloud/index.php/s/RJCXZzsIJBOWVK7 ENC AMD (bad): https://sheepchen.net/nextcloud/index.php/s/e61XOfrHxpghwwf EXAMPLE NVIDIA:
\ffmpeg_20170827\bin\ffmpeg.exe -hwaccel cuvid -i "s:\temp\in_orig.mkv" -c:v hevc_nvenc -profile:v main -rc vbr_hq -qmin 18 -qmax 24 -b:v 1000k -maxrate 3000k -preset slow -rc-lookahead 32 -g 250 -c:a copy -c:s copy -map 0 "s:\temp\out_nvidia.mkv"
ffmpeg version N-87095-gef0c6d9 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 7.1.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-cuda --enable- cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable- libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable- libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib libavutil 55. 74.100 / 55. 74.100 libavcodec 57.103.101 / 57.103.101 libavformat 57. 78.100 / 57. 78.100 libavdevice 57. 8.100 / 57. 8.100 libavfilter 6.100.100 / 6.100.100 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 Input #0, matroska,webm, from 's:\temp\in_orig.mkv': Metadata: ENCODER : Lavf57.71.100 Duration: 00:01:00.00, start: 0.080000, bitrate: 12347 kb/s Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default) Metadata: DURATION : 00:01:00.000000000 Stream #0:1(ger): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: DURATION : 00:00:59.952000000 Stream #0:2: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s (default) Metadata: DURATION : 00:00:59.952000000 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc)) Stream #0:1 -> #0:1 (copy) Stream #0:2 -> #0:2 (copy) Press [q] to stop, [?] for help Output #0, matroska, to 's:\temp\out_nvidia.mkv': Metadata: encoder : Lavf57.78.100 Stream #0:0: Video: hevc (hevc_nvenc) (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=18-24, 1000 kb/s, 25 fps, 1k tbn, 25 tbc (default) Metadata: DURATION : 00:01:00.000000000 encoder : Lavc57.103.101 hevc_nvenc Side data: cpb: bitrate max/min/avg: 3000000/0/1000000 buffer size: 2000000 vbv_delay: -1 Stream #0:1(ger): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: DURATION : 00:00:59.952000000 Stream #0:2: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 448 kb/s (default) Metadata: DURATION : 00:00:59.952000000 % EXAMPLE AMD:
\ffmpeg-20180619\bin\ffmpeg.exe -hwaccel dxva2 -i "s:\temp\in_orig.mkv" -c:v hevc_amf -profile:v main -qmin 18 -qmax 24 -b:v 1000k -maxrate 3000k -rc-lookahead 32 -g 250 -c:a copy -c:s copy -map 0 "s:\temp\out_amd.mkv"
ffmpeg version N-91330-ga990184007 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 7.3.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable- bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable- libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable- libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable- nvenc --enable-nvdec --enable-dxva2 --enable-avisynth libavutil 56. 18.102 / 56. 18.102 libavcodec 58. 20.103 / 58. 20.103 libavformat 58. 17.100 / 58. 17.100 libavdevice 58. 4.101 / 58. 4.101 libavfilter 7. 25.100 / 7. 25.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 libpostproc 55. 2.100 / 55. 2.100 Input #0, matroska,webm, from 's:\temp\in_orig.mkv': Metadata: ENCODER : Lavf57.71.100 Duration: 00:01:00.00, start: 0.080000, bitrate: 12347 kb/s Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default) Metadata: DURATION : 00:01:00.000000000 Stream #0:1(ger): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: DURATION : 00:00:59.952000000 Stream #0:2: Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s (default) Metadata: DURATION : 00:00:59.952000000 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_amf)) Stream #0:1 -> #0:1 (copy) Stream #0:2 -> #0:2 (copy) Press [q] to stop, [?] for help Output #0, matroska, to 's:\temp\out_amd.mkv': Metadata: encoder : Lavf58.17.100 Stream #0:0: Video: hevc (hevc_amf), nv12, 1920x1080 [SAR 1:1 DAR 16:9], q=18-24, 1000 kb/s, 25 fps, 1k tbn, 25 tbc (default) Metadata: DURATION : 00:01:00.000000000 encoder : Lavc58.20.103 hevc_amf Stream #0:1(ger): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: DURATION : 00:00:59.952000000 Stream #0:2: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 448 kb/s (default) Metadata: DURATION : 00:00:59.952000000 % -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Changes (by cehoyos): * priority: important => normal -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by AlexisMay): hello Fast forwarding on AMD output is slow because it is not even using gpu acceleration on latest hardware for playback that means cpu slowing everything down. Inspecting clip with ffmpeg reports : '''track 1: codec frame size is not set'''. maybe is it related to that? how can we fix this? -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by sheepchen): Hi, The recoding using the GPU (80% load on GPU and fast.. definily using GPU chip). The playback from both clips is on the AMD Ryzen 5 (with internal Vega 11 GPU). The Video that was encoded using the NVIDIA has no problems (playback on AMD). The video that was encoded on the AMD has slow forwarting on AMD and Intel CPUs. Playback in all 4 instances (INTEL, AMD CPU and NVIDIA, VEGA encoded video) was with VLC. The problem is definitly by encoding with AMD hardware acceleration. How can I set the codec frame size? Then I try it.. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by AlexisMay): hi thanks for the sample clips. could you transcode the clip once again but with -c:v h264_amf parameter to see if it is h264 or just hevc related? -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by sheepchen): Hi, here a reupload of the x265 command: https://sheepchen.net/nextcloud/index.php/s/Fy8Kk8ZYlJgc0Br here the x264 command: https://sheepchen.net/nextcloud/index.php/s/LH2j8ugitFw89W2 here the x264 file: https://sheepchen.net/nextcloud/index.php/s/HcYsFBBc7sO3moa The x264 file has no problem by fast forwarting. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by mmironov): I reproduced the problem. It appeared that AMD HEVC encoder has an additional parameter that controls frequency of IDR frames. And in turn IDRs are needed to indicate key frames used in seek. Please add "-gops_per_idr 1" to your command line. It will write IDR on every GOP. Maybe, it makes sense to change ffmpeg AMF default value from 60 to 1. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by mmironov): I reproduced the problem. It appeared that AMD HEVC encoder has an additional parameter that controls frequency of IDR frames. And in turn IDRs are needed to indicate key frames used in seek. Please add "-gops_per_idr 1" to your command line. It will write IDR on every GOP. Maybe, it makes sense to change ffmpeg AMF default value from 60 to 1. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: new Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by AlexisMay): hi sheepchen could you reupload hevc clip with -gops_per_idr 1 enabled? -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: closed Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: fixed Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Changes (by sheepchen): * status: new => closed * resolution: => fixed Comment: Yes, this solved the problem! Thanks! Here is the command: ffmpeg.exe -hwaccel dxva2 -i <inputfile> -c:v hevc_amf -gops_per_idr 1 -profile:v main -qmin 18 -qmax 24 -b:v 1000k -maxrate 3000k -rc-lookahead 32 -g 250 -c:a copy -c:s copy -map 0 <outputfile> Here is the command output: https://sheepchen.net/nextcloud/index.php/s/n7Y85DfDRkotQX5 And here is the encoded videofile: https://sheepchen.net/nextcloud/index.php/s/HGoovTtsqOlJCvP -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:9> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: reopened Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Changes (by cehoyos): * status: closed => reopened * resolution: fixed => Comment: Either there never was an issue or this can still be improved, it was not fixed. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:10> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: reopened Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by sheepchen): ok, right. It would be nice if ffmpeg use the default value "-gops_per_idr 1" if hevc_amf is used and no other value of gops_per_idr is set. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:11> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: reopened Priority: normal | Component: Version: unspecified | undetermined Keywords: hevc_amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Comment (by AlexisMay): well i am on macOS High Sierra 10.13 which introduced native hardware accelerated playback of hevc media files and this clip when further transcoded with -c:v copy -c:a aac -tag:v hvc1 still doesnt seek very well. so what further settings should be enabled? -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:12> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: reopened Priority: normal | Component: Version: unspecified | undetermined Keywords: amf | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Changes (by cehoyos): * keywords: hevc_amf => amf -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:13> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: reopened Priority: normal | Component: | undetermined Version: unspecified | Resolution: Keywords: amf | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by cornofear): * cc: cornofear@… (added) Comment: As of git-2020-05-19-74dfc88 the default gops_per_idr is still 60 rather than 1. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:14> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess -------------------------------------+------------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: closed Priority: normal | Component: | undetermined Version: unspecified | Resolution: fixed Keywords: amf | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by cus): * status: reopened => closed * resolution: => fixed Comment: Fixed in 76a3ee996bf9f3435b1c11d69639cd1e971f20c3. -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:15> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#7272: encoding with hevc_amf results in video where forwarting is a mess ------------------------------------+----------------------------------- Reporter: sheepchen | Owner: Type: defect | Status: closed Priority: normal | Component: avcodec Version: git-master | Resolution: fixed Keywords: amf | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Changes (by cehoyos): * version: unspecified => git-master * component: undetermined => avcodec -- Ticket URL: <https://trac.ffmpeg.org/ticket/7272#comment:16> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg