• Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    JavaScript
  • Created almost 10 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

High quality video encoding for modern web in golang

videq

videq

High quality video encoding for modern web in golang

Project links and final notes

Inspiration

We work in digital agency and we build a lot of websites that use videos (full screen, background, interviews, product showcase etc.). Developing compatible cross platform/browser website is a technical nightmare due to thrilling mix of โ€œhistoricalโ€ and "future" standards. In relation to video playback - that means if we want a video on website to be playable on most platforms we need ad least 3 different video formats:

  • H.264+AAC+MP4 - Safari, Chrome, Firefox (new versions), IE
  • Theora+Vorbis+Ogg โ€“ Firefox
  • WebM - Chrome, IE

Each format has its own limitations and settings that must be applied in order to get most compatible and excellent looking output, using free converters available to general public.

The problem(s)

In order to convert one video to specified output formats you need different multidisciplinary knowledge, different desktop software, time and patience. When you are building something under deadline, there is no time and patience, so we wanted it to make it simple for anybody to use (but itโ€™s mostly for web developers).

Uploads of big files via web browser have always been one of big issues on the web. Hopefully we managed to solve ti by breaking the file in chunks and handling upload of each chunk.

Solution

An UX friendly, easy to use website/webapp for re-coding video files to โ€žsafe for webโ€œ video formats. User drags videos, waits, downloads converted videos+html+fallback static image/anim gif. Added bonus - it can easily be installed locally for team usage (to save time on uploading to internet server)

How it works

User drags file to browser (or selects it), and the file is broken into chunks. We start uploading first chunk and right after first chunk is uploaded to the server, server checks if this is a video file suitable for encoding (is it a video file, is it too big, too long etc). If everything is ok we proceeds with upload and encoding. If upload breaks or stops at some point, user can drag file again and resume. It will be uploaded from last uploaded chunk. Video encoding is done in queue with help of go workers. First we double pass encode mp4 file which is then base for ogg and webm files. After all files are created, we output it to the user.

How to use

  • Download and compile go get -u -v https://github.com/gophergala/videq
  • create config file File has to be present in ./conf/ folder and named eg: ubuntu.config.ini, where ubuntu is the name of server on which it is being run. you get it with uname -n
[http]
HOSTNAME = "localhost"
LISTENADDRESS = ":8080"

[db]
HOST="localhost"
NAME="videq"
USER="root"
PASS="XXX"
DEBUG=false
  • create and import empty database
mysql -u root -p < sql/create_db.sql
mysql -u root -p videq < sql/empty_db.sql

Prerequisites

  • server running Ubuntu 14.04 LTS - project was developed on 14.04, possible it could work on anything but we did not have time to test it
  • preinstalled server side applications:
    • golang (tested with 1.4.1),
    • mysql (tested on 5.5.40-0ubuntu0.14.04.1 (Ubuntu)),
    • ffmpeg (tested on 1.2.6-7:1.2.6-1~trusty1),
    • HandBrakeCLI (0.10.0)
    • ffmpeg2theora (0.29)

Tools used in this project

Challenges we ran into

  • Big file upload
  • Agile golang development
  • Development of go app on Windows which uses Unix only server side stuff.

Accomplishments that we are proud of

We managed to get MVP in just two days. :)

What we learned

We are new in golang and we used this hackaton to learn more about:

  • chunked uploads handling (for extreme large files)
  • team workflow on short deadline golang projects

What's next for videq

  • more encoding options for quality
  • graceful restart
  • scalable (multi server workers) โ€ฆ if we manage in that short time we haveโ€ฆ
  • move all configurable params to config
  • cleanup
  • send email when encoding is done
  • ...

The Team

Big shout to fine http://nivas.hr Videq team members:

More Repositories

1

learn-Go-the-hard-way

learn Go by coding.
Go
391
star
2

go-algos

Go
140
star
3

golab

A 2-dimensional Labyrinth game.
Go
79
star
4

go_report

A report card for your Go application
Go
78
star
5

dnsp

A DNS Proxy
Go
69
star
6

appstract

Visualize go programs in a graph to create an overview of its structure by scanning a GitHub repository
Go
43
star
7

docker-bastion

A helper for replacing VMs with docker in shared environment.
Go
28
star
8

gopherling

Stress/load testing webapp written in Golang !
JavaScript
23
star
9

authy

Authy is a go library that acts as an oauth authentication middleware for net/http, continued at https://github.com/christopherobin/authy
Go
19
star
10

wisdom

Wisdom is a Startup Quote API
Go
16
star
11

go_ne

GoKiss! - A plugin-based server automation and deployment tool written in Go - aka a highly configurable task runner!
Go
16
star
12

go-tasky

Go-Tasky is a simple go tool that makes it easy to expose server side tasks with a RESTful api.
Go
16
star
13

gopher_talkie

Secure voice messaging tool for geeks
Go
15
star
14

goIRC

Go
15
star
15

tlen

Simple text-based adventure game for Android, written using native SDK entirely in Go
Go
14
star
16

stk

Captures stderr and search for reason on Stackoverflow
Go
14
star
17

circle

File management for the masses
Go
13
star
18

scpm

Async copy files to multiple servers
Go
10
star
19

goloso

Goloso is an Ansible callback server over NSQ
Go
9
star
20

api-fs

Go
9
star
21

sbuca

Simple But Useful Certificate Authority
Go
9
star
22

i_love_indexes

JavaScript
7
star
23

docket

Docket - Custom docker registry that allows for deploys through bittorrent
Go
7
star
24

tweet_words

Go
7
star
25

food-plan-organizer

Stay healthy by checking nutrition facts & manage your favourite paleo diet recipes.
Go
7
star
26

color

Syntax highlighting for streamed terminal Go text.
Go
6
star
27

launcher

Web application to run scripts on remote hosts
Go
6
star
28

watchtower

Watchtower is a service for easily interacting between many different kinds of devices in (almost) real-time. Think https://pusher.com but for devices ranging from PCโ€™s all the way down to Arduinos with only the barest of network stacks.
Go
6
star
29

goFire

JavaScript
5
star
30

gogala

An online text editor with chat and multi user features - don't ask why the repo is tagged as JavaScript ?ยฟ
Go
5
star
31

nedomi

HTTP media cache server
Go
5
star
32

echodb

NoSQL on wire
JavaScript
5
star
33

publikey

Go
4
star
34

opentweet

An open distributed tweeting protocol
JavaScript
4
star
35

idict

Go
4
star
36

honeybee

Monitor all your TCP connections between all your servers.
Go
4
star
37

ging

A search tool for GoDoc
Go
4
star
38

gorgonzola

Simple Json-job board
Go
4
star
39

heatingeffect

Go
4
star
40

matching-snuggies

A remote slicer for 3D printers
Go
4
star
41

gomegam

Go
4
star
42

sqldump

Small tool for database administration
Go
3
star
43

tron

Go
3
star
44

aeris

Go
3
star
45

gotop

Go
3
star
46

gomp

Go
3
star
47

kasperbrett

JavaScript
3
star
48

blinky_light_display

Go
3
star
49

test2doc

Go
3
star
50

serradacapivara

Showcase of Serra da Capivara Park
JavaScript
3
star
51

gomua

Mail User Agent
Go
2
star
52

cheppirc

Go
2
star
53

what_the_movie

Find out what the movie is you are watching by uploading a photo
Go
2
star
54

Find-A-Parking

CSS
2
star
55

application-framework

Go
2
star
56

uptimed

uptime for humans
Go
2
star
57

Gift

Gift: geo located gif files
CSS
2
star
58

GopherKombat

Go
2
star
59

TypingGeeks

The will-to-be best Typing Game ever in Golang!
Go
2
star
60

FeedBag

TV first, multiuser Github events dashboard for organizations and teams.
Go
2
star
61

cmdporter

Go
2
star
62

correct-horse-battery-staple

Go
2
star
63

go-llama

JavaScript
1
star
64

go_warrior

Go
1
star
65

not_golang_experts

Go
1
star
66

csgo_parser

Demo file parser for Counter-Strike: Global Offensive
Go
1
star
67

catarang

Go
1
star
68

teamOFP

Spotify Remote
Go
1
star
69

TinyEmbassy

Go
1
star
70

dshash

Go
1
star
71

shark_sandwich

Distributed multiplayer text-based RPG game with a shareable storage engine
Go
1
star
72

gogalamon

Go
1
star
73

one_day_of_earth

Web Application, to view how lived Earth this one day
CSS
1
star
74

edrans-smartcity

Go
1
star
75

coco

1
star
76

revisor

Go
1
star
77

JSONup

JSON โž” Up?
Go
1
star
78

robostats

Go
1
star
79

go15estebarb

Go
1
star
80

sheet_layout_project

Go
1
star
81

SmashGif

Go
1
star
82

panopticon

Monitor your (computer-based) activities. Review search, tag, categorize.
JavaScript
1
star