Skip to content
Javascript video on canvas.
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Video Edit

Scripts to render video fragments on a canvas element. A node app captures the canvas frames and saves them to a PNG image sequence.

Videos made with these scripts


Berliner Dom

Three Day Walk


Convert AVI to MP4:

ffmpeg -i input.avi -c:v libx264 -crf 19 -preset slow -c:a aac -b:a 192k -ac 2 output.mp4

Convert AVI to PNG image sequence. '%05d' generates a zero padded five digit integer.

ffmpeg -i input.avi output_%05d.png

Convert PNG image sequence to MP4.

ffmpeg -framerate 30 -i tmp/frame_%05d.png -c:v libx264 -crf 19 -preset slow -c:a aac -b:a 192k -ac 2 output.mp4

Convert PNG image sequence to MP4. This one works in Quicktime.

ffmpeg -framerate 30 -i tmp/frame_%05d.png -f mp4 -vcodec libx264 -pix_fmt yuv420p output.mp4

Convert MP4 to MOV.

ffmpeg -i input.mp4 -acodec copy -vcodec copy -f mov

Crop video with the crop filter. out_w and out_h are width and height of the output rectangle. out_x and out_y are the left top corner of the output rectangle.

ffmpeg -i input.avi -filter:v "crop=out_w:out_h:out_x:out_y" output.avi

Extract a time slice of an original video. -ss is the start time, -t is the slice duration. Timestamps are in format or in seconds (s.msec).

ffmpeg -ss 00:00:30.0 -i input.avi -c copy -t 00:00:10.0 output.avi
ffmpeg -ss 30 -i input.avi -c copy -t 10 output.avi

Extract sound from video to wav.

ffmpeg -i input.mp4 -vn -acodec pcm_s16le -ar 44100 -ac 2 output.wav

Add wav audio to mp4 video

ffmpeg -i input_vid.mp4 -i input_audio.wav -vcodec copy output.mp4
ffmpeg -i input_vid.mp4 -i input_audio.wav -vcodec libx264 -acodec libmp3lame output.mp4


berliner-dom, weesperplein

You can’t perform that action at this time.