📜 ⬆️ ⬇️

AVCONV - video conversion for video tags HTML5 and the imposition of watermark

To a good post habrahabr.ru/post/171213

Some time ago, FFMPEG in Ubuntu announced non grata. A replacement project, AVCONV, is being developed as a replacement.

The principle of operation is similar, but there are some minor differences.
')
I will give an example of solving a popular task - preparing a video for publication in the HTML5 video tag.

  1. Convert a video from arbitrary format to a set of FLV, MP4 and OGV
  2. Impose watermark



#!/bin/sh avconv -i $1 -vf "movie=$3 [wm];[in][wm] overlay=5:5 [out]" -ar 44100 -ab 128k -f flv -vcodec flv -vb 1000k $2.flv avconv -i $1 -vf "movie=$3 [wm];[in][wm] overlay=5:5 [out]" -ab 128k -vcodec libx264 -vb 1000k $2.mp4 avconv -i $1 -vf "movie=$3 [wm];[in][wm] overlay=5:5 [out]" -ab 128k -vcodec libtheora -acodec libvorbis -vb 1000k $2.ogv 


  1. Save to file, for example encode.sh
  2. We give the right to perform
  3. Call as ./encode.sh {FROM} {TO} {WATERMARK}


Options
{FROM} - full path to the source video
{TO} - the path to the result, without extension
{WATERMARK} - full path to the watermark

As a watermark PNG with alpha reliably works.

You can modify in any way, at your discretion.

It can be made a function of CMS, but it is necessary to provide that the interpreter does not hang, waiting for the end of decoding. For PHP, it is decided by the script output direction in / dev / null. I will not give details, since much has already been written about this in Habré.

Source: https://habr.com/ru/post/171225/


All Articles