Log in

View Full Version : ffmpeg can encode to mpeg2


unixfs
26th August 2003, 08:56
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

tiki4
4th September 2003, 17:04
Did you test it?

unixfs
5th September 2003, 16:01
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

tiki4
8th September 2003, 07:19
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

unixfs
8th September 2003, 08:44
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).

tiki4
8th September 2003, 10:17
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

unixfs
8th September 2003, 10:27
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 !

tiki4
8th September 2003, 12:00
I use Linux at work for quantum dynamics calculations. Unbeatable price: dual Athlon MP + Linux + Intel compilers

tiki4

LigH
23rd March 2004, 13:16
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:
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

unixfs
23rd March 2004, 13:24
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.

LigH
23rd March 2004, 13:37
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.

celtic_druid
23rd March 2004, 13:41
You could just use Nic's QuEnc instead.

LigH
23rd March 2004, 13:49
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.

celtic_druid
23rd March 2004, 13:55
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.

Nic
23rd March 2004, 14:21
@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

Amnon82
24th March 2004, 19:21
Is there a way to add AVS or ffvfw-fakeAVI support to the newest CVS of ffmpeg?

LigH
24th March 2004, 20:16
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?

Amnon82
24th March 2004, 21:53
Zero! ... :D

tickey
30th March 2004, 15:20
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

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

Amnon82
30th March 2004, 17:55
tickey my friend, I did it.

FFMPEG CVS 30.03.04 AC3 Decoding Enabled (767 KB) (http://rj-elektronik.de/avideo/files/ffmpeg.exe)

tickey
30th March 2004, 19:14
Originally posted by Amnon82
tickey my friend, I did it.

FFMPEG CVS 30.03.04 AC3 Decoding Enabled (767 KB) (http://rj-elektronik.de/avideo/files/ffmpeg.exe)
cool, thnaks dude :D checking out now.:sly:

tickey
30th March 2004, 19:49
Using the ffmpeggui3 with your ffmpeg.exe, ac3 2 channel to mp2 worked great. ac3 5 .1 to mp2 didn't make the grade. It's prolly the way the gui handles it as it is not native to it it.
I will try with a command line later and see what happens.

Amnon82
30th March 2004, 21:14
yes do this my friend. If you got the line I'll make a gui for it.
full credits to You my friend!:D

laura_glow
2nd April 2004, 22:11
sorry if this is a newbie question answered alsewhere, but i searched and found nothing...

is there a way to choose my own/any/other codec for encoding mpeg2 video in ffmpeg?

thanks

Laura

onesoul
3rd April 2004, 01:26
I can't be certain but I seriously doubt that, it's like asking if tmpeg or cce can use other than their own codec to encode.

Amnon82
11th April 2004, 23:54
Good and bad news!

The new Build can add borders now. new version 12.04.04 (http://rj-elektronik.de/avideo/files/ffmpeg.exe)

unplugged
12th April 2004, 11:54
Sorry, I haven't red lately this forum...
Is there any way or compiled ffmpeg binary that can be used to frame-serve from avisynth?

Amnon82
12th April 2004, 12:03
Update the GUI for FFMPEG. Padding is now avaible.

@unplugged: No, AVS isn't supported by FFMPEG. If someone find a way to add it most people here will be happier.

celtic_druid
12th April 2004, 13:58
Should be possible to have a little commandline util that could take an AVS and pipe it to ffmpeg. Much like what QuEnc does internally, that is if I understood how it works correctly.

LigH
12th April 2004, 17:19
ffmpeg would then have to read a stream of raw video, as far as I understood...