VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member
    Join Date
    Oct 2010
    Location
    Brisvegas, Australia
    Search Comp PM
    Hi,

    How do i set a bitrate here? I'm doing

    ffmpeg.exe -i in.wmv -acodec libvorbis -ac 2 -ab 64k -ar 48000 -s 480×270 out.webm

    Is a variable bitrate possible with ffmpeg? How can I do multiple passes?
    I don't know what most of these switches mean, i just copied this template from somewhere.

    I'm using the latest build of the 0.6 branch (?)

    FFmpeg version SVN-r25603, Copyright (c) 2000-2010 the FFmpeg developers
    built on Oct 30 2010 04:06:46 with gcc 4.4.2


    Thanks!
    Quote Quote  
  2. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Hi
    Your basic command is like this:-
    Code:
    ffmpeg.exe -i in.wmv -acodec libvorbis -vcodec libvpx out.webm
    This will give you a webm file with Vorbis audio at 128Kbps and VP8 video at 200Kbps.

    If you want to change the audio bitrate then add a 'quality' parameter like this:-
    Code:
     ffmpeg.exe -i in.wmv -acodec libvorbis -aq 6 -vcodec libvpx out.webm
    (There's a chart at Wikipedia here:- http://en.wikipedia.org/wiki/Vorbis )

    If you want to change the video bitrate then add a parameter like this:-
    Code:
     ffmpeg.exe -i in.wmv -acodec libvorbis -aq 6 -vcodec libvpx -b 512k out.webm
    It is possible to use 2-pass encoding with ffmpeg and webm.
    With Linux I've used commands like this:-
    Code:
    ffmpeg -i foo -pass 1 -vcodec libvpx -b 512k -f rawvideo -an /dev/null && ffmpeg -i foo -pass 2 -acodec libvorbis -aq 6 -vcodec libvpx -b 512k output.webm
    With the first pass audio isn't encoded (that's why -an parameter is used).
    The video isn't needed (dumped to /dev/null).
    Then the second pass encodes the audio and encodes the video using information gathered in the first pass.
    There's probably a similar command to use with Windows.

    PS
    The -s switch in your original command sets the picture size.
    It's recommended not to use switches like this:- -ac 2 -ab 64k -ar 48000 for Vorbis. Just use the -aq switch instead.
    Last edited by bat999; 30th Oct 2010 at 09:20.
    Quote Quote  
  3. Member ricardouk's Avatar
    Join Date
    Mar 2005
    Location
    Portugal
    Search Comp PM
    you shouldnt use ffmpeg to convert to webm, ffmpeg oversizes the final output and its muxer cause playback problems on browsers

    use Nic's ivfenc with avs support to create "proper" webm files:

    the following example will create a video with 650k video bitrate, audio at 64K @44100
    Code:
    ivfenc --target-bitrate=650 01.avs out.ivf -p 2
    ffmpeg -i 01.avs -acodec pcm_s16le -vn out.wav
    oggenc2.exe --resample 44100 -b 64 out.wav
    mkvmerge --timecode-scale 1000000 --disable-lacing out.ivf out.ogg -o out.webm

    http://forum.doom9.org/showthread.php?p=1442219#post1442219
    Last edited by ricardouk; 30th Oct 2010 at 15:30.
    I love it when a plan comes together!
    Quote Quote  
  4. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    @ricardouk
    I don't know who your post is directed to.
    I only hope you're not trying to tell me which software I should and shouldn't use.
    Quote Quote  
  5. Member ricardouk's Avatar
    Join Date
    Mar 2005
    Location
    Portugal
    Search Comp PM
    by not having english as my first language might cause "interpretation" issues, all i was doing was sharing info like i usually do since i joined videohelp.

    I noticed you suggested ffmpeg and when i said "shouldn't" its more like an "i dont advise to use it"

    quick experiment:

    convert an sample video with ffmpeg, ivfenc (now called vpxenc i think) and makewebm, if you use the same audio/video bitrate with all of them they should produce a file with more or less the same size but ffmpeg oversizes the file, this has been discussed over at doom9 and you can check the results and findings over there (you wont see much difference on a 1 min video sample but try a 10min video and you'll notice it), the ffmpeg muxer has its issues as well and after reading your post i voiced my opinion taking in consideration what i read and learned.

    in no way im saying you should not use ffmpeg altough i can understand why my comment wasnt understood as i wanted.

    when i said "shouldn't" i meant "i dont advise", its one of the quirks of an international forum.
    Last edited by ricardouk; 30th Oct 2010 at 18:07.
    I love it when a plan comes together!
    Quote Quote  
  6. Member
    Join Date
    Oct 2010
    Location
    Brisvegas, Australia
    Search Comp PM
    I can see how ffmpeg does something to the file size because when i go
    Code:
    ffmpeg.exe -i in.wmv -acodec libvorbis -aq 1 -vcodec libvpx -s 480×270 -b 150k out.webm
    for a 20 minute clip the file size is 82.8MB. When I go
    Code:
    ffmpeg.exe -i in.wmv -acodec libvorbis -aq 1 -vcodec libvpx -s 480×270 -b 200k out.webm
    for the same clip the file size is 83.6MB

    the only problem I have with ricardouk's method is that my input file needs to be a AVS. How do I make an AVS?
    Quote Quote  
  7. Member
    Join Date
    Oct 2010
    Location
    Brisvegas, Australia
    Search Comp PM
    just a thought. I downloaded the latest ffmpeg build from here
    http://ffmpeg.arrozcru.org/autobuilds/
    would these latest builds have the latest libvpx (0.95)?
    http://code.google.com/p/webm/downloads/list
    Quote Quote  
  8. Member ricardouk's Avatar
    Join Date
    Mar 2005
    Location
    Portugal
    Search Comp PM
    on first example you used 150 as video bitrate on the second one you used 200 thts why you have 2 differente sizes.

    my example needs avs input but you can use Autowebm (its a gui for ivfenc and makewebm)

    http://forum.doom9.org/showthread.php?p=1410895#post1410895
    I love it when a plan comes together!
    Quote Quote  
  9. Member
    Join Date
    Oct 2010
    Location
    Brisvegas, Australia
    Search Comp PM
    my point is shouldn't a 150k file be much smaller?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!