Posts

Showing posts with the label ffmpeg

Build FFMPEG for Windows Using Visual Studio Toolchain

FFMPEG for Windows is built under MinGW or Cygwin.  We will be using MinGW. You may need ZLib, the ZLib provided with MinGW does not come with a .a file for some reason.  You can find ZLib at  https://zlib.net/ Build Zlib so that you get zlib.lib. Follow this page:  https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC NOTE: When following the instructions on the above page, they only give a configure command for a release version, which is: ./configure --target-os=win64 --arch=x86_64 --toolchain=msvc If you want to do a full debug build, try this: ./configure --target-os=win64 --arch=x86_64 --toolchain=msvc --extra-cflags=" -EHa -nologo -D 'DEBUG' -D 'WINDOWS' -D 'HAVE_STRUCT_TIMESPEC' -D 'API_EXT_PARAM_LIST'" --enable-debug --disable-stripping --disable-optimizations --disable-cuda --disable-cuvid --disable-d3d11va --disable-dxva2 --disable-nvenc --disable-vaapi --disable-vdpau You should now be ready to use ffmpeg in a...

FFMPEG Deinterlacing Modes

FFMPEG has multiple supported deinterlacing filters.  Here they are: 10.14 bwdif Deinterlace the input video ("bwdif" stands for "Bob Weaver Deinterlacing Filter"). Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic interpolation algorithms. It accepts the following parameters: mode The interlacing mode to adopt. It accepts one of the following values: 0, send_frame Output one frame for each frame. 1, send_field Output one frame for each field. The default value is send_field. parity The picture field parity assumed for the input interlaced video. It accepts one of the following values: 0, tff Assume the top field is first. 1, bff Assume the bottom field is first. -1, auto Enable automatic detection of field parity. The default value is auto. If the interlacing is unknown or the decoder does not export this information, top field first will be assumed. deint Specify which frames to deinterlace. Accept ...

FFMPEG Compliation Guide: libx264, MinGW and MSYS

The following were taken from  here  and  here . Get the nasm assembler:  http://www.nasm.us/ Stable build of libx264 can be found here:  ftp://ftp.videolan.org/pub/videolan/x264/snapshots/ Build libx264 H.264 video encoder. See the  H.264 Encoding Guide  for more information and usage examples. Requires ffmpeg to be configured with --enable-gpl --enable-libx264. If your repository provides libx264-dev version ≥ 118 then you can install that instead of compiling: sudo apt-get install libx264-dev Otherwise you can compile: cd ~/ffmpeg_sources git -C x264 pull 2> /dev/null || git clone --depth 1 http://git.videolan.org/git/x264 cd x264 If not using Mingw-w64, us this configure line: ./configure --enable-static If using Mingw-w64, use this configure line: ./configure --host=x86_64-w64-mingw32 --disable-cli --enable-static --disable-gpac --disable-swscale --enable-strip make make install Now...

FFMPEG Command Examples (Useful FFMPEG Commands)

Some of these are taken from here and here  and here . Good beginner guide:  here Nice set of examples:  here FFMPEG Audio Manipulation commands: https://trac.ffmpeg.org/wiki/AudioChannelManipulation Shorten a file.  Start at 0, and encode 180 seconds.  Copy ALL streams, not just the first or "best" of each type, which is the FFMPEG default: ffmpeg -i input.mpg -ss 00:00:00 -t 180 -map 0 -codec copy output.mpg Convert MP4 frames to Annex B: ffmpeg -i input.mov -codec:v copy -codec:a copy -bsf:v h264_mp4toannexb -f mp4 -y output.mp4 Get information about a media file: ffmpeg -i video.avi Extract (demux) the audio track from a video file: ffmpeg -i video.mts -acodec copy -vn audio.ac3 Extract (demux) the video track from a video file: ffmpeg -i video.mts -vcodec copy -an -f h264 ffNT.h264 Merge an audio and a video track (mux): ffmpeg -i video.h264 -i audio.ac3 -vcodec copy -acodec copy videoaudio.ts Resize an original Full-HD (...