Discussion:
h.264 v h.265 conversion
(too old to reply)
Alan Browne
2019-09-15 21:08:53 UTC
Permalink
Converting an .avi file, about 700 MB to .mp4 on a 2012 iMac (i7) using
HEVC (h.265). MacOS10.14.

It's slow. 640x480 h.265-10 bit is going about 35 .. 45 frames per sec
on conversion. (Handbrake CLI).

4 cores @ near 100%, 4 HT VC's at about 50%.
(Using ram disk for read and write).

Has anyone tried this on more recent Macs?

What sort of performance are you getting? What model Mac?
--
"Even with the brain dead, the pig's heart keeps on beating...
sort of like ... pick a Kardashian."
-Anthony Bourdain, Parts Unknown
Lewis
2019-09-16 03:53:17 UTC
Permalink
Post by Alan Browne
Converting an .avi file, about 700 MB to .mp4 on a 2012 iMac (i7) using
HEVC (h.265). MacOS10.14.
It's slow. 640x480 h.265-10 bit is going about 35 .. 45 frames per sec
on conversion. (Handbrake CLI).
(Using ram disk for read and write).
A lot of the speed depends on the quality of the source. Also, I would
say it is really not worth using 5.265 on a file that small, especially
since you are just reconverting an already crappy source.
Post by Alan Browne
Has anyone tried this on more recent Macs?
I am about to convert a 34GB movie to h.265, just haven't quite started
yet.
Post by Alan Browne
What sort of performance are you getting? What model Mac?
The best performance for h.265 AFAIK is a crappy PC with a nvidia 950
in it using Handbrak HVENC and that will do 100-140fps. I did this for
Blade Runner 2049 last year.
--
But of course there were the rules. Everyone knew there were rules. They
just had to hope like Hell that the gods knew the rules, too.
Alan Browne
2019-09-16 13:24:26 UTC
Permalink
Post by Lewis
Post by Alan Browne
Converting an .avi file, about 700 MB to .mp4 on a 2012 iMac (i7) using
HEVC (h.265). MacOS10.14.
It's slow. 640x480 h.265-10 bit is going about 35 .. 45 frames per sec
on conversion. (Handbrake CLI).
(Using ram disk for read and write).
A lot of the speed depends on the quality of the source. Also, I would
say it is really not worth using 5.265 on a file that small, especially
since you are just reconverting an already crappy source.
The video quality in most of these is very nice, actually. Crisp, clear,
low noise. So the 'worth' is comes down to content which is very personal.

The outcome is a file about 18% smaller than h.264 with a result (on
screen) that is the same AFAICT.

Finally, going forward, Quick Time Player 7 won't be supported on the
next OS. Quick Time Player, OTOH won't play .avi directly w/o
"converting" which (of course) takes some time... no telling if the new
OS version will play .avi's directly. (Yes, they'll play h.264...).

So it comes down to equal quality in less space.
Post by Lewis
Post by Alan Browne
Has anyone tried this on more recent Macs?
I am about to convert a 34GB movie to h.265, just haven't quite started
yet.
Post by Alan Browne
What sort of performance are you getting? What model Mac?
The best performance for h.265 AFAIK is a crappy PC with a nvidia 950
in it using Handbrak HVENC and that will do 100-140fps. I did this for
Blade Runner 2049 last year.
I have no need to buy yet another computer. I'll probably be getting a
new iMac next year, however. bje's remarks refer (T2).

Come to think of it, my son's PC is downstairs unused - maybe I'll dig
that up...
--
"Even with the brain dead, the pig's heart keeps on beating...
sort of like ... pick a Kardashian."
-Anthony Bourdain, Parts Unknown
Lewis
2019-09-16 18:37:31 UTC
Permalink
Post by Alan Browne
Finally, going forward, Quick Time Player 7 won't be supported on the
next OS. Quick Time Player, OTOH won't play .avi directly w/o
"converting" which (of course) takes some time... no telling if the new
OS version will play .avi's directly. (Yes, they'll play h.264...).
There are many ways to play avi files, and avi is a just a shitty
container. The video inside is probably MPEG-2 or MPEG-4 (h.264).
Post by Alan Browne
So it comes down to equal quality in less space.
Very little less space though. A $50 1TB drive will hold 1500 700MB
files. Is it worth the time to be able to stick another 200 700MB files
on the drive? I don't think it is.

What I use h.265 for is very large files where I am saving 50-90% (my
encode of Blade Runner 2049 is... 13GB and the Blu-Ray file was
53GB IIRC.

I converted some MPEG-2 files of 1970s TV which dropped from 4.4GB per
file to 800-950MB per file.

Saving 10-20% isn't worth the time for me.
Post by Alan Browne
Post by Lewis
Post by Alan Browne
Has anyone tried this on more recent Macs?
I am about to convert a 34GB movie to h.265, just haven't quite started
yet.
Post by Alan Browne
What sort of performance are you getting? What model Mac?
The best performance for h.265 AFAIK is a crappy PC with a nvidia 950
in it using Handbrak HVENC and that will do 100-140fps. I did this for
Blade Runner 2049 last year.
I have no need to buy yet another computer. I'll probably be getting a
new iMac next year, however. bje's remarks refer (T2).
Well, the computer I used was several years old (maybe 10) and didn't
cost anything. The 950 was a card that was replaced on another machine
(the Wintendo), so also didn't cost anything.
Post by Alan Browne
Come to think of it, my son's PC is downstairs unused - maybe I'll dig
that up...
If it has a 900-series or newer video card nvenc in Handbrake is bonkers
fast. I think there are earlier cards that have the h.265 hardware, but
I am not sure since I had the 950.

(the 1070 and 2060 are basically the same speed as the 950 since the
hardware encoder didn't really change).
--
I loved you when our love was blessed I love you now there's nothing
left But sorrow and a sense of overtime
nospam
2019-09-16 19:12:53 UTC
Permalink
Post by Lewis
Post by Alan Browne
So it comes down to equal quality in less space.
Very little less space though. A $50 1TB drive will hold 1500 700MB
files. Is it worth the time to be able to stick another 200 700MB files
on the drive? I don't think it is.
8 tb drives are currently ~$100-150.
Lewis
2019-09-16 20:32:16 UTC
Permalink
Post by Lewis
(the 1070 and 2060 are basically the same speed as the 950 since the
hardware encoder didn't really change).
2018 Mac mini i7 6 core

 % ffmpeg -i 4K-sample.mkv -c:v hevc_videotoolbox -vtag hvc1 4K-265.mkv
==> fps= 45

(this is a true 4K file encoded in h.264, I did not complete the
conversion)

 % ffmpeg -i HD-sample.mkv -c:v hevc_videotoolbox -vtag hvc1 HD-265.mkv
==> fps=188

(this is a 1080p HD file encoded in h.265, file size reduced from 2.7GB
to 980MB with no apparent reduction in quality)


 % ffmpeg -i sample.mkv -c:v hevc_videotoolbox -vtag hvc1 265.mkv
==> fps=481

SD video from TV/DVD source, 1990s era h.264. File from 365MB to 128.8MB
--
sometimes ascii is the best use of bandwidth... Tonya Engst
Alan Browne
2019-09-16 20:36:58 UTC
Permalink
Post by Lewis
Post by Alan Browne
Finally, going forward, Quick Time Player 7 won't be supported on the
next OS. Quick Time Player, OTOH won't play .avi directly w/o
"converting" which (of course) takes some time... no telling if the new
OS version will play .avi's directly. (Yes, they'll play h.264...).
There are many ways to play avi files, and avi is a just a shitty
container. The video inside is probably MPEG-2 or MPEG-4 (h.264).
Another reason to convert to .MP4 that I forgot to mention was AppleTV.
Won't play them (at least via iTunes). I don't think I can load them
onto my iPhone either (not that I do much of that...)
Post by Lewis
Post by Alan Browne
So it comes down to equal quality in less space.
Very little less space though. A $50 1TB drive will hold 1500 700MB
files. Is it worth the time to be able to stick another 200 700MB files
on the drive? I don't think it is.
What I use h.265 for is very large files where I am saving 50-90% (my
encode of Blade Runner 2049 is... 13GB and the Blu-Ray file was
53GB IIRC.
I converted some MPEG-2 files of 1970s TV which dropped from 4.4GB per
file to 800-950MB per file.
Saving 10-20% isn't worth the time for me.
I've automated it, so it's just background. I'm just looking for a way
to make the h.265 quicker if possible.
Post by Lewis
Post by Alan Browne
Post by Lewis
Post by Alan Browne
Has anyone tried this on more recent Macs?
I am about to convert a 34GB movie to h.265, just haven't quite started
yet.
Post by Alan Browne
What sort of performance are you getting? What model Mac?
The best performance for h.265 AFAIK is a crappy PC with a nvidia 950
in it using Handbrak HVENC and that will do 100-140fps. I did this for
Blade Runner 2049 last year.
I have no need to buy yet another computer. I'll probably be getting a
new iMac next year, however. bje's remarks refer (T2).
Well, the computer I used was several years old (maybe 10) and didn't
cost anything. The 950 was a card that was replaced on another machine
(the Wintendo), so also didn't cost anything.
Post by Alan Browne
Come to think of it, my son's PC is downstairs unused - maybe I'll dig
that up...
If it has a 900-series or newer video card nvenc in Handbrake is bonkers
fast. I think there are earlier cards that have the h.265 hardware, but
I am not sure since I had the 950.
I'll look into it. He bought that PC about 2 years ago so there's a chance.
--
"Even with the brain dead, the pig's heart keeps on beating...
sort of like ... pick a Kardashian."
-Anthony Bourdain, Parts Unknown
JF Mezei
2019-09-16 18:49:51 UTC
Permalink
Post by Alan Browne
So it comes down to equal quality in less space.
At the cost of greater CPU not only to encode, but also play.

My Powermac G3 with OS-X ended up not being able to play iTunes movies
and other videos when they switched to h.264 since it didn,t have the
"oumph" to play the videos live. For non DRM stuff, I would convert it
to older codec and play them. But DRM stuff from iTunes was not playable.

H.265 has similar issues with older machines. It takes much more power
to decode, especially now that movies are 1080 or 4K. (especially if CPU
then has to scale the 4K down to fit a 1080 TV).

If your hardware is currently able to play H.265 fine, then you're ok.
Justy be aware that if your distribute your movies to people who have
older machines, they may have problems playing it smoothly.

Similarly, there are now many movies encoded with some new AC3 audio
codec. But people don't realise that not every stereo supports this, so
those movies need to be converted before being played so you can get the
DOlby 5.1 sound. Stereos tend to last a lot longer than PCs.
b***@ripco.com
2019-09-16 11:17:09 UTC
Permalink
Post by Alan Browne
Converting an .avi file, about 700 MB to .mp4 on a 2012 iMac (i7) using
HEVC (h.265). MacOS10.14.
It's slow. 640x480 h.265-10 bit is going about 35 .. 45 frames per sec
on conversion. (Handbrake CLI).
(Using ram disk for read and write).
Has anyone tried this on more recent Macs?
What sort of performance are you getting? What model Mac?
I don't have one but the correct answer from this article appears to be a
2019 model with the T2 chip in it.

https://appleinsider.com/articles/19/04/09/apples-t2-chip-makes-a-giant-difference-in-video-encoding-for-most-users

Although Apple started to support their "VideoToolbox" since osx 8 (i guess)
and Handbrake 1.2.x since last december, I never seen it in action. Your
numbers (fps) are about par for the course. It might be there but doesn't
seem to make any difference.

Lewis's followup has the correct answer though, a cheapo PC with a half-ass
video card will run rings around the Macs without the T2 in it. Those cards
have hardware (GPU) which can be used for encoding/decoding with blazingly
fast frame rates.

They used to use those to mine bitcoin which require tens of millions of math
calculations per second. Using cpu mining at best you could get around
25,000 to 30,000 hashes per second, using a GPU, into the millions per
second on the same machine.

-bruce
***@ripco.com
b***@ripco.com
2019-09-16 12:21:21 UTC
Permalink
Post by Alan Browne
It's slow. 640x480 h.265-10 bit is going about 35 .. 45 frames per sec
on conversion. (Handbrake CLI).
Yes I'm back.

I used to do what you are doing, alot. But with most media players and even
the smart tv's with usb ports can play anything you throw at them, all this
seems so 1990's.

Anyway, doing a totally non-scientific test, the current version of ffmpeg
seems to do a better frame rate than you were getting with Handbrake.

If you have the stomach for command line stuff (Terminal) and download the
static version (ffmpeg-94911-g197985c5bf.7z) from ffmpeg.org (the static
version has everything built-in rather than adding libraries that could muck
up other stuff) and put a copy of the .avi in the same directory where
ffmpeg unpacked, then this:

./ffmpeg -i filename.avi filename.mp4

will convert the .avi to a h264 format at around 90~100 fps.

./ffmpeg -i filename.avi filename.mkv

will convert the .avi to h265 format at a slightly less rate (still around
90fps).

Both took about half an hour for a 1GB avi file. Not breaking any speed
records but not bad.

If it doesn't come out as expected, ffmpeg does have more command line
options than stars in the sky and if you think you have to use them, just
use Handbrake and let it run overnight. That program will drive you nuts.

I have a similar mac as yours (mini with i7, 4 cores with the 4 fake ones)
so the results should be similar.

Only word of caution, if the filename has spaces in it, use "" around it, so
something like:

./ffmpeg -i "file name.avi" "file name.mkv"

Of course if you were looking to get a new mac, ignore this message.

-bruce
***@ripco.com
Alan Browne
2019-09-16 13:30:26 UTC
Permalink
Post by b***@ripco.com
Post by Alan Browne
It's slow. 640x480 h.265-10 bit is going about 35 .. 45 frames per sec
on conversion. (Handbrake CLI).
Yes I'm back.
I used to do what you are doing, alot. But with most media players and even
the smart tv's with usb ports can play anything you throw at them, all this
seems so 1990's.
Anyway, doing a totally non-scientific test, the current version of ffmpeg
seems to do a better frame rate than you were getting with Handbrake.
If you have the stomach for command line stuff (Terminal) and download the
<S>

I've been using HB in CLI mode for the above in any case, and well aware
of the need for " on filenames that have spaces in them. Thx anyway!

With HB CLI it seemed to get "equivalent" quality w/o adding any
parameters. It's not clear to me if it's using HB (GUI v.) settings or
defaults to an equivalent quality if no other parameters are given...

Not sure how ffmpeg would do that wrt quality w/o a long learning curve.

Also been using ffmpeg to concatenate .wmv files and wrote a small
program to semi automate that process (it's not pretty).
--
"Even with the brain dead, the pig's heart keeps on beating...
sort of like ... pick a Kardashian."
-Anthony Bourdain, Parts Unknown
JF Mezei
2019-09-16 18:56:21 UTC
Permalink
Post by Alan Browne
I've been using HB in CLI mode for the above in any case, and well aware
of the need for " on filenames that have spaces in them. Thx anyway!
Note that Handbrake is using ffmepg libraries under the hood, but has
more limited options.

Good comparison of the two:
https://www.winxdvd.com/resource/handbrake-ffmpeg.htm
Alan Browne
2019-09-16 20:40:12 UTC
Permalink
Post by JF Mezei
Post by Alan Browne
I've been using HB in CLI mode for the above in any case, and well aware
of the need for " on filenames that have spaces in them. Thx anyway!
Note that Handbrake is using ffmepg libraries under the hood
Only for lower quality conversions if the user wants such.
--
"Even with the brain dead, the pig's heart keeps on beating...
sort of like ... pick a Kardashian."
-Anthony Bourdain, Parts Unknown
Loading...