Author Topic: A new interface using ffmpeg "h264vid.exe"  (Read 2861 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7212
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
A new interface using ffmpeg "h264vid.exe"
« on: November 27, 2017, 11:15:53 AM »
I have done a completely new version of this interface and to date it has been particularly useful in tweaking h264 format video. The app is supplied with full 64 bit MASM source and to use it you need to have "ffmpeg" set in your computer's path as its easier to develop this way. I have disabled the check for ffmpeg in the local directory for the moment. It is designed to size the output video to a range of 16/9 standard sizes up to 4k, it can set the bitrate to control the output file size and quality and it has 2 adjustments for the unsharp mask so that you can carefully tweak the sharpness level. I have set this to the maximum range to handle video from very good to very ordinary and with high res video (1080 & 4k) the settings above and below zero are incremented very finely so you can avoid the outlining defect of over sharpening.

To set it up you need to download ffmpeg from https://ffmpeg.zeranoe.com/builds/ and place both "ffmpeg.exe" and "ffplay.exe" in a directory that is in the computer's path. The logic of the application is one of getting the required settings and writing a conventional batch file that then runs ffmpeg and displays the result in ffplay. The batch file is left in the target directory so it can be modified and re-used. As usual the app is subject to change but is currently doing all of what I need it to do so it is pretty stable. I have not had any trouble loading a non mp4 video file as the source file and outputting mp4 files. Tested so far on FLV, MOV and a few other common file formats.

The MASM code is a reasonably straight forward dialog interface and a reasonable example of coding an app of this type.

LATEST VERSION BELOW.
« Last Edit: June 26, 2018, 03:31:04 AM by hutch-- »
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7212
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: A new interface using ffmpeg "h264vid.exe"
« Reply #1 on: July 12, 2018, 05:04:51 PM »
I have just updated the app so that it remembers the last directory it was used in. I found that it was starting to drive me NUTZ having to climb up a directory tree each time I started it. Install is simple, delete the complete set of files for the earlier version(s) and replace them with the contents of the attached zip file.

The first time it is run it will create a default settings file "h264vid.set". It is a binary file that is not designed to be edited. If for some obscure reason it ever gets damaged, delete it and run the app again and it will create a new default settings file.

As before you need to have "ffmpeg and ffplay" in your PATH settings and it is worth downloading the later versions of ffmpeg as they keep adding capacity to it, ffplay now has sound which you can turn off by pressing "m" on your keyboard.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

guga

  • Member
  • *****
  • Posts: 1112
  • Assembly is a state of art.
    • RosAsm
Re: A new interface using ffmpeg "h264vid.exe"
« Reply #2 on: May 05, 2020, 02:30:55 AM »
Amazing. Tks you so much, Steve


Do you think you can make it convert and export a mkv to Hls file as i reported here ?

http://masm32.com/board/index.php?topic=8507.msg93077#msg93077

And, maybe on a 32bit version ?
« Last Edit: May 05, 2020, 04:29:30 AM by guga »
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 7212
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: A new interface using ffmpeg "h264vid.exe"
« Reply #3 on: May 05, 2020, 09:53:02 AM »
Guga,

What I have found using ffmpeg is that it will read almost anything and will come close to writing anything in terms of video formats so I think you will need to test the 2 formats you have mentioned.

The app itself is simply an interface using a dialog with a range of controls on it that gets the settings required and writes a batch file to call ffmpeg. The ffmpeg documentation is a nightmare and generally you just have to keep testing until you get it to work.

A 32 bit version that does the same task of calling ffmpeg should be reasonably easy to write as the interface between the app and ffmpeg is simply a batch file.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: