k‎ > ‎y‎ > ‎3‎ > ‎


<Div dir = "ltr" style = "text-align: left;" trbidi = "on">

<Img src="http://2.bp.blogspot.com/-aGD9WZBqoJ0/VFj6mg71bMI/AAAAAAAAAQc/2j-ty_Vd6ws/s320/cutting-video.png" />

<P> Perhaps the most known and used the program <strong> <a href="http://www.adobe.com/products/flash-media-encoder.html"> Flash Media Live Encoder </a> </ strong> . It allows you to do online translation and record broadcast video using two video codecs <strong> <a href="http://ru.wikipedia.org/wiki/VP6"> VP6 </a> </ strong> and <strong > <a href="http://ru.wikipedia.org/wiki/H.264"> h264 </a> </ strong>. <Strong> VP6 </ strong> is less demanding of computer resources on which it is running, but the most suitable encoder in terms of recording quality video codec is a <strong> h264 </ strong>. This codec provides a better picture as compared to the other at the same bitrate. A current development of modern computers can use it without worrying about the lack of computing power. </ P>

<P> Here you have recorded and broadcast their thinking about to put it on your website. But it turned out that the output file with the extension turned f4v, which most players will not play. And would you like to cut more record before upload to share. </ P>

<P> Bstaёt question: & laquo; <em> And what do I do with this file? </ Em> & raquo; </ p>

<a name="more"> </a>

<H3> Search solutions </ h3>

<P> Let us will understand what problems we need to solve:

</ P> <ul>

<Li> Trim the beginning and at the end of the clip to start and stop video recording and possible hitches </ li>

<Li> convert to flash-player able to play a video clip </ li>

<Li> Share on site </ li>

<Li> In more rare cases some additional manipulation, such as cut the edge of the picture, cut from the middle of the movie, you need not, etc. </ li>

</ Ul>

<P> </ p>

<P> One of Varian solutions look good video editor, but good video editors usually expensive. A simple free usually only work with uncompressed video format (ie, you will need a lot of disk space) or only with popular formats, such as c AVI. Pay money, I think you do not want, and now you're trying a simple editor plus video transcoder. Diagram of your work is as follows f4v- & gt; avi- & gt; Trimming video & gt; flv. So you can run, but you make converting video twice and it takes a lot of time in the theory spoils the picture quality. </ P>

<P> And now look at the problem from the other side. Can directly upload the video clip to the server with the site and there treat? Let's try it. </ P>

<H3> required tools </ h3>

<P> And so we will need the following tools:

</ P> <ul>

<Li> <strong> <a href="http://www.ffmpeg.org/"> FFmpeg </a> </ strong> with the support of codec h264 - program for working with video from the console. </ Li>

<Li> <strong> <a href="http://code.google.com/p/flvmeta/"> flvmeta </a> </ strong> - a program to add meta information to files .flv. This is to ensure that in the flash-player works fast, because will not be the same constant of the whole record. </ li>

<Li> A test page with flash-player - to view the video receives. </ Li>

</ Ul>

<H3> Actually video processing </ h3>

In the example, we will do everything in a local folder. So the preliminary preparation of the file. <br />


ffmpeg -i imya_originalnogo_fayla.f4v -acodec copy -vcodec copy imya_vremennogo_fayla.flv <br>

ffmpeg -i imya_originalnogo_fayla.f4v -acodec libfaac -ab 48k -vcodec copy -y imya_vremennogo_fayla.flv <br />

flvmeta imya_vremennogo_fayla.flv imya_vremennogo_fayla.meta.flv </ code> <br />

Insert a flash-player way to get the files and how much should be cut otsmatrivat at the beginning and end of the clip. Suppose in our video should be cut off from the beginning of 3 minutes 40 seconds at the end of 43 minutes 14 seconds. Then get our movie will be a long 39 minutes 34 seconds.

<P> Property crop the video from the beginning and up to a point: <br>

<Code> ffmpeg -i imya_originalnogo_fayla.flv -acodec copy -vcodec copy -ss 00:03:40 -t 00:39:34 imya_vyhodnogo_fayla.flv </ code> <br>

3:40 here - is offset from the beginning of the original movie, and 39:34 - the duration of a future video. After this you should re-add the meta information that it was possible to squander clip in flash-player. <br>

<Code> flvmeta imya_vyhodnogo_fayla.flv imya_vyhodnogo_fayla.meta.flv </ code>

</ P>

Insert a flash-player path to the output file and see whether all koreektno cropped. If all is well, then rename it as necessary and insert the clip on the website. </ Div>