View Full Version : MPEGDecoder.dll (Direct VOB/M2v -> AviSynth)
Pages :
1
2
3
4
5
6
7
8
[
9]
10
stevenxu
16th January 2003, 12:41
Originally posted by Nic
Yup, there is a problem in the way d2v files are created for mpeg-1 files. Ill fix it asap :)
Cheers,
-Nic
A workaround for MPEG-1 file:
MPEGSource("C:\A.MPG + C:\A.MPG",-2)
Nic
16th January 2003, 12:53
Ill fix everything I can and add new code over the weekend. :)
BTW if its not listed in the html file then the parameter doesnt currently do anything.lol. -2 doesn't effect anything.
(in fact im going to change the params to a DeComb way of: frames=2000, forcefilm=true ,etc etc) it will be alot neater that way
Cheers,
-Nic
seewen
16th January 2003, 16:36
Originally posted by stevenxu
A workaround for MPEG-1 file:
MPEGSource("C:\A.MPG + C:\A.MPG",-2)
Check the number of frames....
stevenxu
17th January 2003, 05:27
Originally posted by seewen
Check the number of frames....
Sorry it does not read full file, some frames lost. Waiting for Nic's new release.
3S Doc
17th January 2003, 20:01
Question from a beginner.
Can I use this dll for this?
I have some svcd's and they have none subs, I would made there subs in hardcoded (permanent).
I thougt when I copy the mpeg2 file to my hd.
Can I use this to do this.
example:
LoadPlugin("MPEGDecoder.dll")
MPEGSource("d:\SVCD\my_file.")
LoadPlugin("textsub.vdf")
TextSub("d:\SVCD\my_file.ssa")
this file save as a my_file.avs
Can I then load this file in CCE SP 2.5 ??
tnx.
3S.
Nic
17th January 2003, 21:49
You should be able to :) (sorry I know nothing about subs so cant say for sure)
Best bet is to try it :)
-Nic
WarpEnterprises
17th January 2003, 22:30
Maybe you have to remove the riff header if you only file-copy the mpg to disk (use vcdeasy tool CDXA2MPEG)
mikeathome
25th January 2003, 19:23
@NIC:
Just downloaded Alpha 2.02 and tested it. Changelog says framecount bug solved, hmm...
I guess you use the DVD2AVI decoder unit (sorry did not fully read all the posts), since your tool encounters exactly the same issue as the DVD2AVI 1.76 CLI Version does. It simply forgets 1-5 frames at the end of nearly every VOB it creates a project from. Well, 1-5 frames doesen't sound much, BUT it creates a big problem for the rebuild of MultiPGC/Multiangle Titles with Scenarist e.g. What happens:
- you split a Titleset by VobID (e.g. Matrix gives you 40 VobIDs) with 116 Cells
- in Matrix it is jumping back and forth all the time, different cell from different VobIDs are combined
- you start with only 2 frames missing and you end up with up-to 10 (!) this is already 400ms in PAL and you can clearly hear the jump
Can you fix the missing frames ? It must be possible, in the mo I do it manually (editing the .d2v). I split everything by VobID and create DVD2AVI projects and corresponding AviSynthScripts. Then I open them in the special VirtualDub Version. This Version is able to open and decode VOB/MPEG-2Video directly AND IT DOES THE FRAME COUNT RIGHT !!! The special VirtualDub version is available in source code as well. Can you have a look what is different in the MPEG decode section and why it counts frames right where DVD2AVI/MPEGSource fails ?
Could you pls. send me your last version w/o the .d2v project generation, you know the version where you introduced the '-2' parameter for framecount correction. I would like to give it a try. I don't really like the extra .d2v generation from MPEGSource.
Thx. for MPEGSource !!!
mike, mailto:mikeathome@gmx.de
frank
26th January 2003, 19:43
There was a thread "DVDAVI missing frames" in 11/2001 where Jackei explained that there is no VFAPI bug. (Thread isn't there anymore)
Jackei:
The design of DVDAVI VFAPI Plug-in must drop last 1~2 frames in order to prevent from illegal access at the end of file....
The typical structure of MPEG GOP is IBBPBBPBBPBB IBBPBBPBBPBB I...
MPEG invokes backward reference pictures. The display sequence is different from stored sequence for sequential reading.I have no clue how VirtualDubmod solved that problem.
When you split at VOB Id then the following GOP after last frame (needed for right decoding) is missed. Normally the GOPs are not closed.
Nic
27th January 2003, 00:01
Hmmm, Well I do it exactly as DVD2AVI creates it, my original code did it my own way & that didnt produce exactly the same output so I thought people would complain....
Seeing everyone uses dvd2avi to create their d2v's I didnt feel that producing the same output was a "bug" ;)
Ill add a function that allows adjustment of the frame count as well as the -2 param again soon...
-Nic
mikeathome
27th January 2003, 10:49
Originally posted by frank
There was a thread "DVDAVI missing frames" in 11/2001 where Jackei explained that there is no VFAPI bug. (Thread isn't there anymore)
I have no clue how VirtualDubmod solved that problem.
When you split at VOB Id then the following GOP after last frame (needed for right decoding) is missed. Normally the GOPs are not closed.
Hi,
I don't agree on your last two sentences (SORRY). When you set the right chapters (e.g. in CCESP) the Encoder will close the GOPs at chapter point. That's why titles like Matrix work at all. Have you seen how it jumps from Cell to Cell where the cell are members of different VobIDs. Look at PGC-7 and PGC-8. Those one are impossible to rebuild w/o rigth frame count !
@NIC: Thx. for taken my point. Here is the link to the special VirtualDub Version: http://forum.doom9.org/showthread.php?s=&threadid=42808 . Dext has even released the CPP code from the MPEG Decoder he is using.
mike
stax76
28th January 2003, 23:37
Hi,
does anybody cut with VirtualDub and encode with LameACM, seem to go async, I did two tests, MPEG2DEC was always sync (like 1000 times before), MPEGDecoder was always async. Maybe I should try to save wave and use BeSweet, but this seem even with MPEG2DEC.dll to go async, at least in my experience.
I hope I'm not the only one that captures, everybody seem to be into DVD copying here
Regards,
Dolemite
scmccarthy
29th January 2003, 00:04
Hi,
I'm a ripper myself, but bitrates below 128 causes async, you didn't mention the bitrates you used.
Stephen
stax76
29th January 2003, 00:16
I use 160 KBit/s MP3 CBR usually for AVI container
scmccarthy
29th January 2003, 00:26
Well that's absolutely perfect, ideal, couldn't fault that by any standard.
Stephen
frank
29th January 2003, 10:38
@mikeathome
Right, CCE encodes closed GOPs at chapter points.
But we spoke about decoding.
The cell borders, chapter points, are encoded as closed GOPs. Mostly there are one ore more I frames inserted. That's why it works in Matrix.
May be DVD2AVI doesn't handle closed GOPs in the right way?
I don't know.
My way that ever worked is to make one .d2v project from all VOBs together and then splitting with Avisynth Trim().
mikeathome
29th January 2003, 14:44
Originally posted by frank
(...)
My way that ever worked is to make one .d2v project from all VOBs together and then splitting with Avisynth Trim().
Hi,
very interesting !!!
The new IfoUpdate could give you now the cell-frame-count for your
split, choose export chapterfile for adjusted method. This will give
you ALL scene/chapterpoints of a Titleset. You would need to run this
on the raw TitleSetVobs (not a PGC rip !).
Make an Image, mount with DaemonTools, get the Cell-Chapter-Points
with IfoUpdate, create a DVD2AVI project on the mounted image
titleset, create one .avs per chapterpoint, demux audio & subpics
per CellID (as long as you don't need DTS you can do with
VStrip/VobSub, otherwise with DVDDecrypter/VobSub). Everything listet
till here can be automated with a DOS Batch Script, I need to give
that a try.
Short batch script to parse a CCESP-Chapter file:
@FOR %%x in (CCE-VOBID_??.TXT) do @FOR /F "eol=: tokens=2 delims==:" %%i in (%%x) do @echo %%i
thx. mike
iks
2nd February 2003, 12:57
Hi,
I have got another problem with MPEGdecoder and mpeg 1 files. I only get half the frames of the source stream with this input filter. If I use this to recode it to DivX, the movie stops right in the middle. Has anyone tried this with mpeg 1 files?
Ingo
cody
8th February 2003, 02:38
Yeh it seems mpeg-1's are still behaving weirdly ...when i load a clip it loads from begining to end but drops 1/4 of the frames :confused: for some reason it drops 29.9 fps mpeg-1 to 7.** fps
:eek:
tiennou
8th February 2003, 17:02
Let's hope this :devil:annoying :devil: bug will be corrected ;)
Tiennou
Keep up the good work & thanks to the developers !
stevenxu
9th February 2003, 17:12
A workaround for MPEG-1 file:
for example C:\A1.MPG 100000 frames
LoadPlugin("C:\Avisynth\plugins\MPEGDecoder.dll")
MPEGSource("C:\A1.MPG+C:\A1.MPG+C:\A1.MPG")
Trim(0,99999)
seewen
10th February 2003, 14:58
Sorry, but where is the "workaround" ?
The script that you use give you 100'000 frames.. ok.
But it doesn't give you correctly A1.MPG.. it gives you some frames of A1.MPG + some frames of A1.MPG + some frames of A1.MPG .
Nic
10th February 2003, 17:08
I havent much time recently, but the version that will be released tomorrow, will allow you to force the number of frames. It will also have automatic transport stream support (i.e. it detects its a transport stream and finds the PIDs accordingly).
Also its ICL7 compiled and is compiled using the latest libmpeg2 library. People mentioned in this thread that mpegdecoder.dll was creating AVIs bigger than MPEG2Dec.dll. From my tests its now the opposite way round so hopefully quality/uncompressability problems will be gone too.
See ya tomorrow,
-Nic
stevenxu
10th February 2003, 18:29
Originally posted by seewen
Sorry, but where is the "workaround" ?
The script that you use give you 100'000 frames.. ok.
But it doesn't give you correctly A1.MPG.. it gives you some frames of A1.MPG + some frames of A1.MPG + some frames of A1.MPG .
My script works well. With it I have compressed more than 10 VCDs.
Nic
17th February 2003, 15:53
New version up ( http://nic.dnsalias.com ).
You can now specify:
MPEGSource("e:\rip\mpeg1.mpg", 2000)
to get MPEGSource to return 2000 frames or
MPEGSource("e:\rip\mpeg1.mpg", -2)
to get directshow to guess the number of frames
Also transport streams should work automatically with this version. I.e. you can specify a d2v or mpg and if its a transport stream it will be handled without any further parameters (automatically finds the PIDs)
Cheers,
-Nic
Wilbert
17th February 2003, 16:02
Nic, did you already implement
1) support for audio ?
2) support for pva streams ?
Thx,
Nic
17th February 2003, 16:18
Nope neither of them yet...dont have any pva streams, but demuxing is easy. Audio can be done by other filters I think, MPASource & AC3Source just need to be able to take MPEG PS/SS input.
-Nic
WarpEnterprises
17th February 2003, 16:35
Is there source code for a generic mpg demuxer available?
Nic
17th February 2003, 17:04
Try the CDemux class in MPEGDecoder's source, it could be used to wrap the audio filters to take MPEG files.
-Nic
kitsaros2000
17th February 2003, 17:13
the ac3source dosent work to me. I'm pretty sure that the filter is buggy because i can hear only a part of the 5.1 channels . (either the 2 background channels either the left channel only). :( :( :(
Nic can you put directly into MPEGSource ac3 support? :rolleyes:
Thanks anyway :)
bye !
unplugged
8th March 2003, 01:42
Nic, MPEGDecoder DLL for Avisynth 2.0x doesn't seem to consider interlaced streams during final YUY2 conversion (after YV12 decoding step), so interlaced lines receive chroma lines in a progressive way when put in YUY2 buffer, I have done this little test between AVS 2.5 and 2.0x version (using MPEGDecoder 2.03a)
AVS 2.5 script
...
LoadPlugin("c:\App\Media\Avisynth\MPEG2Dec3.DLL")
LoadPlugin("c:\App\Media\Avisynth\MPEGDecoderYV12.DLL")
mpegsource("movie.d2v")
YV12toYUY2(interlaced=true)
...
(right and combed result as original stream, MarcFD's conversion routine does the job ;))
AVS 2.08 script
...
LoadPlugin("c:\App\Media\Avisynth\MPEGDecoder.DLL")
mpegsource("movie.d2v")
...
(wrong result: not combed, chroma values doubled instead)
However good work, I am using your MPEGDecoderYV12 for 2.5 and it works pretty fast and well!
Maybe you could consider useful to implement directly MarcFD's YV12toYUY2(interlaced=true) code to perform YUY2 upsampling for AVS 2.0x version of your plugin... ATM it seems that neither AVS 2.5 internal ConvertToYUY2(interlaced=true) treats interlaced frames as it should :D
bond
9th March 2003, 12:43
I just encoded a small clip with the following script:
LoadPlugin("C:\...\mpegdecoder.dll")
mpegsource("C:\...\movie.d2v")
trim(140153,147269)
crop(2,80,716,418)
BicubicResize(640,256,0,0.5)
but not the specified framerange [7116 frames with trim()] was encoded but some other 7116 frames a little bit later in the movie.
i used
mpegdecoder 2.03
dvd2avi 1.76
EDIT: i got the same results with the .d2v created by mpegdecoder.dll
i guess the failure is caused because i used trim()!?
btw isnt there a possibility to load .lst files anymore?
seewen
9th March 2003, 15:55
I really don't understand why you need to make politic in this forum.
unplugged
9th March 2003, 16:09
@bond, seeking is a known problem, if you want it and its speed you have to encode from 1st frame, of course.
bond
9th March 2003, 16:51
@seewen
i think that everybodies life is influenced by politics, so why not showing your opinions?
I dont want to start a discussion in this forum although i wouldnt say 'no' to one ;)
@unplugged
thanks for clearing things up
jrmann1999
11th March 2003, 04:33
I wanted to post this here for completeness(I cross posted, sorry :( ) The new build of mpegdecoder is awesome! It finally loads Transport Streams produced by the MyHD card. However, this being said it has a bit of a bug I think. The automatic pid detection is great, but streams that contain two video streams are not working. I've tried:
mpegsource("g:\bleh.tp", 0, "0x14")
to force the stream 0x14 to be detected(verified with hdtv2mpeg that this stream is correct) and the resulting d2v detects 0x24(a lovely weather radar). Unless I'm doing the parameter wrong now?
Nic
11th March 2003, 17:14
Two video streams! not a combination I accounted for. The parameter override may not be working because the new PID detection overrides it.
Ill fix it soon :)
-Nic
trbarry
12th March 2003, 04:45
Be careful that's really the video PID. Usually those are x11,21,31, ... and the audio PID's are x14,24,34 ...
- Tom
Nic
12th March 2003, 09:53
http://nic.dnsalias.com/mpgtx.exe
run that as: mpgtx -i d:\dump.ts
where d:\dump.ts is your transport stream. That will get all the PIDs for you.
At present MPEGDecoder doesnt pay any attention to the PID number you put in. :( Ill release a new version very soon to let you enter it.
Cheers,
-Nic
jrmann1999
12th March 2003, 19:53
@trbarry:
My video/audio pids are totally reversed. 0x11,0x14 are one stream, 0x21,0x24 are another w/ the 0x#4 pids being video....
@nic:
Thanks! I was quite happy when your decoder opened the stream without me having to decode it externally.
Nic
13th March 2003, 10:09
There also seems to be a bug in the way I read in transport stream D2V files (i.e. if the streamtype == 2 I forgot to read the PIDs text line...doh)
Ill fix both these things soon :)
-Nic
bond
16th March 2003, 14:32
Originally posted by myself
I just encoded a small clip with the following script:
LoadPlugin("C:\...\mpegdecoder.dll")
mpegsource("C:\...\movie.d2v")
trim(140153,147269)
crop(2,80,716,418)
BicubicResize(640,256,0,0.5)
but not the specified framerange [140153-147269 (7116 frames)] was encoded but some other 7116 frames a little bit later in the movie.
i used
mpegdecoder 2.03
dvd2avi 1.76
btw i got the same results with the .d2v created by mpegdecoder.dllHi now i found out that this failure only accures if i use "mpegsource" in my .avs-script!
if i use "mpeg2source" the right framerange is encoded!
Nic
16th March 2003, 15:04
Thats because Seeking doesn't work I think. It doesn't have frame accurate seeking, seeing its so popular perhaps I should think about adding it ;)
(I only made the plugin for encoding so I didn't really think to add seeking)
Cheers,
-Nic
bond
16th March 2003, 15:21
ok thanks for clarifing!
FuPP
16th March 2003, 23:04
Originally posted by Nic
Thats because Seeking doesn't work I think. It doesn't have frame accurate seeking, seeing its so popular perhaps I should think about adding it ;)
It would be really great, Nic !
Regards,
FuPP.
jrmann1999
18th March 2003, 04:33
Just curious whether or not you could include the dvd2avi routines to demux the embedded AC3 stream? It would save the time needed to do it manually with trbarry's version.
scmccarthy
18th March 2003, 15:38
Did Tom Barry make an AC3 stream demuxer?
Stephen
jrmann1999
18th March 2003, 16:08
No, he did however make a version of dvd2avi that can read transport streams. I find it has the best luck with demuxing of the embedded AC3 within the stream.
Nic
18th March 2003, 17:48
Im already demuxing the video stream with my code, demuxing the ac3 stream would be just as easy. But I don't think an avisynth filter is really the place for demuxing, your better off using trbarry's dvd2avi.
(I'd add more to trbarry's DVD2AVI but the Transport Streams it creates arent compatible with the ones I use (made by hardware encoders and my own ps->ts converter). It'd be better for me to get my a*s in gear and release my rewrite version of dvd2avi, which handles all of them)
-Nic
jrmann1999
18th March 2003, 18:12
My thoughts on this are, since your dll spends the time to create a d2v file, it wouldn't be that much more odd to demux the ac3 at the exact same time. Audio processing would be done externally but just to have a nice all-in-one tool that can deal with TS effectively would be a godsend.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.