digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   Mencoder: Optimal Script with mencoder filters (http://www.digitalfaq.com/archives/encode/9079-mencoder-optimal-script.html)

vmesquita 04-12-2004 01:59 PM

Quote:

Originally Posted by bilu
softpulldown isn't capable of creating MPEG-2 RFF flags like pulldown.exe
It copies a field into the stream and it becomes hard-telecined 29.97fps.
Of course IVTC works just the same over hard-telecined :)

If I understood correctly, you are encoding interlaced... :!: This will give you much less compressibility. :(
The correct way is use a IVTC filter, -ofps 23.976 and do pulldown later. Pulldown can probably be compiled in linux or other Unix OS. The Source code is here:http://www.inwards.com/inwards/?id=36
I downloaded and compiled under cygwin (just had to make a very small change), so it must compile easily under gcc in unix enviroment.

@digitall.doc
This is for KVCD/KSVCD encoding. You can also use for 10 hours 352x480 CVD. Read my post for easy VOB input with no warnings. :wink:

kwag 04-12-2004 02:00 PM

Quote:

Originally Posted by digitall.doc
Code:

type D:\vobs\*.vob|D:\mencoder\mencoder -include ... -vf ... -lavcopts ... -o D:\encoded\1pass.m2v  -

Thanks digitall.doc :D
Just what I needed :cool:

BTW, for Unix users, it would be:

Code:

cat /vobs/*.vob | ./mencoder/mencoder -include ... -vf ... -lavcopts ... -o /encoded/1pass.m2v  -
;)
-kwag

rds_correia 04-12-2004 02:05 PM

Quote:

Originally Posted by digitall.doc
type D:\vobs\*.vob|D:\mencoder\mencoder -include ... -vf ... -lavcopts ... -o D:\encoded\1pass.m2v -

Yeah! me too.
I knew there should be a command to replace cat (cause I already knew that way from Linux)
but I never thought they had "invented" it for win32.
BTW who would name a command "type" when it's supposed to show file contents...M$...
Cheers

bilu 04-12-2004 03:22 PM

Quote:

Originally Posted by vmesquita
If I understood correctly, you are encoding interlaced... :!: This will give you much less compressibility. :(
The correct way is use a IVTC filter, -ofps 23.976 and do pulldown later. Pulldown can probably be compiled in linux or other Unix OS. The Source code is here:http://www.inwards.com/inwards/?id=36
I downloaded and compiled under cygwin (just had to make a very small change), so it must compile easily under gcc in unix enviroment.

You're right. But then again I want to do a generic encoding script that doesn't need to care about hybrid movies, 30 fps video or 24 fps film :roll: So I have to do it like this.

Bilu

digitall.doc 04-12-2004 04:26 PM

kwag, rds,
nothing to thank at all. I'm just a learner here. I learnt this from someone else (can't remember now) and I share with you all now... :D (this sharing thing also learnt from you all :wink: )

vmesquita,
if this filtering chain is for KVCD/KSVCD, then it will be even easier to design a light filtering chain for 4-5 hours KDVD. As soon as I find some continued hours (I'm slooow :oops: ) to read filters info in man_page, I'll post a proposal...

vmesquita 04-12-2004 05:34 PM

Quote:

Originally Posted by bilu
You're right. But then again I want to do a generic encoding script that doesn't need to care about hybrid movies, 30 fps video or 24 fps film :roll: So I have to do it like this.

But I don't see why loosing quality in the process. A telecined video can be easily identified (just scan throught the frames and if there's a 3progressive 2interlaced) pattern and it will give you a massive quality gain... :roll: Since you are going to spend some hours encoding, why not loose a feel minutes and encode it the best way possible? :wink:

@digitall.doc
Actually I created this filter chain using the optimal script as a basis... I don't think KDVDs really need filtering, nor I know any KDVD-recommended scripts... :D But if you have any ideas... Let us know!

@all
I don't understand: why not use my DVDDecrypter solution and create a big VOB? It's much faster... :? Of course, in UNIX the pipe is the best bet. :wink:

kwag 04-12-2004 06:27 PM

Quote:

Originally Posted by vmesquita

@all
I don't understand: why not use my DVDDecrypter solution and create a big VOB? It's much faster... :? Of course, in UNIX the pipe is the best bet. :wink:

Yes :!:
That's the best solution, but it just so happens that most of my VOBs already on the disk are splitted :lol:
So for new ripps, yes, rip to a single VOB.
Then use MovieStacker, get the resize parameters/overscan/etc. parameters, and edit the filterchain line and "expand" to the correct output size ;)
I was actually thinking about doing a little program to read a .avs script, and generate a corresponding .ini file :cool: :idea: :idea:

-kwag

digitall.doc 04-13-2004 03:03 AM

Yes, kwag, that's just the point, I didn't explain well. For those of us with splitted vobs in the hard disk, piping I think is the way. For my future "decryptings" I'll use one vob vmesquita way :wink: , of course.

BTW, vinicius, do you know a way that IFOedit, when muxing, output also just 1 vob file. Since when I load then in DVDlab, it loads each vob as a different film... it would be easier for me to have the film muxed with IFOedit in just 1 vob. (I mux with IFOedit to add 2 audio tracks and a subtitle)

kwag, it's coming the time that you, advanced programers, create some tools to work with mencoder... don't you think so 8) (If it was so easy as just say that :lol: :lol: :lol: )

jorel 04-13-2004 03:47 AM

Quote:

Originally Posted by digitall.doc
Yes, kwag, that's just the point, I didn't explain well. For those of us with splitted vobs in the hard disk, piping I think is the way. For my future "decryptings" I'll use one vob vmesquita way :wink: , of course.

BTW, vinicius, do you know a way that IFOedit, when muxing, output also just 1 vob file. Since when I load then in DVDlab, it loads each vob as a different film... it would be easier for me to have the film muxed with IFOedit in just 1 vob. (I mux with IFOedit to add 2 audio tracks and a subtitle)

kwag, it's coming the time that you, advanced programers, create some tools to work with mencoder... don't you think so 8) (If it was so easy as just say that :lol: :lol: :lol: )

digitall.doc ,
about 2 audios or more using ifoedit, vobedit,menuedit....
and how to get a big vob too!

please, take a look in that post,
:arrow: i did, still doing and works perfect .
don't know if can be used here but.... "who knows", it can help !

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

of course, excuse my english!

bilu 04-13-2004 09:10 AM

Quote:

Originally Posted by vmesquita
Quote:

Originally Posted by bilu
You're right. But then again I want to do a generic encoding script that doesn't need to care about hybrid movies, 30 fps video or 24 fps film :roll: So I have to do it like this.

But I don't see why loosing quality in the process. A telecined video can be easily identified (just scan throught the frames and if there's a 3progressive 2interlaced) pattern and it will give you a massive quality gain... :roll: Since you are going to spend some hours encoding, why not loose a feel minutes and encode it the best way possible? :wink:

Well, I had some ideas once about automatic pattern analisys:
http://forum.doom9.org/showthread.php?s=&threadid=69199

And some Decomb experience:
http://forum.doom9.org/showthread.php?s=&threadid=65985

But I'm in a "don't care" phase now ;)

Idea is to have a tool/script/whatever that can be used everywhere, even if you don't have analisys tools like Avisynth around (FreeBSD/Linux/others)

And many people I know just want to backup the DVD, don't care about pre-processing it. But I do agree with you it would be better :)


Bilu

kwag 04-13-2004 09:42 AM

Quote:

Originally Posted by bilu
And many people I know just want to backup the DVD, don't care about pre-processing it. But I do agree with you it would be better :)

I think MEncoder has all the filtering we need, plus it's multi platform ;)
At least that's my point of view :)

-kwag

digitall.doc 04-13-2004 10:07 AM

Quote:

Originally Posted by jorel
please, take a look in that post,
:arrow: i did, still doing and works perfect .
don't know if can be used here but.... "who knows", it can help !

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

Thanx jorel. I already had read your post.
But this isn't what I was looking for. I do my menus with DVDlab from scratch, since I fit 2 films per media.
I load my video stream, 2 audio stream and subtitle file without a problem in IFOedit.
But when IFOedit muxes all this, generates several vob files. And I would like just 1 vob file.
I still don't now how to do it in IFOedit. Sorry me if I'm a little noob.

jorel 04-13-2004 10:33 AM

Quote:

Originally Posted by digitall.doc

BTW, vinicius, do you know a way that IFOedit, when muxing, output also just 1 vob file.

digitall.doc,
wrote more:
"But when IFOedit muxes all this, generates several vob files. And I would like just 1 vob file.
I still don't now how to do it in IFOedit. Sorry me if I'm a little noob."

little noob ?
:lol:
this is my title!
i did that taking ideas from here and from everywhere,mixing all...
there was only the idea.....now you can get a big vob:

Creating a single title compilation using DVD Shrink, IFOEdit, and VOBEdit.
NOTE: This method should probably only be used if the clips have the same
audio and subpicture streams (as a two-sided or multi-disc movie would).

Let's say we want to create 3 clips and then join them into a single title.

Clip 1:

1) Use start/end feature in re-author mode in Shrink to select desired region
2) Apply compression if desired (I generally only do a final compression over
the joined clips)
3) backup clip 1 to directory A.

Change Shrinks Preferences to NOT split files at 1GB and proceed with clips 2 & 3.
This is necessary for the proper operation of VOBEdit.

Clips 2 & 3:

1) Use start/end feature in re-author mode in Shrink to select desired region
2) Apply compression if desired
3) backup clip 2 to directory B.
4) backup clip 3 to directory C.

For the purposees of this example, let's say that Clip 1 as three VOB files
VTS_01_1.VOB, VTS_01_2.VOB, and VTS_01_3.VOB.

Let's also assume that the order we want the clips to play is 1, 2, and then 3.

Change VOB Ids for clips 2 & 3:

1) Go to directory B and rename the single VTS_01_1.VOB file to VTS_01_001.VOB
2) Launch VobEdit and open the VTS_01_001.VOB file in directory B
3) Select from the Edit menu "Join Clips"
4) allow vobedit to save the destination as VTS_01_1.VOB in directory B
5) Set the VOB Id to 2 (since the VOB Id of clip 1 is 1 and we want consecutive
numbering)
6) click OK and let VobEdit do its thing

7) Go to directory C and rename the single VTS_01_1.VOB file to VTS_01_001.VOB
8) Launch VobEdit and open the VTS_01_001.VOB file in directory C
9) Select from the Edit menu "Join Clips"
10) allow vobedit to save the destination as VTS_01_1.VOB in directory C
11) Set the VOB Id to 3
12) click OK and let VobEdit do its thing

In this example, let's say that VObedit now has created VTS_01_1.VOB & VTS_01_2.VOB
in directory B and VTS_01_1.VOB, VTS_01_2.VOB, and VTS_01_3.VOB in directory C.

Rename VOB files for clips 2 & 3.

1) Since the last VOB file in directory A is VTS_01_3.VOB we need to rename the
VOB files in directory B from VTS_01_1.VOB to VTS_01_4.VOB, and VTS_01_2.VOB to
VTS_01_5.VOB.
2) Copy VTS_01_4.VOB and VTS_01_5.VOB from directory B to Directory A
3) Since now the last VOB file in directory A is VTS_01_5.VOB we need to rename the
VOB files in directory C from VTS_01_1.VOB to VTS_01_6.VOB, VTS_01_2.VOB to
VTS_01_7.VOB, and VTS_01_3.VOB to VTS_01_8.VOB.
4) Copy VTS_01_6.VOB, VTS_01_7.VOB, and VTS_01_8.VOB from directory C to Directory A

Now in directory A we have VIDEO_TS.IFO & BUP, VTS_01_0.IFO & BUP, and VTS_01_1.VOB
through VTS_01_8.VOB.

Create new IFOs:

1) make a temp sub-directory in directory A and move all four IFO & BUP files into
the temp directory
2) Launch IFOEdit and click on the "Create IFOs" button
3) browse to directory A and select VTS_01_1.VOB
4) make sure to select "Create 1 PGC only" and "Create Chapter for each cell" and
check the "same as source" box for the new IFO destination directory
5) Click OK and let IFOEdot do its thing.
6) When complete there will be new VIDEO_TS and VTS_01_0 IFOs and BUPs in directory A

I find that in order for rewind and reverse skip to work properly the VOB files must be
processed once more with IFOEdit to fix navigational structures.

Final Fixup with IFOEdit:

1) Launch IFOEdit and open the VTS_01_1.VOB in directory A
2) Click on VOB Extras and make sure all check boxes are checked EXCEPT:
Remux, Rebuild PTS, Split to 2 DVD-Rs, and Remove IIvu/Angle Point.
3) Select a new destination directory (for this example "D").
4) Click OK.
5) make sure Correct IFO Tables checkbox is checked.
6) check all streams that are to be kept (probably since this has been preprocessed
by shrink already).
7) Click Strip It.
5) make sure Correct IFO Tables checkbox is checked.
6) check all VOB Ids.
7) Click Strip It and let IFOEdit process the files

In directory D you will now have a DVD file set that can be further processed by Shrink.
In this example, it will certainly be necessary since there are over 5GB of VOB files.
Don't forget to change back the Shrink preference to split files at 1GB...

A few notes:

I doubt that this method will work very well if the number of audio streams
and subtitle streams don't match from clip to clip (or if the IDs are different between
clips). If you have clips with different audio or subtitle streams, it is best to keep
each clip as a separate title and simply use the re-author method in Shrink directly.

The audio stream and subtitle stream information in the IFOs created by IFOEdit will not
contain the correct language information, nor will the subtitle colors be correct. However,
using the information from the original IFOs (in the temp directory in directory A for
example), IFOEdit can be used to restore the information.

The chapter points in the new IFOs in directory A may not match up with the original
chapter points as each cell has been designated as a chapter. Cells that shouldn't be
chapters can also be easily adjusted using IFOEdit.

I generally make all adjustments before making the final compression pass with DVD Shrink.

This will result in seamless playback of all three clips and will allow skipping forward
and backwards by chapters as well as FF and RW as one would expect.

Note that if all that is really desired is to be able to go from the last chapter mark of
a clip to the next clip, one could use this method to append a single cell 15 frame
VOB file to the end each clip and leave each clip as its own title. This will result in
a 1/2 second delay between titles, but it will at least allow one to use the skip button
to get to the next title instead of having to use the title button. However, you won't
be able to skip backwards from title 2 to title 1 for example.

too big but simple!

:wink:

digitall.doc 04-13-2004 11:13 AM

jorel,
8O 8O 8O 8O
I just saw you answered my question.
Now I'm going to look for a "editing vobs for experts" dictionary to understand what yo wrote :lol: :lol: :lol:
Just a joke. Didn't read it thoroughly nor in depth, but it seemed to me quite clear.
Don't know if too much, I just wanted an option in IFOedit that did allow me to output 1 vob instead of several ones... :)

bilu 04-13-2004 11:40 AM

Quote:

Originally Posted by kwag
I think MEncoder has all the filtering we need, plus it's multi platform ;)
At least that's my point of view :)

But automatic IVTC analisys like the one in AutoGK still has a long way to go... :roll:


Bilu

vmesquita 04-13-2004 11:58 AM

Quote:

Originally Posted by bilu
But automatic IVTC analisys like the one in AutoGK still has a long way to go... :roll:

It's much simpler than that for must cases! Just scan throught the frames of your source, if you see 3 progressive frames, then 2 interlaced, then 3 progressive and so on, you're dealing with telecined matherial. You can spot in less than a minute using any player that allows frame by frame.

bilu 04-13-2004 12:08 PM

I know that for ages :twisted:

But I'd like a program to do it itself, just like AutoGK does now (and I helped len0x with hybrid Decomb thresholding).
And just like the algorithm i suggested in that Doom9 thread I posted.

I'm after set-and-forget encodings: "just one click" :)



Bilu

digitall.doc 04-14-2004 05:47 AM

vmesquita,
I posted in mencoder 2pass thread my tests with 2pass, and "problems" (not really problems) with vbitrate=1500.
I also tested with your filter chain, but just crop black borders and resize to 704x576. Encoding speed went down to 12 fps (from 26 fps), similar to what I get when using avisynth... don't know if ytou get similar results, at this high resolution.
Related to the effect the filter make: hmmm, not bad. Very little blurred and washed and shaved, but little, not bad. As I said, I have to try some light filtering for KDVD encoding, and I'll propose it here, in case you wanted to test it.
... and no, the filtering also didn't solve the microblock problem. I'm afraid it's due too low average bitrate, and difficult to solve. But I did notice that it lowered max bitrate and raised a little quantizers.

tuco1979 04-14-2004 09:55 AM

Quote:

Originally Posted by digitall.doc
Quote:

Originally Posted by vmesquita
Quote:

Originally Posted by rds_correia
But from what do you encode the movie?
From VOB?
If so how can you make the whole movie?
You'll get between 6 to 10 m2vs because that's around the amount of VOB files a DVD has.
You join the m2vs in the end?
From AVS script only with Mpeg2Source and have MEnc's internal filters do the job?
C ya

It's very easy, easier and faster than with Mpeg2source! There are two ways:....

And I'll give you the third one. I don't want to say it's better, but just one else to use. You have got all your vobs in a folder. And you feed mencoder through piping, this way:
Code:

type D:\vobs\*.vob|D:\mencoder\mencoder -include ... -vf ... -lavcopts ... -o D:\encoded\1pass.m2v  -
The keys are "type" and | in the begining of the command, and "-" in the end.
It's working for me. When encoding, mencoder complains in the begining:
Code:

Reading from stdin...
success: format: 0 data: 0x0 - 0x0
Cannot seek backward in linear streams!
Seek failed
Cannot seek backward in linear streams!
Seek failed
Cannot seek backward in linear streams!
Seek failed
MPEG-PS file format detected.

And then it doesn't show the percentage encoded, nor the aproximate final file size, nor time left... but it works. Just try if you think it does worth.

How do you do this for .avi files? I recently installed linux so I had to use fat32 instead of NTFS so my capture files are segmented. If it is possible, could you show me both the linux commands and windows commands?

thanks


All times are GMT -5. The time now is 08:09 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.