m (Conversion)
m
 
Line 6: Line 6:
  
 
If you use. In our case, we currently use [http://www.mediawiki.org/wiki/Extension:MediawikiPlayer MediawikiPlayer] which relies on [http://www.longtailvideo.com/players/jw-flv-player/ longtail video], which is at least partly open source.
 
If you use. In our case, we currently use [http://www.mediawiki.org/wiki/Extension:MediawikiPlayer MediawikiPlayer] which relies on [http://www.longtailvideo.com/players/jw-flv-player/ longtail video], which is at least partly open source.
 +
 +
== Extraction ==
 +
 +
To extract a segment from an mp4 between frames with timestamps 180.04 and 225 (timestamp is frame number / fps):
 +
 +
<pre>
 +
ffmpeg -ss 180.04 -to 225 -i lecture12-integrals.mp4 -c:v libx264 -c:a aac extracted-segment.mp4
 +
</pre>
 +
 +
Using <tt>-t</tt> instead of <tt>-to</tt> specifies a duration, not start-stop frames. See [[Blog:Hacks/Stitching_mp4_in_linux|Stitching mp4]] for a guided example.
  
 
== Conversion ==
 
== Conversion ==

Latest revision as of 09:25, 26 November 2020

Contents

Video

On our website

Believe it or not, it is quite difficult to display a video which you host yourself (that is, not inheriting its display from somewhere else). That is, it is difficult if you want to do it well and clean (using only open source throughout and HTML5 protocol).

If you use. In our case, we currently use MediawikiPlayer which relies on longtail video, which is at least partly open source.

Extraction

To extract a segment from an mp4 between frames with timestamps 180.04 and 225 (timestamp is frame number / fps):

ffmpeg -ss 180.04 -to 225 -i lecture12-integrals.mp4 -c:v libx264 -c:a aac extracted-segment.mp4

Using -t instead of -to specifies a duration, not start-stop frames. See Stitching mp4 for a guided example.

Conversion

To convert avi to mp4:

ffmpeg -i input.avi -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4

https://superuser.com/questions/848584/convert-avi-file-to-mp4-in-linux

To convert mkv to mp4:

 ffmpeg -i input.mkv -codec copy output.mp4