Coder Social home page Coder Social logo

htmlvid's Introduction

htmlvid

An FFmpeg wrapper for creating HTML5 snippets of videos.

Overview

htmlvid is a command line tool that lets you easily extract parts of videos so that you can share them online. It lets you choose between the WebM and MP4 formats, which are becoming increasingly dominant on the web as HTML5 video formats. (Even Twitter and Imgur use them for GIFs) These provide numerous advantages over the outdated GIF format including more colors, immensely smaller filesizes, and smoother playback.

htmlvid is written in Python. It uses FFmpeg to encode videos. It's only dependency is configargparse. (For config file support)

Features

Easy to use.

You just need to set the start time and duration and you're good to go. No need to write a complicated FFmpeg command.

Sane defaults.

If you were to just use FFmpeg without specifying options like -b:v and -crf, the default quality would be abysmal. htmlvid chooses recommended defaults that give you a good output quality.

Get your desired quality easily

It's very easy to tweak the quality and bitrate to your liking. Fast action scenes looking blurry? Just add more bitrate. Have a huge 1920p video? Just set the output width and you'll get a file that is easier to share. You can even set a size limit on the output file.

Configurable

You can set every option that you can specify on the command line in a config file. You can even use presets by choosing custom config files.

Filters

FFmpeg has a large amount of filters. The most useful ones are integrated directly into htmlvidfor doing things like scaling the video and embedding subtitles. If you find you need to use more filters, just give them to htmlvid (-F) and it'll pass them along.

Example usage

Here's a simple command to create a 5-second WebM from 5 minutes and 10 seconds into a video:

htmlvid -s 5:10 -t 5 -o snippet.webm video.mkv

Here's a slightly more advanced command for creating a MP4 of a movie from the specified time ranges, limiting the size to 2 Megabytes, with a width of 400 pixels.

htmlvid -f mp4 -s 40:26.324 -t 40:38 -l 2M -w 400 movie.mkv

Installing

Please see installing.md

How to use

For help using htmlvid, run it with the -h option to see a nice help message detailing each option. Technically, the only required option is the path to the video, but you'll most likely want to set the start time and video duration each time also. You can also tweak the default quality and bitrate.

The default config file is located at ~/.htmlvid. Instructions for the config file and possible values for each option are documented inside the config file.

For more help see faq.md.

License

htmlvid is licensed under the MIT license.

References

htmlvid's People

Contributors

razasyedh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.