Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th July 2014, 13:50   #1  |  Link
JimmyBarnes
the Interrogator
 
JimmyBarnes's Avatar
 
Join Date: Oct 2001
Location: DownUnder
Posts: 664
How to use SelectRangeEvery on this?

Most Blu-rays seem to have M2TS files containing H.264 or VC-1 video but some have MPEG Video v2, Main@High (profile).

It's no problem using SelectRangeEvery on an M2TS containing H.264 or VC-1 video, but when I try to use it with an M2TS containing MPEG Video v2 as DirectShowSource and convert with VFAPI Reader Codec 1.05, it hangs.

Clues please
JimmyBarnes is offline   Reply With Quote
Old 7th July 2014, 14:47   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
First of all, what are you trying to achieve with SelectRangeEvery()?

Secondly, my first guess would be that DirectShowSource(), and whatever DirectShow-Filters are involved, can't cope with the access pattern produced by SelectRangeEvery. What DirectShow filters are you using in particular?

Also: Why not use DGMPGDec instead of DirectShowSource? DirectShowSource is notorious for producing all kinds of strange problems...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 7th July 2014 at 15:20.
LoRd_MuldeR is offline   Reply With Quote
Old 7th July 2014, 15:20   #3  |  Link
JimmyBarnes
the Interrogator
 
JimmyBarnes's Avatar
 
Join Date: Oct 2001
Location: DownUnder
Posts: 664
Quote:
Originally Posted by LoRd_MuldeR View Post
First of all, what are you trying to achieve with SelectRangeEvery()?
My AVS contains these 2 lines:

DirectShowSource("Z:\BDMV\STREAM\00001.m2ts")
SelectRangeEvery(300,30)

I am using it as a "compression test" to get an estimate of the final size using various parameters, but in a tenth of the time.

Quote:
Secondly, my first guess would be that DirectShowSource(). and whatever DirectShow-Filters are involved, can't cope with the access pattern produces by SelectRangeEvery. What DirectShow filters are you using in particular?

Also: Why not use DGMPGDec instead of DirectShowSource? DirectShowSource is notorious for producing all kinds of strange problems...
What would the specific line using DGMPGDec in the AVS look like?
JimmyBarnes is offline   Reply With Quote
Old 7th July 2014, 15:22   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by JimmyBarnes View Post
What would the specific line using DGMPGDec in the AVS look like?
What part of the DGDecode manual exactly you did not understand?

http://rationalqm.us/dgmpgdec/DGDecodeManual.html
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 7th July 2014, 15:35   #5  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Don't use DirectShowSource? (And if you must, use DSS2.) Seeking under DirectShowSource is unreliable at best, and crashes at worst, as you've seen, so consider using L-SMASH Source or FFMS2 instead.

If you need to use DSS, we'll need more info to help. Get GraphStudioNext and load both a working (H.264) mpls and a failing (MPEG-2) mpls, and compare them. Is one using a completely different decoder filter? You might need to tweak your filter priorities, or enable MPEG-2 decoding for your preferred filter. Even if they're the same, you need to open the filter properties and check whether anything special is being done: Is it using hardware decoding for one or both? Disabling that for MPEG-2 might help if there's a bug. If all else fails, disable decoding that way, install another filter (like LAV, ffdshow, or gabest) and test with that instead.

Edit: I forgot that dgmpgdec was upgraded to work with mpls. Great idea, Mulder!
foxyshadis is offline   Reply With Quote
Old 7th July 2014, 15:36   #6  |  Link
JimmyBarnes
the Interrogator
 
JimmyBarnes's Avatar
 
Join Date: Oct 2001
Location: DownUnder
Posts: 664
Quote:
Originally Posted by LoRd_MuldeR View Post
What part of the DGDecode manual exactly you did not understand?

http://rationalqm.us/dgmpgdec/DGDecodeManual.html
The DGDecode 1.5.8 Usage Examples do not include any references to M2TS files
JimmyBarnes is offline   Reply With Quote
Old 7th July 2014, 15:41   #7  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by JimmyBarnes View Post
The DGDecode 1.5.8 Usage Examples do not include any references to M2TS files
Quote:
Originally Posted by DGDecode Manual
DGDecode, part of the DGMPGDec package, is an MPEG-1/2 decoder plug-in designed for AviSynth [...] It's able to decode any MPEG-1 or MPEG-2 stream readable by DGIndex.
You need to index the file first, using the DGIndex program. This results in a .d2v project file that you can load via DGDecode...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 7th July 2014 at 15:49.
LoRd_MuldeR is offline   Reply With Quote
Old 7th July 2014, 18:15   #8  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by JimmyBarnes View Post
The DGDecode 1.5.8 Usage Examples do not include any references to M2TS files
If DGIndex does not handle the m2ts file, you'll have to de-multiplex the video stream first (use eac3to) and then index it.

Edit: Alternatively, use "LWLibavVideoSource". It's frame accurate and handles the m2ts just fine.

Last edited by Groucho2004; 7th July 2014 at 18:39.
Groucho2004 is offline   Reply With Quote
Old 8th July 2014, 01:13   #9  |  Link
JimmyBarnes
the Interrogator
 
JimmyBarnes's Avatar
 
Join Date: Oct 2001
Location: DownUnder
Posts: 664
Quote:
Originally Posted by Groucho2004 View Post
If DGIndex does not handle the m2ts file, you'll have to de-multiplex the video stream first (use eac3to) and then index it.
DGIndex handles DVD/VOB but not Blu-ray/M2TS, at least the ones I've tried - results in a horrible green display.

I know how to demux the video, how to "index" it to a filetype that DGIndex supports?

Quote:
Edit: Alternatively, use "LWLibavVideoSource". It's frame accurate and handles the m2ts just fine.
LWLibavVideoSource(source="source.m2ts", stream_index=-1, threads=0, cache=true, seek_mode=0, seek_threshold=10, dr=false, repeat=false, dominance=0, stacked=false, format="")

but what else is needed in the AVS to make the above work?
JimmyBarnes is offline   Reply With Quote
Old 8th July 2014, 01:20   #10  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by JimmyBarnes View Post
DGIndex handles DVD/VOB but not Blu-ray/M2TS, at least the ones I've tried - results in a horrible green display.
DGIndex should work with M2TS containing MPEG2 video. Can you post a link to a sample that doesn't work for you?

Remember, DGIndex works only with MPEG1/2, not AVC or VC1.

Quote:
but what else is needed in the AVS to make the above work?
You have to load the filter DLL using loadplugin(), or put it in your Avisynth autoload directory.

Last edited by videoh; 8th July 2014 at 02:24.
videoh is offline   Reply With Quote
Old 8th July 2014, 01:26   #11  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by JimmyBarnes View Post
DGIndex handles DVD/VOB but not Blu-ray/M2TS, at least the ones I've tried - results in a horrible green display.
DGIndex should support M2TS. There's even a remark about demuxing audio tracks from M2TS/BluRay files in the DGIndex manual.

But DGMPGDec only supports MPEG-1 and MPEG-2 video. So are you 100% sure your M2TS file contains MEPG-2 video?

Quote:
Originally Posted by JimmyBarnes View Post
I know how to demux the video, how to "index" it to a filetype that DGIndex supports?
You can try to demux the elementary MPEG-2 stream from the M2TS file using a tool like eac3to or tsMuxeR.

Indexing is what the DGIndex program does and what will produce the required .d2v project file. You can't use DGDecode in another way.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 8th July 2014, 02:51   #12  |  Link
JimmyBarnes
the Interrogator
 
JimmyBarnes's Avatar
 
Join Date: Oct 2001
Location: DownUnder
Posts: 664
Quote:
Originally Posted by LoRd_MuldeR View Post
DGIndex should support M2TS. There's even a remark about demuxing audio tracks from M2TS/BluRay files in the DGIndex manual.

But DGMPGDec only supports MPEG-1 and MPEG-2 video. So are you 100% sure your M2TS file contains MEPG-2 video?
This is what MediaInfo 0.7.68 says:
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : Main@High
JimmyBarnes is offline   Reply With Quote
Old 8th July 2014, 02:53   #13  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Can you post a link to a sample? You can cut it with DGSplit.
videoh is offline   Reply With Quote
Old 11th July 2014, 14:11   #14  |  Link
JimmyBarnes
the Interrogator
 
JimmyBarnes's Avatar
 
Join Date: Oct 2001
Location: DownUnder
Posts: 664
Quote:
Originally Posted by videoh View Post
Can you post a link to a sample? You can cut it with DGSplit.
I took a punt and did the full 14 hr encode, results look reasonable.

M2TSs with MPEG video are relatively uncommon fortunately, will try some of these suggestions next time...
JimmyBarnes is offline   Reply With Quote
Old 11th July 2014, 14:17   #15  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by JimmyBarnes View Post
I took a punt and did the full 14 hr encode, results look reasonable.

M2TSs with MPEG video are relatively uncommon fortunately, will try some of these suggestions next time...
But you had said this:

Quote:
DGIndex handles DVD/VOB but not Blu-ray/M2TS, at least the ones I've tried - results in a horrible green display.
Are you saying now that you made an error? Maybe it wasn't MPEG2? If there is a problem in DGMPGDec, it's important to get it fixed. Thanks for any clarification you can offer.
videoh is offline   Reply With Quote
Old 11th July 2014, 14:41   #16  |  Link
JimmyBarnes
the Interrogator
 
JimmyBarnes's Avatar
 
Join Date: Oct 2001
Location: DownUnder
Posts: 664
Quote:
Originally Posted by videoh View Post
But you had said this:

Are you saying now that you made an error? Maybe it wasn't MPEG2? If there is a problem in DGMPGDec, it's important to get it fixed. Thanks for any clarification you can offer.
I do my Blu-ray encodes in TMPGEnc 4.0 Xpress, not by using DGIndex. Only used the latter for DVD encodes - rare now.

The object of this thread was to find a way to do compression tests using SelectRangeEvery(300,30). No probs with M2TS containing H.264 or VC-1 video, but freezes with "MPEG video, version 2".
JimmyBarnes is offline   Reply With Quote
Old 11th July 2014, 15:14   #17  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by JimmyBarnes View Post
I do my Blu-ray encodes in TMPGEnc 4.0 Xpress, not by using DGIndex. Only used the latter for DVD encodes - rare now.

The object of this thread was to find a way to do compression tests using SelectRangeEvery(300,30). No probs with M2TS containing H.264 or VC-1 video, but freezes with "MPEG video, version 2".
I'll try once more...

You said that DGMPGDec produced a horrible green screen with an MPEG2 M2TS. Are you still claiming that? If so, can you post a link to a sample?

Quote:
Originally Posted by JimmyBarnes View Post
DGIndex handles DVD/VOB but not Blu-ray/M2TS, at least the ones I've tried - results in a horrible green display.
videoh is offline   Reply With Quote
Old 12th July 2014, 04:06   #18  |  Link
JimmyBarnes
the Interrogator
 
JimmyBarnes's Avatar
 
Join Date: Oct 2001
Location: DownUnder
Posts: 664
Quote:
Originally Posted by videoh View Post
I'll try once more...

You said that DGMPGDec produced a horrible green screen with an MPEG2 M2TS. Are you still claiming that? If so, can you post a link to a sample?
Yes

Eat your heart out
http://www.mediafire.com/download/u7...i2g/01876.m2ts
JimmyBarnes is offline   Reply With Quote
Old 12th July 2014, 04:24   #19  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
Quote:
Originally Posted by JimmyBarnes View Post
Eat your heart out
Thanks, I'll have a look. Can't really understand your tone, though, when I am trying to help you.

EDIT: Everything works fine for me in DGMPGDec 1.5.8 with that stream. I'm sure others will confirm it.

Last edited by videoh; 12th July 2014 at 04:28.
videoh is offline   Reply With Quote
Old 12th July 2014, 09:19   #20  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by videoh View Post
EDIT: Everything works fine for me in DGMPGDec 1.5.8 with that stream. I'm sure others will confirm it.
confirmed.

Added:
Works well here, even with DS:
1) demux the .m2ts with tsMuxer
2) Script:
Code:
DirectShowSource("C:\Temp\ABTF promo.track_4113.mpv")
selectrangeevery(300,30)

Last edited by Sharc; 12th July 2014 at 09:51.
Sharc is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.