ffmpeg: converting an avi to a reduced, shareable flv/mp4...

Posted by meder on Super User See other posts from Super User or by meder
Published on 2009-11-19T11:50:27Z Indexed on 2010/05/10 23:34 UTC
Read the original article Hit count: 315

Filed under:
|
|
|
|

I recently followed a guide and recompiled my ffmpeg so x264 is enabled. I used some generic settings to convert my 700 MB avi file to a mp4 file, the result was a 407MB mp4 file.

The original avi file's settings:

Codec: DX50
Resolution: 704x304
Frame rate: 23.976023

Stream 1
Codec: mpga
Type: Audio
Channels: 2
Sample rate: 48000 Hz
Bitrate 179 kb/s

Command I used:

ffmpeg -i input.avi -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre hq -crf 22 -threads 0 output.mp4

The settings of the output file (output.mp4):

Codec: avc1
Resolution: 704x304
Display resolution: 704x304
Frame rate: 11.988011

Stream 1
Codec: mp4a
Type: Audio
Channels: 2
Sample Rate: 48000 Hz
Bits per sample: 16
Bitrate: 1536 kb/s

The quality of the output mp4 is pretty nice, it seems as if it's pretty much the same as the original source. However, I'm trying to reduce the filesize and I'm not really sure whether I should go with an flv format or keep it mp4. The advantage the flv would have obviously is that it would be playable with a flash player ( I have come across some swf players which take a flash parameter to play an flv file ).. but maybe I could use the video element, as I'm only going to be displaying this video privately so I don't have to worry about supporting legacy browsers such as IE.

Can someone recommend some settings to specify in order for the filesize to be around ~100-150MB or so? I don't mind a reduction in quality, nor do I mind resizing it - I was going to do it initially but I wasn't sure what the guidelines were ( if any ) for dealing with resolution.. since this video's is 704x304 would it still be ok if I forced it into one that isn't perfectly fit for the aspect ratio? I have no clue about that part. I realize that I could have probably specified 28 instead of 22 for the CRF, I'm not sure if I should do that as opposed to maybe specifying smaller resolution, which might make it smaller as well?

© Super User or respective owner

Related posts about ffmpeg

  • how to install ffmpeg in cpanel

    as seen on Super User - Search for 'Super User'
    i'm using dedicated server(linux) so i need to install ffmpeg in cpanel so here ffmpeg i found in Main Software Install a Perl Module but i writing script in php so how can i install ffmpeg phpperl when i'am trying to install ffmpeg in perl module i get this response Checking C compiler… >>> More

  • FFMpeg-PHP Installation Error

    as seen on Server Fault - Search for 'Server Fault'
    While installing FFmpeg-PHP, I got this interesting error: /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function 'zim_ffmpeg_movie_getAudioStreamId': /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1051: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function) /usr/downloads/ffmpeg-php-0… >>> More

  • git problems installing stuff [closed]

    as seen on Super User - Search for 'Super User'
    root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~#… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    Hi, I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

Related posts about flv