digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   FFMPEG: Another try: mencoder (http://www.digitalfaq.com/archives/encode/6109-ffmpeg-mencoder.html)

Razorblade2000 10-14-2003 02:36 PM

Another try: mencoder
 
Should give the same quality as ffmpeg (both use same codec for mpeg1)

CURRENT TRY:
MOVIE:
mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video:vbitrate=750:keyint=25:mbd=2:vrc _minrate=300:vrc_maxrate=2400:vrc_buf_size=320:int ra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,3 4,37,12,14,18,27,29,34,37,38,22,26,27,31,36,37,38, 40,26,27,29,36,39,38,40,48,27,29,34,37,38,40,48,58 ,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79:i nter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26 ,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,3 2,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36, 38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42 ,44 -nosound -vf pp=hb/vb/dr/al/tn:1:2:3,noise=luma[h]:chroma[h],scale=352:166,expand=352:288,denoise3d=4:3:6 -ssf lgb=0.3 -ssf cgb=0.3 '/windows/E/Some.avi' -o '/windows/E/Encoded.mpg'



CARTOON (just for Fun... "blur that s**t out and sharp it back in):
mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video:vbitrate=500:keyint=25:mbd=2:vrc _maxrate=2400:vrc_buf_size=320:intra_matrix=8,9,12 ,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27 ,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,3 9,38,40,48,27,29,34,37,38,40,48,58,29,34,37,38,40, 48,58,69,34,37,38,40,48,58,69,79:inter_matrix=16,1 8,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22, 24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28 ,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,3 4,36,38,42,42,30,32,34,36,38,40,42,44 -nosound -vf pp=hb/vb/dr/al/tn,scale=352:288,denoise3d=7:7:7 -ssf lgb=2 -ssf cgb=2 -ssf ls=30 -ssf cs=30 '/windows/g/Family Guy - Episode 306 - Death Lives.avi' -o '/windows/E/FGTST.mpg'


This Movie test does:
full postprocessing + add noise + resizes+ adds black borders + + blurs chroma and luma + encodes an avi @ a gop lenth of 25 +kvcd matrix (thx japie... copied this from u... don't sue me ;) )


the good thing:
-this tool can use FILTERS!!!! (denoising, post processing)
-he can add black borders and thus keep the aspect ratio fine :-D (great for avi files)
-he can cut black borders and add new ones (black isn't always black...)
-he can do lots of other thnigs...

I just dont really know all the options :-(


EDIT:
nice to play with:


-ssf <mode>
Specifies SwScaler parameters.

EXAMPLE
-vf scale -ssf lgb=3.0

lgb=<0-100>
Gaussian blur filter (luma)
cgb=<0-100>
Gaussian blur filter (chroma)
ls=<0-100>
sharpen filter (luma)
cs=<0-100>
sharpen filter (chroma)
chs=<h>
chroma horizontal shifting
cvs=<v>
chroma vertical shifting



-sws <software scaler type> (see -vf scale option too)
This option sets the quality (and speed, respec*
tively) of the software scaler, with the -zoom op*
tion. For example with x11 or other outputs which
lack hardware acceleration. Possible settings are:

NOTE:
For -sws 2 and 7, the sharpness can be set with the
scaling parameter (p) of -vf scale (0 (soft) - 100
(sharp)), for -sws 9, it specifies the filter
length (1 - 10).

0 fast bilinear (default)
1 bilinear
2 bicubic (good quality)
3 experimental
4 nearest neighbour (bad quality)
5 area
6 luma bicubic / chroma bilinear
7 gauss
8 sincR
9 lanczos
10 bicubic spline



-vf <filter1[=options],filter2,...>
Setup a chain of video filters.

-vop <...,filter3[=options],filter2,filter1> (OBSOLETE)
Setup a chain of video filters, to be applied in
reverse order. Deprecated in favor of -vf.




pp[=filter1[:option1[:option2...]]/[-]filter2...] (see
-pphelp too)
This option enables usage of MPlayer's internal
postprocessing filter, and also gives an interface
where you can pass options to the named filter. To
get a list of available filters, use -pphelp.

Note that each sub-filter must be separated with a
/ sign.
Each filter defaults to 'c' (chrominance).
The keywords accept a '-' prefix to disable the op*
tion.
A ':' followed by a letter may be appended to the
option to indicate its scope:
a Automatically switches the filter off if
the CPU is too slow.
c Do chrominance filtering, too.
y Do not do chrominance filtering (only lumi*
nance filtering).
EXAMPLES:
-vf pp=hb/vb/dr/al
horizontal and vertical deblocking, dering*
ing and automatic brightness/contrast
-vf pp=hb/vb/dr/al/lb
horizontal and vertical deblocking, dering*
ing, automatic brightness/contrast and lin*
ear blend deinterlacer
-vf pp=de/-al
default filters without brightness/contrast
correction
-vf pp=de/tn:1:2:3
Enable default filters & temporal denoiser.
-vf pp=hb:y/vb:a -autoq 6
Deblock horizontal only luminance and
switch vertical deblocking on or off auto*
matically depending on available CPU time.

mbd=<0-2>
Macroblock decision algorithm (high quality mode),
encode each macro block in all modes and choose the
best. This is slow but results in better quality
and file size.
0 use mbcmp (default)
1 select the MB mode which needs the fewest
bits (=vhq)
2 select the MB mode which has the best rate
distortion
noise[=luma[u][t|a][h][p]:chroma[u][t|a][h][p]]
Adds noise.
<0-100>
luma noise
<0-100>
chroma noise
u uniform noise (gaussian otherwise)
t temporal noise (noise pattern changes be*
tween frames)
a averaged temporal noise (smoother, but a
lot slower)
h high quality (slightly better looking,
slightly slower)
p mix random noise with a (semi)regular pat*
tern

denoise3d[=luma:chroma:time]
This filter aims to reduce image noise producing
smooth images and making still images really still
(This should enhance compressibility.). It can be
given from 0 to 3 parameters. If you omit a param*
eter, a reasonable value will be inferred.
luma spatial luma strength (default = 4)
chroma
spatial chroma strength (default = 3)
time temporal strength (default = 6)

Razorblade2000 10-18-2003 10:58 AM

ohhhhhhh.... come on...
nothing to say??? :? :cry:
Is Linux Video Encoding developement 100% stuck? :cry: :cry:

kwag 10-18-2003 11:09 AM

Quote:

Originally Posted by Razorblade2000
Is Linux Video Encoding developement 100% stuck? :cry: :cry:

Maybe 99% :lol:
I really don't understand some of these Open Source groups. I mentioned this before, but why can't they "freeze" a code branch and concentrate on fixing all bugs, instead of adding more and more features to the pile :!:
It's really a sad situation :?

-kwag

japie 10-18-2003 01:10 PM

Quote:

Originally Posted by kwag
I really don't understand some of these Open Source groups. I mentioned this before, but why can't they "freeze" a code branch and concentrate on fixing all bugs, instead of adding more and more features to the pile :!:

Especial this one, it would be sad if ffmpeg died because within some time it will be to big to even start with debugging.
I mentioned it before, maybe it would be nice if someone took parts of the ffmpeg code to create a true kvcd encoder? (but where to find someone with to much spare time)

Razorblade2000 10-18-2003 01:19 PM

Actually mencoder CAN create a 100% KVCD?!
Notch-Matrix:
Yes

GOP Length:
Yes

Other GOP stuff (e.g. b-frames):
Yes

Nifty Filters:
Yes

How are your experiences? What Filters do you use?

japie 10-18-2003 01:46 PM

I didn't mean that mencoder can't produce an excelent m1v or m2v stream with libavcodec.
It does that, and it does it fast!
What I ment was (and I think Karl too) that it's apitty that ffmpeg keeps adding futures without looking back to the past.
ffmpeg itself still doesn't mux right, and libavcodec's options change weekly.
The combe mencoder/libavcodec produces excelent video, but lacks mp2 support, not to mention muxing.

Razorblade2000 10-18-2003 02:44 PM

Oh yes... I understood *g*
I also think that having mp2 audio support is one of the basic things that mencoder should add :-(
ffmpeg itself muxes fine for me?! With the -f vcd I produced streams that ran fine on my standalone...

But after all I am happy to produce really nice kvcds on Linux :-D
and thanks to the "&&" between commands I can do the whole "encode video ->encode auido -> mux -> create bin++cue -> burn" without having anything to do but hit enter after I replaced my commandline... The only thing missing would be a nice gui :lol:

But still, lot's of testing needs to be done :-( :D

P.S. I just found out that libavcodecs mpeg2 looks pretty fine compared to its mpeg1 (I actually didn't notice much of a difference...

japie 10-19-2003 05:41 AM

Quote:

Originally Posted by Razorblade2000
-> mux -> create bin++cue -> burn" without having anything to do but hit enter after I replaced my commandline... The only thing missing would be a nice gui :lol:

How do you mux?
I yust did an test but tcmplex gave me:
ERROR: File dvd2kvcd.m1v is not a 11172-2 or 13818-2 Video stream.
and mplex told me:
**ERROR: [mplex] File dvd2kvcd.m1v unrecogniseable!
I had to mux the streams with tmpgenc (wich is not an option) and are viewing it right now, and it plays excelent!

Razorblade2000 10-19-2003 05:56 AM

Using sth created by mencoder:
tcmplex -m s -i '/windows/E/AP.m1v' -p '/home/marc/Desktop/outfile_ger.mp2' -s '/home/marc/Desktop/outfile_eng.mp2' -o '/windows/E/AW.mpg

(I had to dump the video with mplayer first... (search for "dump" in the ffmpeg forum)
And I had to rename the .m1v to .m2v... when you use -m s he doesn't accept files with an .m1v ending)

--> mpeg1 + 2 audio streams muxed as SVCD

ffmpeg worked fine for me with the -f vcd param

japie 10-19-2003 07:27 AM

Quote:

Originally Posted by Razorblade2000
I had to dump the video with mplayer first...

I new I forgot something :?
libavcodec produces a mpeg stream, not an m1v.
Lets hope mp2 encoding is added very quickly, I googled for possibilitys to let libavcodec/lame do the job but couldn't find an lame layer 2 option, so if someone did...
At the moment the following works like a charm:
Code:

#!/bin/bash
#
# Usage dvd2kvcd dvd://3 -sid 1 where 3 stands for tirth dvd track and -sid 1 for first subtitle stream
# Usage dvd2kvcd yourmovie.extension for movie conversion

mencoder $1 $2 -nosound -of mpeg -ovc lavc -lavcopts \
vcodec=mpeg1video:keyint=25:mbd=2:vrc_minrate=300:vrc_maxrate=2400:vrc_buf_size=320:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27,29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79:inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34,36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44 \
-vf scale=352:240 -o dvd2kvcd.mpg \
mplayer -vc dummy -vo null -dumpvideo -dumpfile dvd2kvcd.m1v dvd2kvcd.mpg \
rm dvd2kvcd.mpg \
mkfifo -m 660 stream.pcm \
mplayer -really-quiet $ivtc $vop -noframedrop -ao pcm -aofile stream.pcm -vc dummy -vo null -osdlevel 0 $1 & \
ffmpeg -i stream.pcm -ac 2 -ab 112 -ar 44100 dvd2kvcd.mp2 \
rm stream.pcm \
tcmplex -i dvd2kvcd.m1v -p dvd2kvcd.mp2 -o dvd2kvcd.mpg -m b \
rm dvd2kvcd.m1v \
rm dvd2kvcd.mp2 \


Razorblade2000 10-19-2003 11:45 AM

I do mp2 encoding with ffmpeg
Because:
VERY fast
NO PIPING (can directly use mp3/avi/vob files as input)
Quality isn't that bad either

japie 10-19-2003 12:10 PM

I'am using ffmpeg 0.4.8 and wasn't able to use vob's directly, it segfaulted :(

Razorblade2000 10-20-2003 06:35 AM

did you compile via:
./configure --enable-a52
???
Otherwise he won't decode AC3!

japie 10-21-2003 12:11 PM

Quote:

Originally Posted by Razorblade2000
did you compile via:
./configure --enable-a52
???
Otherwise he won't decode AC3!

I did now :)
But I still keep using the mplayer line, since it uses the same commandline format as mencoder. (makes it easyer in a script)

russiansexpat 12-03-2003 12:49 PM

:arrow: http://www.kvcd.net/forum/viewtopic.php?t=7771


All times are GMT -5. The time now is 12:30 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.