Sunday, February 19, 2017

Tutorial 04 - How to use the Crop detection to find the Black border of a video

This document explains how to find the black border around video and trim it during encoding

How to detect black borders


ffmpeg -hide_banner -ss 300 -i <Source_File> -vframes 10 -vf cropdetect -f null -
It will produce output of 10 frames as

[Parsed_cropdetect_0 @ 02d87c20] x1:78 x2:557 y1:60 y2:419 w:480 h:352 x:78 y:64 pts:12000 t:0.133333 crop=480:352:78:64

How to create a new output file without the black border

Find the crop settings from the previous command and use it as a video filter during encoding the video

ffmpeg -i <Source_File> -vf crop=480:352:78:64 -c:a copy output.mp4

Tutorial 03 - How to split the large videos

This document explains how to split the large videos using ffmpeg

CMD:
ffmpeg.exe -hide_banner -y -ss 00:00:00.0 -i <file_name> -vcodec copy -acodec copy -avoid_negative_ts make_zero -map 0 -segment_time <seconds> -f segment output%02d.mp4


-hide_banner Hide the banner during transcoding
-y Overwrite if the output file already exists
--ss Start time from which the video that needs to be splitted
-vcodec copy Copies the source video codec
-acodec copy Copies the source audio codec
-avoid_negative_ts make_zero
-map 0
-segment_time The duration which the video needs to be split
-f segment Produce the segmented output
output%02d.mp4 Output file names will be in this pattern


SAMPLE:
ffmpeg.exe -hide_banner -y -ss 00:00:00.0 -i SourceVideo.mp4 -vcodec copy -acodec copy -avoid_negative_ts make_zero -map 0 -segment_time 300 -f segment output%02d.mp4


Monday, July 11, 2016

Tutorial 02 - Basic Options of FFMPEG

This document explains about the basic options which helps to understand the ffmpeg usage


  • Hide Banner
  • Codec
  • Formats
  • Devices
  • Encoder
  • Decoder
  • Protocols
  • Filters
  • Layouts
  • Pixel Format
  • Logging
  • Encoding Statistics
  • Reporting
  • General Commands
  • Metadata of Content

Hide Banner

When ever you run the ffmpeg, it displays all the configuration details using which it is build, in case if you do not want that to be printed in the console you can use the option (-hide_banner)

Without hide banner
cmd: 
C:\ffmpeg\bin\ffmpeg
Output:

ffmpeg version N-79107-g30d1213 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enabl
le-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp
ibtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvi
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.103 / 57. 28.103
  libavformat    57. 29.100 / 57. 29.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

With Hide Banner
cmd: 
C:\ffmpeg\bin\ffmpeg -hide_banner
Output:
Hyper fast Audio and Video encoder                                                     
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... 

Saturday, June 11, 2016

Tutorial 01 - FFMPEG Download

Introduction

FFMPEG is a command line video editing software. Using which you can do the following thing

  1. Record Screen
  2. Record Video thru Web Camera
  3. Convert Video to different formats
  4. Merge and Split Video and Audio
  5. Create Picture in Picture
  6. Add Subtitles to video
  7. Supports below hardware accleration for better and faster encoding and decoding
    • Intel Quick Sync
    • NVidea Codec
    • Open CL
    • Apple VDA
    • Unix VDPAU(Video Decode and Presentation API for Unix)
    • DirectX for Windows
etc. etc..

FFMPEG GUI

There are lots of Freeware which provides the GUI for video editing usig ffmpeg. Some of the actively worked tools are listed below

FFMPEG Download

FFMPEG is developed using C and C++ so there i a short of portability to different platforms. But to our surprise there are different vendors provide ffmpeg bundle to different platforms. If you are a newbie for this, it is highly encouraged to use one of those build instead of you building on your own.

Go to FFMPEG Download and please select the OS package according to your need and extract it to your Desktop/Laptop


Thanks for reading, moving on this tutorial will explain How To, What Issues can arrive, How to Solve it one by one.