Need help with FFmpeg video conversion tool


  1. Posts : 1,310
    Windows 10
       #1

    Need help with FFmpeg video conversion tool


    I am trying to do a format conversion to some VR files I captured with my VR camera . While it took me days to finally figure that my options are very limited to a couple of expensive video editors or rather the free FFmpeg and more days to acquire the right command line syntax to do it I am still faced by this ambiguous result ....

    See the original bite rate is 30 MB/s , however the result file becomes only 4 MB/s now this makes the result video of lower quality than supposed to and it shows , now I am not an expert with FFmpeg and so far I cant find an answer to this dilemma .

    So for those who came across this before , what are the correct parameters to make the output video of same bite rate as the input one or even get to set it manually to 30 MB/s ?
      My Computer


  2. Posts : 31,692
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #2

    nIGHTmAYOR said:
    I am trying to do a format conversion to some VR files I captured with my VR camera . While it took me days to finally figure that my options are very limited to a couple of expensive video editors or rather the free FFmpeg and more days to acquire the right command line syntax to do it I am still faced by this ambiguous result ....

    See the original bite rate is 30 MB/s , however the result file becomes only 4 MB/s now this makes the result video of lower quality than supposed to and it shows , now I am not an expert with FFmpeg and so far I cant find an answer to this dilemma .

    So for those who came across this before , what are the correct parameters to make the output video of same bite rate as the input one or even get to set it manually to 30 MB/s ?
    What you want to achieve is to control the quality, not necessarily the bitrate. You can do this by specifying a Constant Rate Factor (CRF) value in the command line. You can also chose a preset for the speed of encoding, the slower it is, the better the resulting quality for any given CRF value.

    The range of the CRF scale is 0–51, where 0 is lossless ... 23 is the default, and 51 is worst quality possible. A lower value generally leads to higher quality, and a subjectively sane range is 17–28. Consider 17 or 18 to be visually lossless or nearly so; it should look the same or nearly the same as the input but it isn't technically lossless.

    The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate....

    ....A preset is a collection of options that will provide a certain encoding speed to compression ratio. A slower preset will provide better compression (compression is quality per filesize). This means that, for example, if you target a certain file size or constant bit rate, you will achieve better quality with a slower preset...
    See here for a lot more details: Encode/H.264 – FFmpeg

    If you don't specify anything the defaults are CRF 23 and Medium for the preset.
    For high quality try: ffmpeg -i input.mp4 -crf 16 -preset veryslow output.mp4
    Last edited by Bree; 13 Feb 2024 at 19:50.
      My Computers


  3. Posts : 1,310
    Windows 10
    Thread Starter
       #3

    Thanks for the help , it managed to open up for further points to research and apparently I now know of new needed parameters to use and like to share :

    1) Setting a constant Video Bite Rate (default was -crf 23)
    -b:v 30M

    2) Setting a constant Audio Bite Rate (default was 128)
    -b:a 256k

    3) Setting audio frequency (default was 44100)
    -ar 48000

    It was really hard for me to work with CRF because the rate factor is not deduced based on bite rate but rather quality , in all my tests I would either end up with a file bigger or smaller in size than original by 1~2 GB margin by flicking the parameter 1 point up or down (Basically VR files are insanely huge , some of my recorded videos are over 20 GBs) so the end video turns out unoptimized or losing quality so i had to push further till I found these .

    PS Thanks Bree , sadly the repping system insists I should rep others before I can rep you probably because you were the last person I repped like a year ago or so :)
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:51.
Find Us




Windows 10 Forums