사용자 도구

사이트 도구


ffmpeg002

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

ffmpeg002 [2014/04/17 17:47]
minetech [Top left corner]
ffmpeg002 [2014/04/17 17:49] (현재)
minetech
줄 1: 줄 1:
 Link : [[http://​www.idude.net/​index.php/​how-to-watermark-a-video-using-ffmpeg/​|원본경로(http://​www.idude.net/​index.php/​how-to-watermark-a-video-using-ffmpeg/​)]] Link : [[http://​www.idude.net/​index.php/​how-to-watermark-a-video-using-ffmpeg/​|원본경로(http://​www.idude.net/​index.php/​how-to-watermark-a-video-using-ffmpeg/​)]]
 +
 ====== How to watermark a video using FFmpeg ====== ====== How to watermark a video using FFmpeg ======
  
줄 6: 줄 7:
 FFmpeg is a free software / open source project that produces libraries and programs for handling multimedia such as video. ​ Many of it developers also are part of the MPlayer project. ​ Primarily this project is geared towards Linux OS, however, much of it has been ported over to work with Windows 32bit and 64bit. ​ FFmpeg is being utilized in a number of software applications;​ including web applications such as PHPmotion (www.phpmotion.com). ​ Not only does it provide handy tools, it also provided extremely useful features and functionality that can be added to a variety of software applications. FFmpeg is a free software / open source project that produces libraries and programs for handling multimedia such as video. ​ Many of it developers also are part of the MPlayer project. ​ Primarily this project is geared towards Linux OS, however, much of it has been ported over to work with Windows 32bit and 64bit. ​ FFmpeg is being utilized in a number of software applications;​ including web applications such as PHPmotion (www.phpmotion.com). ​ Not only does it provide handy tools, it also provided extremely useful features and functionality that can be added to a variety of software applications.
  
-==== FFmpeg on Windows ​====+=== FFmpeg on Windows ===
  
 If you want to use FFpmeg on Windows, I recommend checking out the FFmpeg Windows builds at Zeranoe (http://​ffmpeg.zeranoe.com/​builds/​) for compiled binaries, executables and source code.  Everything you need to get FFmpeg working on Windows is there. ​ If you’re looking for a handy Windows GUI command line tool, check out WinFF www.winff.org. ​ You can configure WinFF to work with whatever builds of FFmpeg you have installed on windows. ​ You can also customize you’re own presets (stored command lines) to work with FFpmeg. ​ If you want to use FFpmeg on Windows, I recommend checking out the FFmpeg Windows builds at Zeranoe (http://​ffmpeg.zeranoe.com/​builds/​) for compiled binaries, executables and source code.  Everything you need to get FFmpeg working on Windows is there. ​ If you’re looking for a handy Windows GUI command line tool, check out WinFF www.winff.org. ​ You can configure WinFF to work with whatever builds of FFmpeg you have installed on windows. ​ You can also customize you’re own presets (stored command lines) to work with FFpmeg. ​
  
-==== Getting familiar with it. ====+=== Getting familiar with it. ===
 Perhaps one of the best ways to get familiar with using FFmpeg on windows is to create a .bat script file that you can modify and experiment with.  Retyping command lines over again from scratch becomes a tedious process, especially when working with an command line tool you’re trying to become more familiar with.  If you’re on Linux you’ll be working with shell scripts instead of .bat files. Perhaps one of the best ways to get familiar with using FFmpeg on windows is to create a .bat script file that you can modify and experiment with.  Retyping command lines over again from scratch becomes a tedious process, especially when working with an command line tool you’re trying to become more familiar with.  If you’re on Linux you’ll be working with shell scripts instead of .bat files.
 Please keep in mind that FFmpeg has been, and still is, a rather experimental project. ​ Working with FFmpeg’s Command Line Interface (CLI) is not easy at first and will take some time getting familiar with it.  You need to be familiar with the basics of opening a video file, converting it, and saving the output to a new video file.  I strongly recommend creating and working with FFmpeg in shell/bat scripting files while learning the functionality of it’s Command Line Interface. Please keep in mind that FFmpeg has been, and still is, a rather experimental project. ​ Working with FFmpeg’s Command Line Interface (CLI) is not easy at first and will take some time getting familiar with it.  You need to be familiar with the basics of opening a video file, converting it, and saving the output to a new video file.  I strongly recommend creating and working with FFmpeg in shell/bat scripting files while learning the functionality of it’s Command Line Interface.
  
-==== -vhook (Video Hook) ==== +=== -vhook (Video Hook) === 
 Please note that the functionality of “-vhook” (video hook) in older versions of FFmpeg has been replaced with “-vf” (video filters) libavfilter . You’ll need to use –vf instead of –vhook in the command line.  This applies to both Linux and Windows builds. Please note that the functionality of “-vhook” (video hook) in older versions of FFmpeg has been replaced with “-vf” (video filters) libavfilter . You’ll need to use –vf instead of –vhook in the command line.  This applies to both Linux and Windows builds.
  
-==== What we’re going to do ==== +=== What we’re going to do === 
 In a nutshell; ​ We’re going to load a .png image as a Video Source “Movie” and use the Overlay filter to position it. While it might seem a little absurd to load an image file as a Video Source “Movie” to overlay, this is the way it’s done. (i.e. movie=watermarklogo.png) In a nutshell; ​ We’re going to load a .png image as a Video Source “Movie” and use the Overlay filter to position it. While it might seem a little absurd to load an image file as a Video Source “Movie” to overlay, this is the way it’s done. (i.e. movie=watermarklogo.png)
 What’s awesome about working with png (portable network graphics) files is that they support background transparency and are excellent to use in overlaying on top of videos and other images. What’s awesome about working with png (portable network graphics) files is that they support background transparency and are excellent to use in overlaying on top of videos and other images.
  
-==== The Overlay Filter ​====   overlay=x:y+=== The Overlay Filter ​   overlay=x:​y ​===
 This filter is used to overlay one video on top of another. It accepts the parameters x:y.  Where x and y is the top left position of overlayed video on the main video. ​ In this case, the top left position of the watermark graphic on the main video. ​ This filter is used to overlay one video on top of another. It accepts the parameters x:y.  Where x and y is the top left position of overlayed video on the main video. ​ In this case, the top left position of the watermark graphic on the main video. ​
 To position the watermark 10 pixels to the right and 10 pixels down from the top left corner of the main video, we would use “overlay=10:​10” To position the watermark 10 pixels to the right and 10 pixels down from the top left corner of the main video, we would use “overlay=10:​10”
줄 38: 줄 39:
  
 ===== Watermark Overlay Examples =====  ===== Watermark Overlay Examples ===== 
-VideoWaterMark+=== VideoWaterMark ​===
 The following 4 video filter (-vf) examples embed an image named “watermarklogo.png” into one of the four corners of the video file, the image is placed 10 pixels away from the sides (offset for desired padding/​margin). The following 4 video filter (-vf) examples embed an image named “watermarklogo.png” into one of the four corners of the video file, the image is placed 10 pixels away from the sides (offset for desired padding/​margin).
 === Top left corner === === Top left corner ===
줄 44: 줄 45:
 ffmpeg –i inputvideo.avi -vf "​movie=watermarklogo.png [watermark];​ [in][watermark] overlay=10:​10 [out]" outputvideo.flv ffmpeg –i inputvideo.avi -vf "​movie=watermarklogo.png [watermark];​ [in][watermark] overlay=10:​10 [out]" outputvideo.flv
 </​code>​ </​code>​
-==== Top right corner ​====+=== Top right corner ===
 ffmpeg –i inputvideo.avi -vf "​movie=watermarklogo.png [watermark];​ [in][watermark] overlay=main_w-overlay_w-10:​10 [out]" outputvideo.flv ffmpeg –i inputvideo.avi -vf "​movie=watermarklogo.png [watermark];​ [in][watermark] overlay=main_w-overlay_w-10:​10 [out]" outputvideo.flv
-==== Bottom left corner ​====+=== Bottom left corner ===
 ffmpeg –i inputvideo.avi -vf "​movie=watermarklogo.png [watermark];​ [in][watermark] overlay=10:​main_h-overlay_h-10 [out]" outputvideo.flv ffmpeg –i inputvideo.avi -vf "​movie=watermarklogo.png [watermark];​ [in][watermark] overlay=10:​main_h-overlay_h-10 [out]" outputvideo.flv
-==== Bottom right corner ​====+=== Bottom right corner ===
 ffmpeg –i inputvideo.avi -vf "​movie=watermarklogo.png [watermark];​ [in][watermark] overlay=main_w-overlay_w-10:​main_h-overlay_h-10 [out]" outputvideo.flv ffmpeg –i inputvideo.avi -vf "​movie=watermarklogo.png [watermark];​ [in][watermark] overlay=main_w-overlay_w-10:​main_h-overlay_h-10 [out]" outputvideo.flv
 These examples use something known as Filter Chains. ​ The pad names for streams used in the filter chain are contained in square brackets [watermark],​[in] and [out]. ​ The ones labeled [in] and [out] are specific to video input and output. ​ The one labeled [watermark] is a custom name given to the stream for the video overlay. ​ You can change [watermark] to another name if you like.  We are taking the output of the [watermark] and merging it into the input [in] stream for final output [out]. These examples use something known as Filter Chains. ​ The pad names for streams used in the filter chain are contained in square brackets [watermark],​[in] and [out]. ​ The ones labeled [in] and [out] are specific to video input and output. ​ The one labeled [watermark] is a custom name given to the stream for the video overlay. ​ You can change [watermark] to another name if you like.  We are taking the output of the [watermark] and merging it into the input [in] stream for final output [out].
ffmpeg002.1397724438.txt.gz · 마지막으로 수정됨: 2014/04/17 17:47 저자 minetech