PDA

View Full Version : How I got directshowsource to use VC1 from Blu Ray


Jeremy Duncan
23rd June 2009, 22:20
VC1 encoding guide

__________________

haali media splitter: install
http://www.videohelp.com/tools/Haali_Media_Splitter

anydvd: Rip
http://www.slysoft.com/en/anydvd.html

tsmuxer: Demux
http://www.videohelp.com/tools/tsMuxeR

mkvtoolnix: mux vc1 to mkv with timecode
http://www.videohelp.com/tools/MKVtoolnix

graphedit: make grf file from the mkv file mvktoolnix made
http://www.videohelp.com/tools/GraphEdit

______________________________________________

Step 1.) rip the vc1 blu ray using anydvd.

Step 2.) demux the audio and video using tsmuxer.
you may downconvert the audio to dts.

Step 3.) mux the vc1 to mkv using mkvtoolnix.

Create a text file with this code and call the file Timecode.:
# timecode format v1
assume 23.976

- Open mkvtoolnix and add the file.
Click the video to highlight it then from the timecodes button add the timecodes file you made.
Click start muxing.

Step 4.) use graphedit to build a grf file
Build grf : Haalimediasplitter-WMVideodecoderDMO

- Open Graphedit.

- Click the Graph button and the Insert filters button.

- From the list choose Directshow Filters and click "Haali Media Splitter", then click insert filter.
There will be a pop up asking you for a input file. Change "All Media Files" to "All Files (*.*)".
Then go to where you saved the file you made with mkvtoolnix and click that then click open and in graphedit you will see the mkv file.

- Now from the Same directshow filters list you chose Haali media splitter from, scroll to the bottom of that list and click "WMVideo Decoder DMO" and then "Insert Filter".
It will be the color Green.
Now Close the Insert filters list by pressing the red "x".

- In the graphedit you will see two boxes: ____.mkv, wmvideo decoder dmo.
These boxes have tiny squares on them. Join the boxes using the same method as drag and drop.

Click the tiny box in the mkv file and drap it to the wmvideo decoder where it says in0.
Once you join them the boxes will have color.

- Now save this work from the file tab.

Step 5.) In the code below it shows the file extension GRF. This is the location you saved the file you made in graphedit.
Run the avs script through megui.
DirectShowSource("G:\Matrix1\Matrix1.grf",audio=false,fps=23.976)

How to split a vc1 section from a movie

__________________

- You first demuxed the vc1 using tsmuxer.
- Split only 1 chunk from the vc1. If you split more than one chunk the second and consecutive chunks don't work properly.
Only the first chunk works properly, so make it a large enough size: 500MB or 1GB.
- Use the program mkvtoolnix and the Timecode and mux the vc1 to mkv.
- Make the graph in graphedit and directshowsource uses the grf as a video vile.

- if you make the whole movie a mkv then use dgsplit and take a chunk of the mkv.
Then run the chunk you split through mkvtoolnix again with the timecode file,
the video will be all jerky for some reason.
So doing this isn't as good as taking the chunk from the source vc1.

- Taking a chunk is good for encoding tests as it's faster than encoding the whole movie which can take a day or more.

neuron2
23rd June 2009, 23:10
One way if you have a supported Nvidia graphics adapter: DGVC1DecNV.

poisondeathray
23rd June 2009, 23:14
Do you have a haali media splitter and a directshow vc-1 decoder installed?

Jeremy Duncan
23rd June 2009, 23:36
Do you have a haali media splitter and a directshow vc-1 decoder installed?

Yes, Haali media splitter and ffdshow.

Midzuki
24th June 2009, 06:41
VC1ESParser.dll allows you to open "raw" VC-1 streams directly.

# The video source does have constant frame rate
DirectShowSource("example.vc1", fps=29.97, framecount=120000)
# It works!

neuron2
24th June 2009, 14:32
Where is the documentation for VC1ESParser.dll?

What does it do and how does one use it?

Kurtnoise
24th June 2009, 14:36
Part of the VC1 SDK (http://www.microsoft.com/downloads/details.aspx?familyid=5031c859-e8da-41bc-98e3-c13add5378b0&displaylang=en&tm)...and it's clearly mentioned that we cannot distribute it.

Midzuki
24th June 2009, 14:54
@ neuron2 & Kurtnoise: thanks for the warning.

I will remove the binary from my wannabe website right away.

13:00 GMT --- binary successfully deleted. :)

Jeremy Duncan
24th June 2009, 14:54
link (http://forum.doom9.org/archive/index.php/t-128946.html)

I read in the link that to get directshowsource to run vc1 video I do the steps below:
1.) 1.gdsmux/ HaaliMatroskamuxer ( VC1 to mkv)
2.) 2. Make a Timecode text file with these llines:
# timecode format v1
assume 23.976
3.) Remux the first mkv file with mkvmerge and insert the above Timecode File.
"You will see some warnings but it's ok.
Now you have a mkv file with correct time, full seek and you
don't need framecount value, you need only fps=23.976 in avisynth."
4.) Build grf with Graphedit :
Haalimediasplitter-WMVideodecoderDMO
5.) example avs script:
DirectShowSource("G:\Matrix1\Matrix1.grf",audio=false,fps=23.976)

______________


I wonder what any of you think about this procedure?
Question.) Is it up to date and correct? :)

Question.) Do I demux the audio and video from the vc1 using tsmuxer before doing the above 5 steps using only the video?
Then mux the audio in using megui into the final encoded video?

rack04
24th June 2009, 15:01
Before I purchased DGVC1DecNV I would mux the raw VC1 stream into MKV using eac3to and then create a avisynth script using DirectShowSource.

:vc1
Echo.
Echo.
Echo.[ %TIME% ] Creating AviSynth Script ...
Echo.

@Echo on
"%eac3to_PATH%" "%INPUT_VIDEO%" "%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.mkv"
@Echo off

if "%SOURCE_VIDFRAMERATE%" EQU "23.976" goto 23
if "%SOURCE_VIDFRAMERATE%" EQU "24.000" goto 24
if "%SOURCE_VIDFRAMERATE%" EQU "25.000" goto 25
if "%SOURCE_VIDFRAMERATE%" EQU "29.970" goto 29

:23
Echo DirectShowSource("%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.mkv", audio=false)>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs"
Echo AssumeFPS(24000,1001)>>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs"
goto encode

:24
Echo DirectShowSource("%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.mkv", audio=false)>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs"
Echo AssumeFPS(48000,2000)>>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs"
goto encode

:25
Echo DirectShowSource("%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.mkv", audio=false)>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs"
Echo AssumeFPS(50000,2000)>>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs"
goto encode

:29
Echo DirectShowSource("%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.mkv", audio=false)>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs"
Echo AssumeFPS(30000,1001)>>"%WORKING_DIRECTORY%\%SOURCE_FILENAME%-output.avs"
goto encode

Jeremy Duncan
25th June 2009, 01:34
That looks like a batch file.
I updated the first post with how I got vc1 running with directshowsource. :)

Jeremy Duncan
25th June 2009, 12:31
fyi I encoded a vc1 movie in hc enc. Then muxed the audio with tsmuxer.
The file size was about 10GB less than the vc1 version and no quality was lost.

here was my hc enc settings:

Open hc enc
Input: Open the avs
Output: where you will save the file
Log: where you will save the log
Average bitrate: Average 25000, Maximum 25000
Profile: best
Aspect ratio: 16:9
smp checked
scene change checked
autogop not checked: set to 12
dc prec 10

settings 1 tab
Progressive
gop length, b frame: 12, 2

settings 2 tab
vbr bias 100
vbv checked
write seq endcode checked

HC encode took about 6 hours on my E6600 cpu.
Around 16GB final file size.

rack04
25th June 2009, 15:33
That looks like a batch file.
I updated the first post with how I got vc1 running with directshowsource. :)

You are correct. :cool:

Blue_MiSfit
25th June 2009, 22:27
Just out of curiosity - why 25mbps CBR MPEG-2? I'm guessing hardware requirements?

Also, how could the VC1 stream be bigger, given that at most BluRay discs have a 25mbps video stream?!

~MiSfit

Jeremy Duncan
26th June 2009, 01:49
Why 25mbps? I did some test runs and settled on that number.
Why cbr? I looked at the hc enc readme and decided to use it.
Why mpeg2 for this vc1? I decided to try to see if I could then to see if the encode would be successful and the audio worked fine after the encode.
Also the file size was of interest to me, I wanted to see how big the file would be in mpeg2.
How could the vc1 be bigger? I don't know. The mpeg2 video looked indistinguishable from the disk version to my eye. I didn't do picture comparison though between the disk and encode mpeg2 version, but the mpeg2 version had detail in the spots you would look for it and didn't appear blurred at all.

The script I used was:
directshowsource(code stuff here)
# vc-1 blu ray: Baraka. This line wasn't in the avs though.
Crop(0,102,-0,-102)
Spline36Resize(1920,816).AddBorders(0,132,0,132)

setarip_old
26th June 2009, 02:02
@Jeremy Duncan

Please clarify - Was your desire to find a way to incorporate a BluRay's VC-1 videostream in an MKV wrapper?

If so, it's as simple as using (presently freeware) one-click "MakeMKV".

If I've misinterpreted your purpose, I apologize...

Jeremy Duncan
26th June 2009, 02:08
I can use mkvtoolnix to make the vc1 mkv and play this with mpc hc.
I wanted to be able to use directshowsource with the vc1 though.

I read a thread on avsforum.com in the home theater forum about people wanting to encode blu ray to frame interpolation, so I have been working out how to do that ever since.
This was about a week now.
Just about done my work I set out to do now though, a few more tests. :)

Blue_MiSfit
26th June 2009, 05:30
people wanting to encode blu ray to frame interpolation


??

You mean interpolated to 60p?!

Also, what was the file size / duration (bitrate) of your VC1 source?

~MiSfit

Jeremy Duncan
26th June 2009, 06:17
??

You mean interpolated to 60p?!

Also, what was the file size / duration (bitrate) of your VC1 source?

~MiSfit

Yes, 60 fps.

The vc1 filesize?
How do I get the bitrate value?
By duration, you mean how long the film was?