Page 1 of 1

Recompressed video

Posted: Sun Jan 02, 2022 6:26 pm
by Kwai chang caine
Since several years i use Handbrake for compressing video, it's a merveillous tool for do that and him and me have been happily married for all these years in the most big happyness :lol:

I mainly loved this software, because i have nearly understand how use it (it's not all the days, believe me) :mrgreen:
My only one use for the moment, it's reduce the size of an avi, mkv, etc...and for do that, the 0.9.5 version have a magical cell nommed "TargetSize"

Unfortunately, the developper has decided in all next version to remove this option :|
Numerous persons like me, are lost since this time, and ask the return of this option without success because the developper say it's not precis and not a really good.

https://forum.handbrake.fr/viewtopic.ph ... 2c#p181325

So i always use the old versions of Handbrake, but sometime she can't do the job, surely because the video are too recent.
I had search on the web, and the masters of the videos say the same thing that the developper of Handbrake, but someone give when even half solution for calculate bitrate for have some "acceptables" results.

Calculators of bitrates
https://www.christianwheel.com/post/201 ... calculator
https://www.videohelp.com/software/Vide ... calculator

Or some Formulas
File size (kb) = bitrate(kbps) x running time (s)

Or using FFPROBE and FFMPEG with numerous long formulas that i don't really understand :oops: .

So my questions are :
- Have you already use one of this long formulas of FFMPEG with success ?
- Have you already use FFPROBE for reading video paramaters ?
- Have already calculate the new bitrate of a compressed video ?
- And cherry on the cake, have you a PB code for do a part, or by miracle (let's be crazy for this new year), all the job approxymatively ?

Have a good new year :-)

Re: Recompressed video

Posted: Mon Jan 03, 2022 5:18 am
by BarryG
Apparently VidCoder uses the Handbrake engine and offers a target size option -> https://vidcoder.net/

But according to this thread, it's not reliable to hit the target size either -> https://forum.handbrake.fr/viewtopic.php?f=11&t=38466

Re: Recompressed video

Posted: Mon Jan 03, 2022 5:18 pm
by Kwai chang caine
Hello BarryG :D

You have right, i have also see VideoCoder but not have thinking to talk about it :oops:
The problem is apprently it works on the old versions of Handbrake, because the video i try on it crash, like on the Handbrake old version
However, that works on the new version of Handbrake ...

Yes it's a approximative calculation ...but that works, because all the video i have converted have the good size or at worst 10% more it's acceptable for me :wink:

Thanks for your answer 8)

Re: Recompressed video

Posted: Wed Jan 05, 2022 6:02 pm
by normeus
Kcc,
I use this simple command which works well for me:

Code: Select all

ffmpeg -i "input.mp4" -preset slow -c:v libx264 -crf 28 "output.mp4"
You can adjust "-crf" for better quality sometimes I use 32

there are some nice, good examples here:

https://trac.ffmpeg.org/wiki/Encode/H.264

Norm.

Re: Recompressed video

Posted: Wed Jan 05, 2022 6:50 pm
by Kwai chang caine
Hello NORMEUS :D

I'm happy to find someone who use FFMEG, thanks for the example 8)

So with your options, you don't sure the file size are under "xxx MO" ? :|

I have found a "-fs" (File size) option to FFMPEG but i apparently FFMPEG stop the encoding when the size appears :shock: :|
-fs limit_size (output)
Set the file size limit, expressed in bytes. No further chunk of bytes is written after the limit is exceeded. The size of the output file is slightly more than the requested file size.
https://ffmpeg.org/ffmpeg.html

I have also see for calculate Bitrate this is this formula
bitrate = target file size / duration
And also found this calculator
https://www.increasebroadbandspeed.co.u ... d-duration

For example, i have a video actually "2 050 555 904 octets" for "1h55mn32s = 160 mns"
if i whant to compress it in "700 000 000 octets = 0.7 GB" i must use a bitrate of
0.7 / 160 = 0.8 Mbps

This same file with a bitrate of
1/ 0.48 Mbps ==> 546 380 ko
2/ 0.6 Mbps ==> 647 877 Ko

And i try now for 0.8 Mbps for see the result :wink: