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 > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th March 2015, 02:50   #1  |  Link
resle
Registered User
 
resle's Avatar
 
Join Date: Jun 2007
Posts: 26
Encoding an almos static cartoon

Hi, I am an almost complete newbie to encoding.

I need to encode a batch of small cartoons in mp4 format for use on the web. They're 2/3 minutes long each one and almost completely static, with no full frame changes and just some character moving a little, and slowly.

Currently I am using ffmpeg with the following parameters but I am getting a 3mb file for a 2 minutes long 512x384 movie, which seems huge to me:

-b:v 192k
-s 512x384

-vcodec libx264
-acodec libmp3lame

-r 24fps
-b 192k

-y
-g 30

-pix_fmt yuv420p


Any suggestion to dramatically reduce the file size?
Thnks
resle is offline   Reply With Quote
Old 16th March 2015, 03:49   #2  |  Link
mariush
Registered User
 
Join Date: Dec 2008
Posts: 589
Reducing the audio bitrate would be a good start. A 2 minute 192kbps audio track would use about 2.8 MB. Switch to AAC 96-112 kbps and see how it goes from there.
mariush is offline   Reply With Quote
Old 16th March 2015, 04:07   #3  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
Well, obviously you would not use a bitrate mode, check crf
http://slhck.info/articles/crf

ffmpeg example
Code:
ffmpeg -i in -pix_fmt yuv420p -c:a libfdk_aac -vbr 5 -c:v libx264 -preset slow -crf 21 out.mp4
__________________
certain other member
smok3 is offline   Reply With Quote
Old 16th March 2015, 05:37   #4  |  Link
resle
Registered User
 
resle's Avatar
 
Join Date: Jun 2007
Posts: 26
Quote:
Originally Posted by smok3 View Post
Well, obviously you would not use a bitrate mode, check crf
http://slhck.info/articles/crf

ffmpeg example
Code:
ffmpeg -i in -pix_fmt yuv420p -c:a libfdk_aac -vbr 5 -c:v libx264 -preset slow -crf 21 out.mp4

FFMPeg warns me:

Codec AVOption vbr (Variable bit rate mode) specified for output file #0 (E:\desktop\result.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.

Also, I forgot to specify that audio is almost absent from the movies too. It's a bunch of educational cartoons so it's mostly silence, with some very brief sentences here and there.

I wonder how some 1920x1080 x 120min movies can be compressed down to 800mb ... that led me to believe I could squeeze my pathetic 512x384 x 2min static cartoons in 1mb or less...
resle is offline   Reply With Quote
Old 16th March 2015, 05:42   #5  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
test just video first
ffmpeg -i input.mp4 -c:v libx264 -crf 21 -an output.mp4
__________________
certain other member
smok3 is offline   Reply With Quote
Old 16th March 2015, 05:59   #6  |  Link
resle
Registered User
 
resle's Avatar
 
Join Date: Jun 2007
Posts: 26
Quote:
Originally Posted by smok3 View Post
test just video first
ffmpeg -i input.mp4 -c:v libx264 -crf 21 -an output.mp4

Getting much better but now by fiddling with CRF: even a value of 32 is still acceptable, and results in a 75% file size reduction (!!)

Now I should find a FFMPEG version with libfdk_aac compiled in. No success so far..
resle is offline   Reply With Quote
Old 16th March 2015, 06:04   #7  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
Just use whatever AAC encoder is there. (If you are on *nix/mac: ffmpeg -codecs | grep aac)
__________________
certain other member
smok3 is offline   Reply With Quote
Old 16th March 2015, 06:13   #8  |  Link
resle
Registered User
 
resle's Avatar
 
Join Date: Jun 2007
Posts: 26
Quote:
Originally Posted by smok3 View Post
Just use whatever AAC encoder is there. (If you are on *nix/mac: ffmpeg -codecs | grep aac)
Thanks for all the help. I wanted to use fdk only because the vbr parameter you suggested wouldn't work with the built-in aac encoder but I found the equivalent now.
resle is offline   Reply With Quote
Old 16th March 2015, 08:36   #9  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
p.s. also probably interesting to test is
-tune animation
__________________
certain other member
smok3 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:41.


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