digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   FFMPEG: Working kvcd version on *nix (http://www.digitalfaq.com/archives/encode/5347-ffmpeg-working-kvcd.html)

japie 09-02-2003 10:11 AM

working kvcd version on *nix
 
Hai all,

Ran some tests and came up with the following:
http://japie.is.dreaming.org/ftp/KVC...vcd-0.3.tar.gz
It uses mplayer-0.9.x and mjpegtools-1.6.1.90:
http://www.mplayerhq.hu/
http://mjpeg.sourceforge.net/

It creates a vbr-vcd-mpeg using:
Variable bitrate with a max. of 1152 (this improves hardware dvd-player compatibility because off limitations to the speed off dvd-drives used in it)
video buffer size of 40
gop size of 24 (maybe improvements can be done by using differents min. and max. size)
audio bitrate of 128 (who needs more, can change it himself)
quantisation scale of 5
and off-course: the beloved kvcd intra and non-intra matrix ;)

The quality is bether than standard vcd and can contain at least 2 hours on one 80min. cdr.

Give it a go, have fun and if you find improvements lett it know.

japie 09-08-2003 07:33 AM

Released a new version: 1.1

Changelog:
Use filelength to automaticly determine wich quantisize/bitrate combo to use.
Detect movie source type (pal/ntsc) so that will also be the output format.
Detect aspect ratio so widescreen movies will get black borders and fullscreen will stay fullscreen.
In lowest quality one 80 min. disk can contain 2 hours and 10 min. of movie now.

Get it at http://japie.is.dreaming.is.org/ftp/...vcd-1.1.tar.gz

buildid 09-08-2003 12:40 PM

couldnot download the file ................

kwag 09-08-2003 12:42 PM

Welcome buildid :)

Yep. Neither could I. I guess japie is still "dreaming" :mrgreen:

-kwag

kwag 09-08-2003 12:49 PM

Try this: http://deserver.kicks-ass.org:59147/ftp/KVCD/

-kwag

buildid 09-08-2003 12:55 PM

thanks :-)

japie 09-08-2003 10:53 PM

Think I did a "is" to much :oops:
http://japie.is.dreaming.org/ftp/KVCD/mkxvcd-1.1.tar.gz

kwag 09-08-2003 11:35 PM

Quote:

Originally Posted by japie

You "are" right japie :mrgreen:

-kwag

japie 09-11-2003 01:25 PM

Minor buxfix:
http://japie.is.dreaming.org/ftp/KVC...d-1.1.1.tar.gz

japie 09-15-2003 07:29 AM

New version; 1.2

added detection of mjpegtools-version, older versions create xvcd, newer versions create true kvcd.
autodetection of pal/ntsc.
automatic adaption of quality setting related to movie length.
standard setting to add black borders can be overruled by extra option 'fullscreen'.
http://freshmeat.net/projects/mkxvcd/

japie 09-24-2003 10:01 AM

Latest version 1.3 with a lot off changes:

Added 16:9 autodetection again, with question to user if he wants to add black borders or not.
Reorderd encoder lines so that on a hard (CTRL-c) interupt it cleanly shuts down.
Added min and max gop sizes again, for scene change detection.
Added some info about the movie at the status line and safe the same info to a file.
Added -really-quiet to mplayer, keeps the screen more visible.
Added -s to mpeg2enc to make the output usefull for authoring tools.
Fixed 3:2 TELECINE problem.
Fixed problems with odd 24.999 fps divx movies.
Using mplex again over tcmplex.
Lots of minor bugfixes and cleanups.

http://freshmeat.net/projects/mkxvcd/

buildid 09-24-2003 12:47 PM

hmm hard to get , cannot download the file .

anyway thanks

japie 09-24-2003 10:44 PM

Sorry, had some problems, allsswell now ;)

zivel 09-30-2003 07:42 AM

the script
 
hi japie,

i was testing your script during last few days and here are some thoughts:

if a movie is non standard size (not 4:3 and not 16:9) i'm getting unusable results - the movie is either stretched too much or too narrow. so i tried to experimend with mplayer option -vop expand=x:y. this option i use when i want to display subtitles but i don't want them right inside of the movie but in the black border that is created around the movie. i have a little script on my system that recalculates size of any movie into 4:3 size by adding the black bars. so i implemented this into your script. the line with mplayer looks something like this:

mplayer -really-quiet -vop expand=${width}:$((${width}/4*3)) ......an so on

of course, any movie that you pass onto the script is now 4:3 so you no longer need to decide what type of rescaling method yuvscaler uses because it's allways doing RESAMPLE.

this thing also has side effect that if you encode also subtitles into the movie they are using also the lower black bar, not just the movie (those who don't like it may set it in mplayer with some parameters otherwise, i think)

i haven't tested this into details so there might be some flaw to this whole thing but i think it might give you something to work on. one thing that seems to be problematic is that with the math going on there you can end up with height that is not multiplication of 8 and the encoder crashes then, i think i had some crashes like that but it could have been caused also by other stuff. of course i might be totally mistaken here since my knowledge of video encoding is very limited.

there is also one tiny problem with the script - when you check for mplayer playable extension .mov (quicktime) is not there so you should add it there.

i would also suggest adding option to encode the movie in SVCD resolution. i tried it and i think the results are excellent although encoding time is horrible :) you may also consider adding option to create ksvcd (mpeg2 kvcd) but i'm no expert in mpeg1/mpeg2 and have no idea if there is any benefit in this. would there be much difference between mpeg2-ksvcd and mpeg1-kvcd with svcd resolution?

that would be about it. sorry for this mess of a message, i just wrote what came into my head :)

japie 09-30-2003 01:24 PM

Re: the script
 
Quote:

Originally Posted by zivel
mplayer -really-quiet -vop expand=${width}:$((${width}/4*3)) ......an so on

It sounds fine, I started some day agoo to skip yuvscaler allready and are using the softwarescaler of mplayer now since it's faster and uses less cpu power. This is a nice solution for the WIDE2STD option.
Thnx!
Quote:

Originally Posted by zivel
there is also one tiny problem with the script - when you check for mplayer playable extension .mov (quicktime) is not there so you should add it there.

fixed...
Quote:

Originally Posted by zivel
would there be much difference between mpeg2-ksvcd and mpeg1-kvcd with svcd resolution?

As far as my tests proved mpeg2 looks worse and has a bigger size so I have no plans on supporting svcd/ksvcd. (but your not the first asking for (k)svcd)

zivel 10-01-2003 02:44 AM

more specific?
 
Quote:

Originally Posted by japie
It sounds fine, I started some day agoo to skip yuvscaler allready and are using the softwarescaler of mplayer now since it's faster and uses less cpu power. This is a nice solution for the WIDE2STD option.

could you explain what exactly you do? because after reading your comments i tried to combine expand and scale filters (and i just found out that -vop is deprecated in favor of -vf). i was trying to expand first to 4:3 size and then scale to vcd size, something like this:

-vf expand=640:480,scale=352:288

but the result is a corrupted video - the size is correct but the picture is gone and replaced with green blinking mess. strange thing is that i get this only with this particular pair and order of filters. when reversed or used separately there are no problems with green shit.

so please tell me details about what exactly you are doing, i hope you have better results than i do.

thanx, zivel

japie 10-01-2003 12:04 PM

Re: more specific?
 
Quote:

Originally Posted by zivel
could you explain what exactly you do?

At the moment I'am typing a reply...
Nothing yet, yust theory ;)
Quote:

Originally Posted by zivel
(and i just found out that -vop is deprecated in favor of -vf). i was trying to expand first to 4:3 size and then scale to vcd size, something like this:
-vf expand=640:480,scale=352:288

-vf starts with the first option and works it's way to the end of comma seperated options and -vop starts at the end and works its way to the first, so you could:
-vf expand=640:480,scale=352:288
and
-vop scale=352:288,expand=640:480
is the same...
But as far as I can tell the scale option itself is enough for scaling and black border adding.
I'am completely rewriting the script so this will appear in a 2.x version, in the meantime ill stick to what I have right now and try to fix the broken xvcd mode first :oops:

p.s. Could you please do script related things via email, I hate communicating via web-based thingy's :lol:

japie 10-01-2003 12:35 PM

New release; mkxvcd-1.3.1

Fixed broken mjpegtools-1.6.1 support and added .mov to extensions.

http://japie.is.dreaming.org/ftp/KVC...d-1.3.1.tar.gz

japie 10-02-2003 11:49 AM

Re: more specific?
 
Quote:

Originally Posted by zivel
could you explain what exactly you do? because after reading your comments i tried to combine expand and scale filters (and i just found out that -vop is deprecated in favor of -vf). i was trying to expand first to 4:3 size and then scale to vcd size, something like this:

-vf expand=640:480,scale=352:288

but the result is a corrupted video - the size is correct but the picture is gone and replaced with green blinking mess. strange thing is that i get this only with this particular pair and order of filters. when reversed or used separately there are no problems with green sh*t.

thanx, zivel

Try this:
Code:

-vf expand=0:-(((width/4)*3)-height):0:(((width/4)*3)-height)/2:0,scale=352:240
I didn't test it in the script, but did a dry run with the calculations made in advance, on my 1024 x 576 divx the commant result was:
Code:

mplayer -vf expand=0:-224:0:112:0,scale=352:240 Unzipped/test_video/divx.avi
Have fun, and lett me know...


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

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