Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs

Reply
 
Thread Tools Display Modes
Old 26th April 2007, 21:34   #1  |  Link
Thunder.m
Registered User
 
Join Date: Apr 2007
Posts: 4
Better quality with ffmpeg and flash video

Hi, if you would like to incerase quality (at same bitrate) of encoding videos to ffmpeg flv format, you can.

Original article (czech):
http://www.abclinuxu.cz/blog/mirek/2007/4/21/177482

Script to convert video to three different quality settings.

Code:
#!/bin/bash                                                                                                                                              
                                                                                                                                                         
AUDIO_LOW="-acodec mp3 -ab 32k -ac 1 -ar 22050"                                                                                                          
VIDEO_LOW="-f flv -deinterlace -nr 500 -croptop 4 -cropbottom 4 -cropleft 8 -cropright 8 -s 160x120 -aspect 4:3 -r 25 -b 100k"                           
AUDIO_MIDDLE="-acodec mp3 -ab 48k -ac 1 -ar 44100"                                                                                                       
VIDEO_MIDDLE="-f flv -deinterlace -nr 500 -croptop 4 -cropbottom 4 -cropleft 8 -cropright 8 -s 320x240 -aspect 4:3 -r 25 -b 270k"                        
AUDIO_HIGH="-acodec mp3 -ab 64k -ac 2 -ar 44100"                                                                                                         
VIDEO_HIGH="-f flv -deinterlace -nr 500 -croptop 4 -cropbottom 4 -cropleft 8 -cropright 8 -s 640x480 -aspect 4:3 -r 25 -b 650k"                          
PARAM="-me_range 25 -i_qfactor 0.71 -g 500"  

if [ -f "$1" ]; then                                                                                                                                     
    ffmpeg -i "$1" $AUDIO_LOW $VIDEO_LOW $PARAM -pass 1 -y "low_`echo $1 | cut -d. -f1`.flv"                                                             
    ffmpeg -i "$1" $AUDIO_LOW $VIDEO_LOW $PARAM -pass 2 -y "low_`echo $1 | cut -d. -f1`.flv"                                                             
    ffmpeg -i "$1" $AUDIO_MIDDLE $VIDEO_MIDDLE $PARAM -pass 1 -y "middle_`echo $1 | cut -d. -f1`.flv"                                                    
    ffmpeg -i "$1" $AUDIO_MIDDLE $VIDEO_MIDDLE $PARAM -pass 2 -y "middle_`echo $1 | cut -d. -f1`.flv"                                                    
    ffmpeg -i "$1" $AUDIO_HIGH $VIDEO_HIGH $PARAM -pass 1 -y "high_`echo $1 | cut -d. -f1`.flv"                                                          
    ffmpeg -i "$1" $AUDIO_HIGH $VIDEO_HIGH $PARAM -pass 2 -y "high_`echo $1 | cut -d. -f1`.flv"  
fi
Thunder.m is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:56.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.