Create Segmented Video

..code-block:

ffmpeg -i input.mpg -c copy -f segment -segment_time 60 -segment_list list.m3u8 output%03d.ts

This site has a good writeup but uses Apple's segmentor

Encoding Webm with presets

..code:

 # ffmpeg -i input.mp4 -s 1280x720 -vpre libvpx-720p -b 3900k -pass 1 \

        -an -f webm -y output.webm

# ffmpeg -i input.mp4 -s 1280x720 -vpre libvpx-720p -b 3900k -pass 2 \

        -acodec libvorbis -ab 100k -f webm -y output.webm

Need to look at the desired size and bitrate

Segmenting

..code:

ffmpeg .... -f segment -segment_time 5 -segment_list_type flat -segment_list stream.m3u8 -y -segment_format mpegts  stream%05d.ts

Here is another example (but he's transcoding on the fly)

..code:

ffmpeg -i http://192.168.1.13:5004/auto/v512 -async 1 -ss 00:00:05 -acodec libfdk_aac \
-vbr 3 -b:v 3000k -ac 2 -vcodec libx264 -preset superfast  -tune zerolatency  -threads 2 \
-s 1280x720 -flags -global_header -fflags +genpts -map 0:0 -map 0:1 -hls_time 2 \
-hls_wrap 40 test.m3u8

Encoding h264

Came from https://www.virag.si/2012/01/web-video-encoding-tutorial-with-ffmpeg

..code:

ffmpeg -i input_file.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k
-vf scale=-1:480 -threads 0 -acodec libfdk_aac -b:a 128k output_file.mp4

Quick Start Commnad

qt-faststart output_file.mp4 output_file_with_relocated_metadata.mp4

Create Thumbs

..code:

ffmpeg -itsoffset -4 -i "$INFILE" -vcodec png -vframes 1 -an -f rawvideo -s 120x90 -y "$OUTFIL

from https://github.com/adexin-team/refinerycms-videojs/wiki/Encoding-files-to-.webm-%28VP8%29-and-.mp4-%28h.264%29-using-ffmpeg

He also has some good recipies for H264 and Webm