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 Search this Thread Display Modes
Old 24th June 2010, 11:27   #1  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
WebM encoding using ffmpeg

I'm not sure if WebM is well supported in ffmpeg, it is encoding but ignores setting a bitrate.

Code:
-i:	input
-y:	overwrite
-b:	bitrate

ffmpeg.exe -i "D:\sample.avs" -y -b 300 test.webm

-
I know there is some other command line encoder but for StaxRip it would make sense to use ffmpeg since it has many codecs StaxRip could offer a GUI for.

Last edited by stax76; 24th June 2010 at 11:31.
stax76 is offline   Reply With Quote
Old 24th June 2010, 12:05   #2  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
-b 300k
Chikuzen is offline   Reply With Quote
Old 24th June 2010, 12:13   #3  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Thanks, that's not documented, maybe I should search a tutorial instead of using the official documentation, are there any good tutorials?
stax76 is offline   Reply With Quote
Old 24th June 2010, 12:26   #4  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,641
Quote:
Originally Posted by stax76 View Post
Thanks, that's not documented
Both the bits/s unit and the k suffix are described in official documentation:

ffmpeg -h:
Quote:
-b bitrate set bitrate (in bits/s)
http://www.ffmpeg.org/ffmpeg-doc.html#SEC10
Quote:
`-b bitrate'
Set the video bitrate in bit/s (default = 200 kb/s).
http://www.ffmpeg.org/ffmpeg-doc.html#SEC7
Quote:
* To set the video bitrate of the output file to 64kbit/s:

ffmpeg -i input.avi -b 64k output.avi
nm is offline   Reply With Quote
Old 24th June 2010, 12:32   #5  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
I missed that, thanks.
stax76 is offline   Reply With Quote
Old 24th June 2010, 18:14   #6  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
another tutorial for webm encoding with ffmpeg
http://micksam7.com/blog/index.php/?p=743
Chikuzen is offline   Reply With Quote
Old 24th June 2010, 18:58   #7  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Thanks, exactly what I needed.
stax76 is offline   Reply With Quote
Old 24th June 2010, 20:51   #8  |  Link
ricardo.santos
Registered User
 
ricardo.santos's Avatar
 
Join Date: Mar 2005
Location: Portugal
Posts: 907
whatever i try ffmpeg (latest builds) give me oversized output and dont respect bitrate, if i select 450k it gives me 930k i tried several values and still the same.

i compared with other codecs (flv, h264, wmv) and at same video bitrate the ffmpeg webm output is way to big... its not a mediainfo bug... ivfenc is the only that respects video bitrate

Last edited by ricardo.santos; 24th June 2010 at 21:39.
ricardo.santos is offline   Reply With Quote
Old 4th July 2010, 11:21   #9  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
@stax76: this spreadsheet might be interesting to you, it's a ffmpeg<>ivfenc parameter mapping I started to set up (it's free to edit, so if someone finds a mistake -> fix it!).
@ricardo.santos: how do your settings look like with ffmpeg and with ivfenc ?
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 4th July 2010 at 12:16.
Selur is offline   Reply With Quote
Old 4th July 2010, 14:27   #10  |  Link
Leeloo Minaļ
Registered User
 
Join Date: Nov 2007
Posts: 50
I did a little test with a very latest FFmpeg build (24035, July 4) and Nic's ivfenc 1.5 from the following sample :
399 frames at 55fps (~ 7,25 seconds) (no audio)

ivfenc
Command line :
Code:
ivfenc.exe temp.avs temp.ivf --best --target-bitrate=700
mkvmerge.exe --timecode-scale 1000000 --disable-lacing -w temp.ivf -o temp.webm
Speed : ~ 2fps
Final size : 587 KB


ffmpeg
Command line :
Code:
ffmpeg.exe -i temp.avs -vb 700k -level 100 -an test.webm
Speed : ~ 25fps
Final size : 1,66 MB

FFmpeg does not seem to take care of parameters...

Last edited by Leeloo Minaļ; 4th July 2010 at 21:06.
Leeloo Minaļ is offline   Reply With Quote
Old 4th July 2010, 18:37   #11  |  Link
ricardo.santos
Registered User
 
ricardo.santos's Avatar
 
Join Date: Mar 2005
Location: Portugal
Posts: 907
Quote:
Originally Posted by Leeloo Minaļ View Post
ffmpeg
Command line :
Code:
ffmpeg.exe -i temp.avs -vb 700k -level 100 test.webm
Speed : ~ 25fps
Final size : 1,66 MB

FFmpeg does not seem to take care of parameters...
ffmpeg has converted the audio with default values, you need to specify "no sound" in the bat script... but even then it still oversizes

@selur
will post it later...
ricardo.santos is offline   Reply With Quote
Old 4th July 2010, 21:05   #12  |  Link
Leeloo Minaļ
Registered User
 
Join Date: Nov 2007
Posts: 50
Little typo error, i used -an in my command line to disable audio, i correct my previous post.
Leeloo Minaļ is offline   Reply With Quote
Old 5th July 2010, 00:08   #13  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
about the ffmpeg call: isn't '-vcodec libvpx_vp8' needed or is it automatically selected when an output with .webm extension is detected?
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 8th August 2010, 17:06   #14  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
@Selur

spreadsheet was very helpful, thanks

@all

I need a command line to perform a compressibility check, with x264 I just use crf 18, has anybody a idea what I could use for webm with ffmpeg?
stax76 is offline   Reply With Quote
Old 11th September 2010, 09:34   #15  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
ivfenc doesn't seem to have a 1-pass fixed quantizer mode. Might be related to the fact that WebM video has a purpose target of streaming up to a maximum bitrate.

It might be enforced by max=min quantizer options {ivfenc: --min-q=# --max-q=# | ffmpeg: -qmin # -qmax #} but possibly not without a dummy target bitrate -- to be tested how it behaves... - and if you can get a result in only 1 pass at all (I believe ifvenc creates only the stats file in the 1st, and the result only in the 2nd).
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is online now   Reply With Quote
Old 11th September 2010, 09:44   #16  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
I'll give it a try, thanks LigH.
stax76 is offline   Reply With Quote
Old 3rd May 2011, 17:10   #17  |  Link
ricardo.santos
Registered User
 
ricardo.santos's Avatar
 
Join Date: Mar 2005
Location: Portugal
Posts: 907
Hi everyone!

recently i started to test webm again with latest ffmpeg, but i still have video bitrate issues, altough i specified "-b 450k" or "-b 460800" i always end up with a video with twice as much video bitrate, i then convert the video with x264 and theora with same video and audio settings and their output has the correct bitrate and the file size is half of the webm file.

i know this has been discussed in the past but i havent managed to solve this problem, can anyone share a 2 pass webm script for ffmpeg?

Thanks
ricardo.santos is offline   Reply With Quote
Old 3rd May 2011, 17:53   #18  |  Link
ricardo.santos
Registered User
 
ricardo.santos's Avatar
 
Join Date: Mar 2005
Location: Portugal
Posts: 907
i found out why its not working, i usually do all my test encodings with HD clips, and the video bitrate doubling issue only happens with m2ts videos, here's what mediainfo says about the source file, its an LG demo:

Format : BDAV
Format/Info : Blu-ray Video
File size : 35.1 MiB
Duration : 30s 58ms
Overall bit rate : 9 785 Kbps
Maximum Overall bit rate : 35.5 Mbps

Video #0
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : 27
Duration : 29s 946ms
Bit rate mode : Variable
Bit rate : 8 610 Kbps
Maximum bit rate : 25.0 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps

i've tried 720p clips and all encodings were sucessfull without bitrate issues, is this an ffmpeg bug with 1080p videos?
ricardo.santos is offline   Reply With Quote
Old 4th May 2011, 08:49   #19  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
450 kbps for 1080 video?! What shall be the result – visual slime soup?

460800 B * 8 b/B / 1920 / 1080 / 23.976 ~ 0.074 bppf – this is ... ridiculous.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is online now   Reply With Quote
Old 14th May 2011, 21:45   #20  |  Link
ricardo.santos
Registered User
 
ricardo.santos's Avatar
 
Join Date: Mar 2005
Location: Portugal
Posts: 907
Ligh it was a test... 450k was just one of the examples... i tried with higher bitrates but same thing.

just read any video converter as webm as input/output formats, set up a test conversion and located the CMD any video converter uses with mencoder and it works, tried a 2 pass conversion but a error popped up, does anyone know how to do 2 pass with mencoder?

here's the 1 pass CMD:
Quote:
mencoder.exe -af volnorm,lavcresample=44100:channels=2 -vf scale=640:-10,harddup -ofps 23.976 -ovc lavc -lavcopts vcodec=libvpx:vbitrate=900 -of lavf -lavfopts format=webm -ffourcc VP80 -srate 44100 -oac lavc -lavcopts acodec=vorbis:abitrate=96:audio_o=global_quality=2000,flags=2 -o output.webm test.m2ts
ricardo.santos is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 07:59.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.