Revision as of 15:38, 7 January 2018 by Yair (talk | contribs) (→‎broadcast client)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


ffmpeg script generator

MTS to webm

Used ffmpeg to concatenate the files without reencoding (codec copy):

ffmpeg -f concat -i files -c copy whole.mts

where files contains:

file 00001.MTS
file 00002.MTS


Used gstreamer to convert to webm. This was after failed (i.e. success but garbage output - small random squares) attempts with both mencoder and ffmpeg:

gst-launch-0.10 filesrc location=whole.mts ! decodebin name=demux ! queue ! ffmpegcolorspace ! vp8enc ! webmmux name=mux ! filesink location=whole.webm demux. ! queue ! progressreport ! audioconvert ! audioresample ! vorbisenc ! mux.

Then used ffmpeg to cut without copy, this is almost instantaneous on a SSD drive (whole.webm is 914M):

ffmpeg -i whole.webm -ss 00:12:55 -to 20:07 -codec copy 03_EWB_Oren.webm

cropping with ffmpeg

ffmpeg -i atlassian_jira_workflow_graph_view_guides_demonstration_20150305_orig.webm -vf "crop=1920:1200:0:0" test.webm

cropping with gstreamer

gst-launch-0.10 -v filesrc location=./atlassian_jira_workflow_graph_view_guides_demonstration_20150305_orig.webm ! decodebin ! ffmpegcolorspace ! videocrop top=0 left=0 right=1920 bottom=0 ! vp8enc ! webmmux ! filesink location=whole.webm

video contact sheet (thumbnail) creation

from (forum.videohelp)[1]

ffmpeg -i %1 -vf select='gt(scene\,0.5)',scale=192:108,tile -frames:v 1 %1_preview_scene.png
ffmpeg -i %1 -f GIF -vf "fps=fps=5,scale=out_range=auto:force_original_aspect_ratio=decrease:'if(gt(a,1/1),128,-1)
sws_dither=a_dither,pad=128:128:(ow-iw)/2:(oh-ih)/2,setsar=sar=1/1" -pix_fmt rgb8 -loop 0 -final_delay 1 -  
default_delay 1 -y %1_thumb.gif 
ffmpeg -i %1 -vf select='eq(pict_type\,I)',scale=192:108,tile -frames:v 1 %1_preview_I_frame.png


Streaming_media on wikipedia


Icecast2 is a streaming media server offical docs

how to

broadcast server

first install icecast server , only done once and on the server.
in my case its an arch linux server

 ## to configure
 # sudo vim /etc/icecast.xml
 ## to manage service
 # systemctl enable/stop/restart icecast

broadcast client

ezstream is what we use, it can be told to re encode, use playlists ,shuffle, load custom metadata per file etc.
runs on linux and windows.

1. prepare a playlist.m3u file, see 'man ezstream' for more.
could be a easy as getting to your media folder and

ls > playlist.m3u

2. then run

ezstream -c ezstream_reencode_theora.xml 

find an example xml configuration file at /usr/share/examples/ezstream/

this will show on
you can then see stats on

you might want to start with ffmpeg2theora|oggfwd for testing (see below)


alternatives and addons

oggfwd is basicly a cat, so very light. if you already have an ogg/theora encoded file and just want to stream a file then here is an example of quick streaming to server

# this example will show at
# cat zimmertlv-92244715-streamReady.ogv | oggfwd 8000 password /channel

ffmpeg2theora is harder on the server. as it re-encodes to ogg/theora
so better encode beforehand. example of video encoding from mp4 to ogg (ogv)

# ffmpeg -i input.mp4 -codec:v libtheora -qscale:v 5 -codec:a libvorbis -qscale:a 4 output.ogv

example of on the fly re-encoding using ffmpeg2theora and then streaming using oggfw this is the easiest way to stream, but you need an ok pc for that as you re-encode the video.

# -p preview is 288Kbps video
# -v 4 = 500Kbps
ffmpeg2theora --no-skeleton -p preview video_source.mp4 -o /dev/stdout | oggfwd 8000 password /mount_name

alt methods

tested audio streaming using BUTT on windows
tested audio streaming using BroadcastMySelf for android

tested video streaming using ffmpeg2theora | oggfwd on arch
tested video streaming using ezstream on arch


in research windows is so easy on this one :> beanies
needed for [ttps:// OBS streaming ]

built following instructions on arch

rtmp:// works , html is lacking documentation

concat video files example

for i in {1..4}; do printf "file '%s'\n" input.mp4 >> list.txt; done
ffmpeg -re -f concat -i list.txt -c copy -f flv rtmp://localhost/myapp/mystream



not using currently documentation is a mess

could it be, the guide to rule them all, so much updated !
Streaming Tutorial II:

how to

h264 to ogg is broken , might be more

a segmentator (might be) needed for apple support

video tag works with mediaelementjs.js



alternatives and addons