0

I'm a ffmpeg noob, I don't know much about it except for a basic idea about encoding/decoding and a few videos I watched over youtube about it's usage. I also don't have a big background in digital video, I only watch he occasional movie or course or stream, etc....

I have an intel machine with an i7-6700 which is slow. And I have a 30 Gig folder of lectures encoded in old real media format ".rm" and I was trying ffmpeg on it.

ffmpeg -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i input.rm -c:v hevc output.mp4

The result was impressive, the input file was 144 meg, the output was 95 meg which is a little over 30% reduction.

40%+ came out with avi files also which made me interested in knowing more about ffmpeg, and leads me to the question behind the post, why did I get such big size reduction in video output? Is it just more efficient compression ratio for x265 format or there was comparable data loss from the original files? And how would I measure that data loss? What tools to use if any to see what kind of data was in the input and what came out in the output?

I check on online ffmpeg documentation every now and then, but I wanted to get an answer for the my question the quick and dirty way because I have many videos that I wish to compress to save space, and It would take time so I thought I'd ask early as possible.

11
  • 1
    The SuperUser format doesn't work well for multiple questions in one Question post. You should probably trim this down to a single question.
    – Spiff
    Commented Jun 20 at 20:12
  • You can look up what h265 is, how it works, and why it helps make media packages smaller. This won't be given in ffmpeg documentation because that isn't particularly relevant to the function of that program. The basic answer is that modern hardware can do more complex math problems better and more efficiently, and that means you can use those bigger math problems to store data more efficiently. Commented Jun 20 at 22:00
  • H265 (the standard your x265 encoder is based on) is just that much better than what is used in your old .rm files. There will very likely be no visual quality loss as the rm compression most likely already tossed out way too much information to begin with. Having better input material would likely yield even better results. Exactly why this is is a very long topic. The constraints for the realmedia codec were much different, working on much less powerful computers and over much slower internet lines.
    – Silbee
    Commented Jun 21 at 10:18
  • I apologize for the late response ... Depending on the answers I get I will see if I'll split the post into multiple questions. My question is not about the x265 library per se, it's about how ffmpeg uses it as well. You see, I didn't mention that with "-crf 18" I get output large than the input which is not consistent! With that said, my access to the hardware seems to be limited as I mentioned earlier, so I'm not realy sure how functional is ffmpeg with my needs. With that said, if it's the case that the files don't loose any datat, that would be awesome.
    – Deyaa
    Commented Jun 21 at 21:20
  • @Deyaa there are 4/5 close votes now, so you will likely not get any answers here. That's not how you start on a website - you first follow the rules, then get help, not the other way round.
    – Destroy666
    Commented Jun 26 at 7:30

1 Answer 1

0

How much and what data is lost in ffmpeg transcoding?

It's not about ffmpeg, it's about the video codec you're using. Video compression is lossy in general, and depending on the code in use and its settings, it removes more or less data from the video. Of course, the point is to remove only data that you don't see. Some codecs are more successful in that than others.

why did I get such big size reduction in video output?

Video codecs evolve over time. In part that's because algorithms get smarter but mostly it's because processing power increases tremendously over time. So, a more modern codec can usually decrease video size considerably without losing (much) quality.

And how would I measure that data loss?

Practically, run the same video before and after recompression side-by-side. Focus on small details. Water and explosions are notoriously hard to compress, so you'd likely notice a reduction in quality there first.

3
  • Thank you for your contribution, however visual inspection cannot really determine the amount of data loss, unless it was tremendous! As far as I understand in addition to the video data itself there's meta data inside the video, sometimes this meta data is redundant, could the vast reduction in size be due to that? I'll check on the original and transcoded files with ffplay, perhaps the secret is only in the bitrates!!
    – Deyaa
    Commented 12 hours ago
  • 1
    Google for psychovisual models to understand what that pass of video-encoding tries to accomplish. Its a big scientific field much too broad and complicated to address. Think chroma/color information our eyes cannot process, our tendency to see more detail around our focus area and less in the rest of the picture, ... Many of these 'tricks' are used for video encoding. Then you have the different compression algorithms and how they work. And then you have all the legacy things that are the way the are because of computational limitations (or why realmedia is ass vs h265).
    – Silbee
    Commented 11 hours ago
  • @Deyaa Metadata is negligible in comparison to video or even audio data.
    – Zac67
    Commented 9 hours ago

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .