Merge pull request #56 from kfrn/gh-pages

add trim video option
This commit is contained in:
Reto Kromer 2016-05-12 22:42:06 +02:00
commit bebf9f5a14

View File

@ -386,28 +386,35 @@
</div>
<!-- ends Excerpt from beginning -->
<!-- Excerpt from middle -->
<span data-toggle="modal" data-target=".excerpt_from_middle"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Capture five seconds from the middle of a video file">Excerpt from middle</button></span>
<div class="modal fade excerpt_from_middle" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<!-- Trim -->
<span data-toggle="modal" data-target=".trim"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Trim video">Trim video</button></span>
<div class="modal fade trim" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="well">
<h3>Excerpt from middle</h3>
<p><code>ffmpeg -i <i>input_file</i> -ss <i>5</i> -t <i>10</i> -c copy <i>output_file</i></code></p>
<p>This command captures a certain portion of a video file, starting from a designated point in the file and taking an excerpt as long as the amount of time (in seconds) specified in the script. This can be used to create a preview or clip out a desired segment. To be more specific, use timecode, such as 00:00:05.</p>
<h3>Trim a video without re-encoding</h3>
<p><code>ffmpeg -i <i>input_file</i> -ss 00:02:00 -to 00:55:00 -c copy <i>output_file</i></code></p>
<p>This command allows you to create an excerpt from a video file without re-encoding the image data.</p>
<dl>
<dt>ffmpeg</dt><dd>starts the command</dd>
<dt>-i <i>input_file</i></dt><dd>path, name and extension of the input file</dd>
<dt>-ss <i>5</i></dt><dd>Tells ffmpeg what timecode in the file to look for to start copying, and specifies the number of seconds into the video that ffmpeg should start copying. To be more specific, you can use timecode such as 00:00:05.</dd>
<dt>-t <i>10</i></dt><dd>Tells ffmpeg to stop copying from the input file after a certain time, and specifies the number of seconds after which to stop copying. In this case, 10 seconds is specified.</dd>
<dt>-c copy</dt><dd>use stream copy mode to re-mux instead of re-encode</dd>
<dt>-ss 00:02:00</dt><dd>sets in point at 00:02:00</dd>
<dt>-to 00:55:00</dt><dd>sets out point at 00:55:00</dd>
<dt>-c copy</dt><dd>use stream copy mode (no re-encoding)
<i>Note:</i> watch out when using <code>-ss</code> with <code>-c copy</code> if the source is encoded with an interframe codec (e.g., H.264). Since ffmpeg must split on i-frames, it will seek to the nearest i-frame to begin the stream copy.</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
</dl>
<p>Variation: trim video by setting duration, by using <code>-t</code> instead of <code>-to</code></p>
<p><code>ffmpeg -i <i>input_file</i> -ss 00:05:00 -t 10 -c copy <i>output_file</i></code></p>
<dl>
<dt>-ss 00:05:00 -t 10</dt>
<dd>Beginning five minutes into the original video, this command will create a 10-second-long excerpt.</dd>
</dl>
</div>
</div>
</div>
</div>
<!-- ends Excerpt from middle -->
<!-- ends Trim -->
<!-- Excerpt to end -->
<span data-toggle="modal" data-target=".excerpt_to_end"><button type="button" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="Create a new video file with the first five seconds trimmed off the original">Excerpt to end</button></span>
@ -1000,6 +1007,7 @@
</div>
</div>
<!-- ends set field order -->
</div><!-- closes the well -->