Amd amf hardware encoder and libvpx 1.7.0


#1

latest ffmpeg has now the hardware amd amf encoder hevc_amf and h264_amf and there is a update to vp8/vp9 codec that includes alot of optimizations, am unsure which the current shotcut uses but newer versions of libvpx since 1.6.1 included multi-threading which is pointless not to include in a video editing application…


http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=9ea6607d294526688ab1b1342cb36ee159683e88


#2

The latest release of Shotcut (18.01.02) uses FFMpeg version 3.2.0. We update it from time to time when there is a compelling reason do to so, but not with every release so that we can maintain some level of stability.

Shotcut has supported multi-threading encoding for years. On the “Export” panel, click on the “Codec” tab and set the “Codec threads” to whatever you like. The default is “0” which will cause Shotcut to automatically select the number of threads (usually equal to the number of processors).


#3

if you use the vp9 codec, it requires at lest 1.6.1 to get efficient multi-threading with the row-mt option


#4

Shotcut always includes the latest version of libvpx at the time it is built. Are you sure that Shotcut does not already include the version of libvpx that you are looking for?


#5

am unsure what am doing wrong, here is my export profile for vp9

its still using 24% when i use libvpx with row-mt enabled it does ~80%

“Currently, the improved MT encoder works in 1-pass/2-pass good quality mode encoding at speed 0, 1, 2, 3 and 4 and row-mt=1 must be enabled”

quality=good
row-mt=1
cpu-used=3
minrate=2000k
maxrate=3000k
rc_lookahead=16
tile-columns=6
auto-alt-ref=1
lag-in-frames=25
aq-mode=0
kf_max_dist=128
f=matroska
acodec=flac
ar=48000
ab=384k
vcodec=libvpx-vp9
vb=2800k
g=240
bf=2
width=1280
height=720
aspect=1.77778
progressive=1
top_field_first=2
deinterlace_method=yadif
rescale=hyper
r=23.81
threads=16
pass=1


#6

Do you get the results you expect when you use the latest version of FFMpeg/libvpx directly (not using Shotcut)?

An interesting experiment would be:

  1. Run a test using latest FFMpeg/libvpx
  2. Run a test using the FFMpeg/libvpx included in the Shotcut package
  3. Compare results.

#7

heh ffmpeg 3.2 is ~2 years old and the commit for row-mt is 3th of march 2017
https://patchwork.ffmpeg.org/patch/2745/

also can you look into why “pix_fmt=yuv420p” does not apply when saving it in a export profile? everytime i have to manually do it, its soo annoying here is my workflow until shotcut gets a modern ffmpeg version

  1. edit in shotcut
  2. export via profile to 1080p y4m yuv4mpegpipe wrapped_avframe (pix_fmt=yuv420p)
  3. encode with libvpx
    ./vpxenc.exe -w 1920 -h 1080 --row-mt=1 --tile-columns=6 --auto-alt-ref=1 --lag-in-frames=25 --aq-mode=0 --threads=16 --target-bitrate=3000 --cpu-used=0 -o test.webm workfile.y4m

#8

Oh. I see what I was missing. I didn’t realize that a new parameter was required in FFMpeg. I assumed that the new feature you were looking for would be used automatically by libvpx regardless of what FFMpeg version was calling it. Sorry for the goose hunt.

A couple of suggestions for you:

  • Check that the change you are looking for is in FFMpeg 3.4 (That is the version we would probably go to next)
  • Try the same command as above, only using FFMpeg instead of vpxenc.exe.

That way you will know for sure that when Shotcut gets an upgraded FFMpeg it will work the way you want.


#9

will try the command when i feel better (sick atm)


#10

FYI: I submitted a patch to upgrade FFmpeg to 3.4:

Apparently there are some issues on Windows that need to be resolved before it can be accepted.


#11

funny question how do i use AVoptions? aka libvpx options in ffmpeg?
i dont use ffmpeg that much to really know my way around it


#12

There is option information here:
http://ffmpeg.org/ffmpeg-codecs.html#Options-23

Looks like these commands would be helpful:

ffmpeg -h encoder=libvpx
ffmpeg -h encoder=libvpx-vp9
vpxenc --help

#13

well i know that but how do i pass the args to libvpx from ffmpeg when i try --row-mt=1 it just says invalid argument, am missing some argument to do that


#14

in FFmpeg, you would specify the option like this:

-row-mt 1


#15

tried this on zeranoe ffmpeg 3.4.1 no good, probobly something wrong with cli
ffmpeg.exe -i "test.mkv" -vcodec libvpx-vp9 -row-mt 1 -tile-columns 6 -auto-alt-ref 1 -lag-in-frames 25 -aq-mode 0 -threads 16 -target-bitrate 3000k -cpu-used 0 -acodec libopus test_out.mkv


#16

heh found out why

ffmpeg 3.4 needs libvpx 1.7.0 and zaereno dont have it heh

latest git zeaneo ffmpeg build has both
ffmpeg.exe -i "test.mkv" -vcodec libvpx-vp9 -row-mt 1 -tile-columns 6 -auto-alt-ref 1 -lag-in-frames 25 -aq-mode 0 -threads 16 -cpu-used 0 -b:v 3000k -acodec libopus test_out.mkv


#17

any shotcut windows build i can test?


#18

There is a daily build here that you can test:
http://build.mltframework.org/viewLog.html?guest=1&buildId=55608&tab=artifacts&buildTypeId=bt43


#19

I just want to thank the team for getting hardware encoding (AMD) working in the latest release! Fantastic. So quick. Shotcut is definitely, steadily getting more awesome every time I revisit it. I hope more people will check it out and get past the learning curve. Much appreciated.

I couldn’t find a lot of forum topics on this, but I bookmarked this a while long ago, so my thanks will be put here (hope the bump isn’t too disturbing, maybe it will let anyone watching this topic that the feature is now implemented).