lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
544 stars 25 forks source link

AMD Video Coding Engine vs. Apple VideoToolbox #88

Closed hisaac closed 3 years ago

hisaac commented 3 years ago

Just a quick question here, what are the differences in using AMD Video Coding Engine vs. Apple VideoToolbox when transcoding using these tools?

hisaac commented 3 years ago

The main reason I ask is, I decided to try transcoding something using my Windows machine which has a Radeon video card, and it's taking FAR longer than it ever has when using my Mac. I'm not sure if that's expected, and if it is, I'm not sure if it's worth it.

The output also looks strange. Here's a video of what's being output to the terminal during the transcode: https://twitter.com/hisaac/status/1342327936758796289?s=21

lisamelton commented 3 years ago

@hisaac Unfortunately I don't actually have access to an AMD-based video card in my Windows PC so I can't definitely say what either the quality or speed are like.

However it's generally agreed among home transcoders and gaming streamers that the quality hierarchy for hardware video encoders is that Nvidia Nvenc is slightly better than Intel QSV and both are noticeably better than AMD. Also, Nvidia Nvenc is clearly the fastest.

When using the Apple VideoToolbox on Macs with an Intel CPU you're, as near as I can tell, using the Intel QSV encoder. Although it's unclear which ratecontrol system VideoToolbox is selecting. So you might be able to get slightly better quality on a Windows PC.

For Macs with the new M1 processor... I have no idea what hardware encoder Apple is using. Maybe their own? Maybe something licensed. VideoToolbox is just black box that way.

Is that output that you posed on Twitter from ffmpeg or something?

hisaac commented 3 years ago

Thanks for the info @donmelton.

I'm not actually sure what the output is from. It started when I ran the command

other_video_transcoding --hevc C:\path\to\video.mkv

Whatever it's from, it's been running for many hours. The computer's fan also isn't spinning up, so I'm starting to feel skeptical that it's actually doing anything.

lisamelton commented 3 years ago

@hisaac Hopefully you used other-transcode and not other_video_transcoding. The later name if for the Gem itself which shouldn't be executable.

Also, it's entirely possible that your AMD GPU cannot generate HEVC output. Have you tried it without the --hevc option?

hisaac commented 3 years ago

heh, I'm on my phone at the moment, but I'll verify the exact command I ran when I get to my computer again.

I think I'll cancel this encode and do a little more experimentation to see what's going on. I didn't realize outputting HVEC could be hardware-dependent.

lisamelton commented 3 years ago

@hisaac Yes, not all hardware encoders have the ability to output HEVC. Some which don't have that capability in hardware will fall back to encoding with software. That's the case with some older Macs when using VideoToolbox. I don't know whether the AMD library used in ffmpeg will do something similar or not.

hisaac commented 3 years ago

OK, I confirmed that the command I used was other-transcode not other_video_transcoding. It does appear to have done some transcoding, but only the first few minutes after hours of processing.

If you're curious, here is the output log: _ffmpeg_13186_17244.mkv.log

For now, I think I'll just stick to using my Mac for transcoding. I don't really have the time to dig into trying to get this working on my Windows box right now, and it sounds like there might not be much benefit anyway. Thanks for the info!