Better video streaming quality with ffmpeg
Posted: Sat Jan 29, 2011 10:43 pm
I wasn't happy with the FLV codec that was used by default with ffmpeg and the '-f flv' option, especially at low bitrates streaming to my android phone. So I did some experimenting and came up with this, which is a huge improvement over the default.
1) Optional?
Download the latest version of ffmpeg from this site:
http://ffmpeg.zeranoe.com/builds/
You can pick either the 32-bit or 64-bit build based on your system, and the static or shared build based on your preference. Unzip the contents of the 'bin' folder into your transcode folder.
The presets are no longer required, as the basic presets are built into the binary now.
2) I prefer using a BAT file on windows to simplify some of the command lines, so change your transcoding settings to:
3) In your transcode folder, create a BAT file with the following contents:
You may have to change the location of the transcode folder if yours is different.
Here are the old MP3 audio settings if you want to switch back:
4) Optionally change the libx264 preset that is used if your computer is not fast enough to use the medium preset, or if you just want to try something else.
Good luck!
1) Optional?
Download the latest version of ffmpeg from this site:
http://ffmpeg.zeranoe.com/builds/
You can pick either the 32-bit or 64-bit build based on your system, and the static or shared build based on your preference. Unzip the contents of the 'bin' folder into your transcode folder.
The presets are no longer required, as the basic presets are built into the binary now.
2) I prefer using a BAT file on windows to simplify some of the command lines, so change your transcoding settings to:
- Code: Select all
ff-flv.bat %o %s %b %w %h
3) In your transcode folder, create a BAT file with the following contents:
- Code: Select all
@echo off
setlocal
REM 1-start, 2-file, 3-bitrate, 4-width, 5-height
cd c:\subsonic\transcode
ffmpeg.exe -ss %1 -i %2 -loglevel quiet -async 30 -codec:a libvo_aacenc -b:a 128k -codec:v libx264 -b:v %3k -s %4x%5 -threads 0 -preset medium -vprofile main -f flv -
You may have to change the location of the transcode folder if yours is different.
Here are the old MP3 audio settings if you want to switch back:
- Code: Select all
-codec:a libmp3lame -ar 44100 -q:a 6
4) Optionally change the libx264 preset that is used if your computer is not fast enough to use the medium preset, or if you just want to try something else.
Good luck!