Author Topic: An interface to run 'ffmpeg'  (Read 96 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4867
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
An interface to run 'ffmpeg'
« on: November 01, 2017, 01:02:12 AM »
This toy is an interface to use the video program "ffmpeg" and its target is MP4 video footage that you either want to compress by way of the bitrate and/or increase the sharpness using an "unsharp" mask. The interface collects the options required and feeds them in a valid command line to "ffmpeg" which MUST be in the same directory or it will not start. It has given me the capacity to very accurately compress MP4 files and to carefully tune the level of sharpness to the individual MP4 file.

To use it you must have a current version of "ffmpeg" which you can download from their site and this executable must have "ffmpeg" in the same directory so you can either put this executable in the ffmpeg directory or copy ffmpeg into the directory where this executable is placed.

The download  file "ffmpeg-20171027-5834cba-win64-static.zip" is about 46 meg.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4867
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: An interface to run 'ffmpeg'
« Reply #1 on: November 04, 2017, 11:05:05 PM »
This is version 2 of ffmprun and it has a wider range of options. I have slightly changed the way it works, it now creates a batch file to run "ffmpeg.exe" and when that is finished it will run the processed video in "ffplay.exe". This version uses the codec h264 which is the most commonly used at the moment, it does have the option to run the h265 codec but I confess I have not fully decyphered its reference material and it barely performs any better than the h264 codec.

You will need to download the ffmpeg at https://ffmpeg.zeranoe.com/builds/ and as this is a 64 bit version you will need to download the 64 bit version. ffmpeg.exe must be in the same directory so the app will start and you also need to place ffplay.exe in the same directory so that the video is run once the processing is finished. With the MP4 footage I have taken recently in 4k and 1080 the results are very good and highly adjustable in terms of size and quality. I aim at MP4 and have few others but I tested it with some old AVI footage and it seems to work OK and you get respectable size reductions and quality with a little fiddling.

The batch file that the app creates "latest.bat" remains in the target directory and can be edited manually to re-run the process.

I note with some humour that the entire "ffmpeg" project is run like many other Unix based projects, a wide collection of different developers doing all sorts of things and often with very good code but the documentation is all over the place like a mad woman's chyte, various bits of it are out of date or simply wrong and it is generally hard to find. I got the command line for the app reliable by exhaustive testing of options, not from the reference material.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin: