Mansi
Mansi

Reputation: 55

blur an mp4 video for website background

I am putting a video in the background of my web page. I want to blur the background for which I tried to put the following attribute in video tag:

 <video -webkit-filter: blur(15px); -moz-filter: blur(15px);-o-filter: blur(15px);-ms-filter: blur(15px);filter: blur(15px);">

the video runs very slow due to blurring the background within HTML. So, now I am trying to blur the original video. I tried to use ffmpeg (here):

ffmpeg -i input.avi -vf "boxblur=enable='between(t,start,end)'" -codec:a copy output.avi

But the filter used in ffmpeg seems to be deprecated. I have tried few filters of "avconv", but no filter seems to "blur" the video. Please let me know if there is any other command line tool which I can use for this purpose or even if I am missing any filter in ffmpeg or avconv.

UPDATE: Console output for ffmpeg:

ffmpeg -i output.mp4 -vf "boxblur=enable='between(t,0,15)'" -codec:a copy output1.mp4
ffmpeg version 2.8.3 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --disable-yasm
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2015-04-08 13:38:10
    encoder         : Lavf54.20.4
  Duration: 00:00:29.40, start: 0.000000, bitrate: 1909 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1024x1024 [SAR 16:9 DAR 16:9], 1905 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2015-04-08 13:38:10
      handler_name    : VideoHandler
[AVFilterGraph @ 0x1db5140] No such filter: 'boxblur'

Upvotes: 2

Views: 998

Answers (1)

llogan
llogan

Reputation: 133723

GPL

The boxblur filter license is GPL, so that requires ffmpeg to be compiled with the --enable-gpl configure option. Recompile, or just download a static build.

Alternative filters

Alternatively, you could use a different filter such as sab, smartblur, or unsharp.

Other stuff

Since the video is for the web, consider adding -movflags +faststart as an output option so the video may begin playback before it is completely downloaded by the viewer. You may also increase the -crf value (default 23), because it will be blurred you can probably use a lower quality.

Upvotes: 2

Related Questions