Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have basically the same 1 hour videos in 2 files. One is ~4G each, the other is ~400M. Now there's issues with some of the ~400M, (10 of them), but I don't want to store 40G to replace ~4G, as you might imagine. I ran ffprobe on them and have the data.
First off, the resolutions are different. The top one is full HD - 1920x1080, the other is 720x402 which is roughly 9 times smaller, so that'll explain why the files are nearly 10 times smaller. Remember that bitrate is the rate that the data needs to be transferred to create the image, so, again, I'd expect the bitrate of the full HD stream to be roughly 10x
Quote:
Originally Posted by business_kid
The bitrate leaped out at me as wildly different. What's an acceptable bitrate? Is there anything else I can change without junking quality?
Define "quality", it's all personally subjective. If you're looking at a 60" 8K display then you might want the full HD version, and even then it's going to be upscaled 16x so might appear "blocky", if you're looking on a laptop or non ego-boosting TV then you might find the other resolution is acceptable.
For what it's worth, 720x402 is pretty close to 720x480 wich was the standard resolution for NTSC DVD (PAL, as used in Ireland/UK was 720x576)
Any of these encodings is "lossy", if you can't tell the difference on your normal use case then keep the smaller ones. If you can see the difference then try re-encoding with different settings until you find a balance you're happy with.
Thanks for the reply. I'm funny with quality. Having grown up in the days when tvs had a "405/625" switch, you got used to what you had. Yes, the smaller one is grainier. I have a 1920×1080@60Hz setup. But once I'm 5 minutes into something, I forget about the quality, unless it's really bad. I never felt the need for 4K, never mind 8K.
With that information, I can probably resize the big one to 1280×720 which will give me a fairly decent size reduction. The standard for PAL was 625 vertical lines but if you exclude the invisible lines and flyback time, you could be left with 576 lines. I left all that behind in the 1970s and went into research. Secam had even more vertical lines (819?).
Last edited by business_kid; 08-20-2022 at 02:44 PM.
Is there anything else I can change without junking quality?
Yes, but it will work only if you have an nvidia video card and a stable driver version (XXX.YY version style): use NVENC. I have a custom preset for Handbrake for NVENC and it works like a charm: https://i.imgur.com/1sjDIWM.png With this setting a 50 GB UHD movie becomes ~ 7.5 GB FullHD with the same quality as its H264 original counterpart, all in 20 minutes of time.
I have downloaded and converted all the episodes of Supergirl which originally were ~4 GB each with an excessively high H264 video bitrate, often more than 12 Mbps. H264 is an ancient and incompetent codec, so I'm not surprised it needs such amounts of bitrate for quality image. I made them with H265 and bitrate ~4600 Kbps. The size dropped almost twice but the quality remained the same. https://i.imgur.com/cFdGlP6.png
One other suggestion is ffmpeg. It can easily convert codecs, handles h264 easily, and can export it as h265 with the proper codecs installed on your system. Just my
The conversion took 23 minutes using 850% - 1100% cpu. There is zero loss of quality, it seems in that conversion. Interestingly, ffmpeg only had one process using multiple threads, so it bespeaks some very elegant programming.
Try '-preset veryslow'. It'll give you improved and "smoother" visual quality. Default is medium. Expense is more CPU time.
If you want to push shrinking it little bit more, try '-crf x'. By default, x is 23. The working range is from 0 to 51. 0 is practically lossless at expense of incurring more hard drive space. I usually use 1 or 2 when I need lossless. 51 is maximum lossy at a huge expense of visual quality. I usually stop at around 28 to 32 on the lossy side. Most of the time, default 23 is good enough for me.
Maybe add in '-pix_fmt yuv420p' too for better media player compatibility.
Thanks, but that's quite small enough for me. In other news, I'm chopping other big videos (~2.1G per episode) back to ~500-600Megs with the same technique. Doing the job in less than 20 mins @ ≅900% cpu for a 1 hour video would be good. That would be flat out for 90 minutes on my old laptop, which would probably cook. For a laugh, I'll try one on a 1.5Ghz RazPi with 'time' running .
EDIT: Mine's one of the early Pi 4Bs. Later ones did 1.8Ghz and had an adjustable (cpu) PSU so you could specify an 'overvolts' setting in /boot/config.txt. I just don't know if mine handles that, and I'm not really an overclocker anyhow.
Last edited by business_kid; 08-25-2022 at 01:10 PM.
Well that timing test on the RazPi is put on hold.
I installed a disk image on the RazPi which is the way to go. But it left me light on the development stuff. So after a few false starts, I decided to mirror the slarm64 packages from slackware.uk, and do a mass 'upgradepkg --install-new.' I already have the backup - just in case.
This is to achieve timing tests, which are not in any way a priority. It's good to build have development stuff but far from essential on a RazPi. That libX265 is also a sizeable compiling job - 200 Megs of code!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.