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 > MPEG-2 Encoding
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th August 2003, 08:56   #1  |  Link
unixfs
Registered User
 
Join Date: May 2002
Posts: 308
ffmpeg can encode to mpeg2

From one of the last patches committed:

Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory sc8-pr-cvs1:/tmp/cvs-serv21233

Modified Files:
mpegvideo.c mpegvideo.h mpeg12.c avcodec.h allcodecs.c
motion_est.c
Log Message:
mpeg2 encoding
unixfs is offline   Reply With Quote
Old 4th September 2003, 17:04   #2  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
Did you test it?
tiki4 is offline   Reply With Quote
Old 5th September 2003, 16:01   #3  |  Link
unixfs
Registered User
 
Join Date: May 2002
Posts: 308
yes, it's very fast (28 fps on my athlon xp 1500) and generally very good, but it still has many blocks on large black areas.
I was told to tune the value of scplx_mask, but I still haven't tested it
unixfs is offline   Reply With Quote
Old 8th September 2003, 07:19   #4  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
Actually I wanted to to a little investigation into video transcoding in Linux. As ffmpeg comes from the *NIX world, do you know how people usually encode mpeg2 with Linux tools? I should seriously do a little searching the net, but I never had time for that.

tiki4
tiki4 is offline   Reply With Quote
Old 8th September 2003, 08:44   #5  |  Link
unixfs
Registered User
 
Join Date: May 2002
Posts: 308
Usually mpeg2enc (from mjpegtools) and transcode (which uses mpeg2enc), but with the last mencoder (from mplayer cvs) you have a new option, which is both very fast (as opposed to the others) and very good (with the right settings).
unixfs is offline   Reply With Quote
Old 8th September 2003, 10:17   #6  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
I just read in the Linux forum that mencoder also uses the ffmpeg mpeg2 encoder module. I guess I should seriously do some testing. The problem with MPEG2 is that SVCD bitrates really need a high quality encoder otherwise you just get crap. I'm doing TV captures and transcode to MPEG2 (I also keep them interlaced). At the moment I use TMPGEnc as it seems to me performing a little better on interlaced material than CCE... It's a shame that video editing and encoding came so late to Linux.

Cheers,

tiki4
tiki4 is offline   Reply With Quote
Old 8th September 2003, 10:27   #7  |  Link
unixfs
Registered User
 
Join Date: May 2002
Posts: 308
Yesterday I used this command:

mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg2video:vhq:vrc_maxrate=9000:keyint=25:vbitrate=1500:scplx_mask=0.2:vpass=1 -o /dev/null -vf scale=480:400,expand=480:576 orig.mpg

mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg2video:vhq:vrc_maxrate=9000:keyint=25:vbitrate=1500:scplx_mask=0.2:vpass=2 -o dest.avi -vf scale=480:400,expand=480:576 orig.mpg

and was quite satisfied with the result.

You should experiment a bit with vrc_maxrate and scplx_mask (man mencoder will help), and if you want you can add vmax_b_frames=<N> (I never use bframes).

Yes, it's a pity that video editing came so late to linux, especially considering that few days ago I was burning a dvd and at the same time encoding a movie and developing/compiling mplayer without a heavy loss of interactivity; evidently the platform shows to be much better at multitasking than a supposedly multimedia OS such as windows. And my pc is only an Athlon xp 1500, not a P4 3.2 !
unixfs is offline   Reply With Quote
Old 8th September 2003, 12:00   #8  |  Link
tiki4
Registered User
 
tiki4's Avatar
 
Join Date: Dec 2001
Location: Who Knows?
Posts: 929
I use Linux at work for quantum dynamics calculations. Unbeatable price: dual Athlon MP + Linux + Intel compilers

tiki4
tiki4 is offline   Reply With Quote
Old 23rd March 2004, 13:16   #9  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,784
Someone said that ffmpeg can encode MPEG-2 video... Well, I tried that with the version 0.4.8 included in the package of "ffmpegGUI beta 0.3" (this GUI version is only able to encode AC-3 audio with a fixed source, but a full ffmpeg.exe was also included).

No matter which kind of values I enter for the desired bitrate (the help says I have to tell it in kbps), ffmpeg always assumes "2 kbps". I really doubt that I made a mistake with the command line parameters; but if you would like to check, here for the first pass:
Quote:
ffmpeg.exe -i source -y -target dvd -hq -b 6000 -r 25 -aspect 16:9 -vcodec mpeg2video -pass 1 -passlogfile logfile -g 12 -bf 2 target
LigH is offline   Reply With Quote
Old 23rd March 2004, 13:24   #10  |  Link
unixfs
Registered User
 
Join Date: May 2002
Posts: 308
04.8 is very old; you should upgrade to the latest cvs version.
I could make an encode with 2500 kb/s, so I'm sure it can use
higher bitrates.
unixfs is offline   Reply With Quote
Old 23rd March 2004, 13:37   #11  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,784
If I knew where to download current Win32 builds, I would download one. But without any C compiler, the sources from the SourceForge project are not useful for me.
LigH is offline   Reply With Quote
Old 23rd March 2004, 13:41   #12  |  Link
celtic_druid
Registered User
 
celtic_druid's Avatar
 
Join Date: Oct 2001
Location: Melbourne, Australia
Posts: 2,171
You could just use Nic's QuEnc instead.
celtic_druid is offline   Reply With Quote
Old 23rd March 2004, 13:49   #13  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,784
Yes, I know - I already tried that, and it works fine with AviSynth 2.5 sources in YV12. But ... I started experiencing the world of video conversion, when there were only CLI tools (do you remember MPEG2AVI 1.2c?), so I'm still curious to use CLI tools even today, when almost no one needs to use a command line anymore.
LigH is offline   Reply With Quote
Old 23rd March 2004, 13:55   #14  |  Link
celtic_druid
Registered User
 
celtic_druid's Avatar
 
Join Date: Oct 2001
Location: Melbourne, Australia
Posts: 2,171
Latest version:
Beta Build 3 (February 26, 2004)

Other info:
ffmpegGUI Beta Build 3 contains latest ffmpeg CVS 2004-02-26 where the ac3 bug has been fixed(hopefully, report how it works here ).

26 of Feb ain't that long ago.

Could probably post a current CVS build if you want though? Last compile I did was I think on the 5th.
celtic_druid is offline   Reply With Quote
Old 23rd March 2004, 14:21   #15  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,285
@Ligh: You can still use QuEnc as CLI....type QuEnc /? to get a list of options

...But, here's a ffmpeg for you:
http://nic.dnsalias.com/ffmpeg.exe

-Nic
Nic is offline   Reply With Quote
Old 24th March 2004, 19:21   #16  |  Link
Amnon82
Paldo-GNU/LinuxMaintainer
 
Amnon82's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 1,580
Is there a way to add AVS or ffvfw-fakeAVI support to the newest CVS of ffmpeg?
Amnon82 is offline   Reply With Quote
Old 24th March 2004, 20:16   #17  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,784
It seems that ffmpeg really wants to be platform-independent, and therefore needs to be able to decode any input with own routines. Besides the Windows platform, AviSynth will probably not exist anywhere else - or how important do you think is the AVI file format in Linux or MacOS?
LigH is offline   Reply With Quote
Old 24th March 2004, 21:53   #18  |  Link
Amnon82
Paldo-GNU/LinuxMaintainer
 
Amnon82's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 1,580
Zero! ...
Amnon82 is offline   Reply With Quote
Old 30th March 2004, 15:20   #19  |  Link
tickey
Registered User
 
Join Date: Dec 2003
Posts: 54
Quote:
Originally posted by Nic
@Ligh: You can still use QuEnc as CLI....type QuEnc /? to get a list of options

...But, here's a ffmpeg for you:
http://nic.dnsalias.com/ffmpeg.exe

-Nic
Is ac3 decoding enabled on this build?
From: http://ffmpeg.sourceforge.net/faq.html
Quote:
1.7 Why Audio is not decoded in VOB files ?
AC3 decoding is optional as the codec is currently released under the GPL. Enable it with ./configure --enable-a52. Take care: by enabling AC3, you automatically change the license of libavcodec from LGPL to GPL
tickey is offline   Reply With Quote
Old 30th March 2004, 17:55   #20  |  Link
Amnon82
Paldo-GNU/LinuxMaintainer
 
Amnon82's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 1,580
tickey my friend, I did it.

FFMPEG CVS 30.03.04 AC3 Decoding Enabled (767 KB)

Last edited by Amnon82; 30th March 2004 at 18:04.
Amnon82 is offline   Reply With Quote
Reply


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 02:53.


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