Posts

Showing posts from November, 2011

ffmpeg - Merging video files

ffmpeg provide a commands to merge video files together. Below is an example to merge MPEG2-TS files into 1 files

ffmpeg -i concat:"input\\your1.ts|input\\your2.ts" -vcodec copy -acodec copy output\merge.ts

First, the command use a ffmpeg concat function to merge the 2 files. Then, it merge the 2 files into 1 output file by copying the video and audio frames.

See: http://ffmpeg.org/ffmpeg.html#concat

There are other technique to merge video files with FFMPEG. But, personally, I don't like them as they involve too many file container conversion.

http://ffmpeg.org/faq.html#How-can-I-join-video-files_003f

However, both technique is restricted to MPEG-1, MPEG-2 PS, DV format

ffmpeg - Burning overlay logo

ffmpeg provide a way to burn a customized logo to your video. The command as folllow

Burn logo at bottom right corner


ffmpeg -i input\your.mp4 -vf "movie=input/your_logo.png [logo];[in][logo] overlay=W-w-10:H-h-10 [out]" -vcodec libx264 output\your_output.mp4


Burn logo at bottm left corner

ffmpeg -i input\your.mp4 -vf "movie=input/your_logo.png [logo];[in][logo] overlay=10:main_h-overlay_h-10 [out]" -vcodec libx264 output\your_output.mp4

In general, the command description as follow
movie=input/your_logo.png
This define your image logo. Note, if your logo exist at different folder, your path separator is /
overlay=W-w-10:H-h-10
This define your location of your logo
See http://ffmpeg.org/libavfilter.html#overlay