Log in

View Full Version : Blu-ray to x264 (audio and video)


Roppy
9th December 2007, 06:07
Hi there

I read a lot of thread on this forum but well.. can'T figure it out
I did successfully encoded some x264 with hd-dvd sources, but.. can't do anything with Blu-ray.

First, I need to know how to demux audio, I know everyone'S using xport but well, can't get it working here, the only time it worked, i had a 24min39sec movie (source is superman's return)
And main error i have is (Transport sync error)

Then, i tried demuxing audio with Tsremux, samething... some random file, and last ones were stalled at 0bytes.

Anyone can help me out? please, i'm going nutz!!! eheh

I have one big 00000.m2ts... but.. what's next?

Thank you :)

ACrowley
16th December 2007, 10:13
simply encode directly on the m2ts

graph :

Filesource(async)-SonicHDDemuxer-SonicCinemasterVideoDecoder4.3

AVS
Directshowsource("c:\xxx.grf",audio=false,fps=23.976)

Thats all, no need to demux Bluray Streams, imho

Guest
16th December 2007, 15:55
The OP asked for audio and video. You haven't given him a solution for the audio.

drmpeg
16th December 2007, 22:21
Hi there

I read a lot of thread on this forum but well.. can'T figure it out
I did successfully encoded some x264 with hd-dvd sources, but.. can't do anything with Blu-ray.

First, I need to know how to demux audio, I know everyone'S using xport but well, can't get it working here, the only time it worked, i had a 24min39sec movie (source is superman's return)
And main error i have is (Transport sync error)

Then, i tried demuxing audio with Tsremux, samething... some random file, and last ones were stalled at 0bytes.

Anyone can help me out? please, i'm going nutz!!! eheh

I have one big 00000.m2ts... but.. what's next?

Thank you :)
xport should work for you. Just to make sure you're using it properly, here's an example (note that the -h option is required).

C:\xfer>xport -h 00056.m2ts 1 1 1
xport Transport Stream Demuxer 1.00
program = 1, video channel = 1, audio channel = 1
Program Number = 0 (0x0000), Program Map PID = 31 (0x001f)
Program Number = 1 (0x0001), Program Map PID = 256 (0x0100)
program descriptor = 0x05, 0x04, 0x48, 0x44, 0x4d, 0x56
program descriptor = 0x88, 0x04, 0x0f, 0xff, 0xff, 0xfc
Video PID = 4113 <0x1011>, type = 0x1b
ES descriptor for stream type 0x1b = 0x05, 0x08, 0x48, 0x44, 0x4d, 0x56, 0xff, 0x1b, 0x61, 0x3f
Audio PID = 4352 <0x1100>, type = 0x80
ES descriptor for stream type 0x80 = 0x05, 0x08, 0x48, 0x44, 0x4d, 0x56, 0xff, 0x80, 0x61, 0xff
ES descriptor for stream type 0x81 = 0x05, 0x04, 0x41, 0x43, 0x2d, 0x33
ES descriptor for stream type 0x81 = 0x81, 0x04, 0x06, 0x48, 0x0e, 0x00
ES descriptor for stream type 0x81 = 0x05, 0x04, 0x41, 0x43, 0x2d, 0x33
ES descriptor for stream type 0x81 = 0x81, 0x04, 0x06, 0x48, 0x0e, 0x00
ES descriptor for stream type 0x81 = 0x05, 0x04, 0x41, 0x43, 0x2d, 0x33
ES descriptor for stream type 0x81 = 0x81, 0x04, 0x06, 0x48, 0x0e, 0x00
ES descriptor for stream type 0x81 = 0x05, 0x04, 0x41, 0x43, 0x2d, 0x33
ES descriptor for stream type 0x81 = 0x81, 0x04, 0x06, 0x29, 0x04, 0x00
0 frames before first I-frame
High Profile
Level = 4.1
LPCM Audio Mode = 3/2+lfe
LPCM Audio Bits/sample = 24
LPCM Audio Sample Rate = 48000
First Video PTS = 0x000ffff0
ts rate = unspecified
packets for pid 0 <0x0000> = 21, first = 1, last = 51544
packets for pid 31 <0x001f> = 3, first = 3, last = 50006
packets for pid 256 <0x0100> = 21, first = 2, last = 51545
packets for pid 4097 <0x1001> = 22, first = 4, last = 51674
packets for pid 4113 <0x1011> = 37006, first = 5, last = 52084
packets for pid 4352 <0x1100> = 11705, first = 1471, last = 52015
packets for pid 4353 <0x1101> = 963, first = 1638, last = 51788
packets for pid 4354 <0x1102> = 963, first = 1658, last = 51790
packets for pid 4355 <0x1103> = 963, first = 1685, last = 51792
packets for pid 4356 <0x1104> = 403, first = 1759, last = 51718
packets for pid 4609 <0x1201> = 7, first = 6, last = 2220
packets for pid 4610 <0x1202> = 7, first = 10, last = 2226
coded pictures = 67, video fields = 0

C:\xfer>

You shouldn't be getting any "Transport Sync Error" messages. If you're getting a zillion, then you probably forgot to use the -h option. If you're getting a few, then you have some corruption in your file.

Ron

Roppy
19th December 2007, 21:51
ok... i tried but... well.. when I encode that video, it's not working, it keeps going and going.. file was at 27gbs and keep going.
I have no problem with hd-dvd since you directly put the framecount... but well... blu-ray.. not working :(
dunno if i do something wrong.. avs looks like

Directshowsource("video.grf", fps=23.9760431376968, audio=false)

When using sonic 4.3 as decoder
I have a
avis [error]: "unsupported input format (DIB)"
x264 [error]: "could not open input file "video.avs"

Thanks for help

Dark Shikari
19th December 2007, 21:55
ok... i tried but... well.. when I encode that video, it's not working, it keeps going and going.. file was at 27gbs and keep going.
I have no problem with hd-dvd since you directly put the framecount... but well... blu-ray.. not working :(
dunno if i do something wrong.. avs looks like

Directshowsource("video.grf", fps=23.9760431376968, audio=false)

When using sonic 4.3 as decoder
I have a
avis [error]: "unsupported input format (DIB)"
x264 [error]: "could not open input file "video.avs"

Thanks for helpThat's because Sonic is converting to RGB, and you need to convert back to YV12 for x264 to use for input.

Roppy
20th December 2007, 02:14
and.. how can i do this?

thanks

Roppy
20th December 2007, 02:16
Directshowsource("video.grf", fps=23.9760431376968, audio=false)
Crop(0,140,0,-140)
ConvertToYV12()

i tried this way.. but not working at, still same result

Dark Shikari
20th December 2007, 02:20
Directshowsource("video.grf", fps=23.9760431376968, audio=false)
Crop(0,140,0,-140)
ConvertToYV12()

i tried this way.. but not working at, still same resultOpen the AVS in a media player--does it play back? DIB can either mean that the output is RGB, *or* that there is an error in the AVS file.

Sergey A. Sablin
20th December 2007, 06:52
Open the AVS in a media player--does it play back? DIB can either mean that the output is RGB, *or* that there is an error in the AVS file.

some AVI handlers including AviSynth (iirc) write DIB instead of real fourcc into fccHandler for some reason, while still correctly set biCompression in bitmap info header. Thus checking biCompression is much more usable instead of checking fccHandler.
x264 does latter, which leads to additional time for two color space conversion (for decoders which actually works at 420 colorspace), not to mention loss of quality in such a case.

Roppy
20th December 2007, 13:45
Hi there

I tried playing the .avs with mpc.
Result:
DirectShowsource: GRF file does not have a compatible open video pin, Graph must have 1 output pin that will bid RGB24, RGB32, ARGB, YUY2, or YV12

Avs is

Directshowsource("testguide.grf", fps=23.9760431376968, audio=false)
Crop(0,140,0,-140)
ConvertToYV12()

akupenguin
20th December 2007, 17:45
x264 does latter, which leads to additional time for two color space conversion (for decoders which actually works at 420 colorspace), not to mention loss of quality in such a case.
What colorspace conversion? There are only two cases: avisynth provides YUV 4:2:0 and x264 uses it with no conversion, or avisynth provides any other colorspace and x264 refuses to encode.

Sergey A. Sablin
21st December 2007, 06:21
What colorspace conversion? There are only two cases: avisynth provides YUV 4:2:0 and x264 uses it with no conversion, or avisynth provides any other colorspace and x264 refuses to encode.

I saw a number of AVI or AVS files with DIB fourCC and YV12/IYUV/I420 colorspaces. x264 refuses DIB fourCC and thus color conversion has to be made via AviSynth. Can't provide you an example atm.

Roppy
21st December 2007, 13:04
Sergey...
OK but.. what do I have to do to .. encode my stream? :P
Anything i have to add to my .avs?

Thanks

Sergey A. Sablin
21st December 2007, 13:54
Sergey...
OK but.. what do I have to do to .. encode my stream? :P
Anything i have to add to my .avs?

Thanks

if this script:

Directshowsource("video.grf", fps=23.9760431376968, audio=false)
Crop(0,140,0,-140)
ConvertToYV12()


gives you an error:

avis [error]: "unsupported input format (DIB)"
x264 [error]: "could not open input file "video.avs"

then go ahead and check what color space actually avisynth provides. debug x264 and check this out by yourself. or provide the source video (a part of it is enough) with all the filters you use, and hopefully for you someone will do the work for you.

akupenguin
21st December 2007, 17:29
I saw a number of AVI or AVS files with DIB fourCC and YV12/IYUV/I420 colorspaces. x264 refuses DIB fourCC and thus color conversion has to be made via AviSynth. Can't provide you an example atm.
But if it's really 4:2:0 already, then piping through avisynth won't change the content. What would avisynth do, say "it's YV12, the user wants YV12, so I'll convert to RGB and back"?

Sergey A. Sablin
22nd December 2007, 10:55
But if it's really 4:2:0 already, then piping through avisynth won't change the content. What would avisynth do, say "it's YV12, the user wants YV12, so I'll convert to RGB and back"?

it doesn't change content, but somehow sometimes fccHandler becomes DIB instead of YV12, while biCompression is still YV12. That's what I did say.
For this case x264 will require at least some workarounds in the script. Perhaps such external workarounds will involve additional color conversion, while it could be done easily in x264 perfectly safe once and for all.

ok... i tried but... well.. when I encode that video, it's not working, it keeps going and going.. file was at 27gbs and keep going.
I have no problem with hd-dvd since you directly put the framecount... but well... blu-ray.. not working
dunno if i do something wrong.. avs looks like

Directshowsource("video.grf", fps=23.9760431376968, audio=false)

When using sonic 4.3 as decoder
I have a
avis [error]: "unsupported input format (DIB)"
x264 [error]: "could not open input file "video.avs"

Thanks for help


Directshowsource("video.grf", fps=23.9760431376968, audio=false)
Crop(0,140,0,-140)
ConvertToYV12()

i tried this way.. but not working at, still same result

do you have any other explanations for this?

bond
23rd December 2007, 12:49
moved

Roppy
24th December 2007, 07:34
moved... where?

Snowknight26
25th December 2007, 04:16
Open regedit
HKEY_LOCAL_MACHINE\SOFTWARE\Sonic\CommonMPEGDecoders\4.2\VideoDecoder
Change AllowAllRenderers from 0 to 1.

ACrowley
25th December 2007, 11:06
Open regedit
HKEY_LOCAL_MACHINE\SOFTWARE\Sonic\CommonMPEGDecoders\4.2\VideoDecoder
Change AllowAllRenderers from 0 to 1.

Yes..but in Vista is not such a Entry.
Works fine for XP

Snowknight26
26th December 2007, 08:02
Yes there is because I got that key name from an installation on Vista.
If its not there, you have to use the Sonic video decoder to make the keys and values, then you can edit the data.

Roppy
29th December 2007, 01:04
That AllowAllrenderers is supposed to modify what?!?
I changed it but well... still have the same problems.
thx

Snowknight26
29th December 2007, 03:23
Its supposed to allow all supported colorspaces, not just RGB32 or whatever the default for Sonic is.

Roppy
31st December 2007, 20:30
well... not working :\
can't figure out that blu-ray rip...
i tried something but.. when it starts, it's really slow and well it shows a total frames of like 2 billions...
Cpu is Q6600... should be faster

Snowknight26
1st January 2008, 01:57
I recently had the same error, so I opened the avs in mplayerc and it told me that YUV images cannot be cropped by odd numbers. Once I fixed that it worked.

So just because it says unsupported video format doesn't necessarily mean its a colorspace problem. Make sure all your filters/functions in your script written properly.

Roppy
1st January 2008, 18:14
Directshowsource("video.grf", fps=23.9760431376968, audio=false, framecount=206368)
Crop(0,140,0,-140)

Graphedit is Filesync (using rebuilt file) then ... i tried with various
H264. cyberlink h264, coreAVC, sonic 4.3 4.2
nothing works

Movie is Transformers (HD-DVD)

Roppy
1st January 2008, 18:22
When i try to play the avs, it plays in MPC but well can't encode it
I receive this
avis [error] unsupported input format (YUY2)
x264 [error] could not open input file "video.avs"

Roppy
1st January 2008, 18:25
I just read that on a forum...
Do i have to "rebuilt" or demux the h264 stream with Evodemux?

"the h264 file needs to be a .mpv (elementary stream ie without a container) "

Snowknight26
1st January 2008, 19:42
You don't have
ConvertToYV12() in your avs.

Beastie Boy
2nd January 2008, 15:55
Movie is Transformers (HD-DVD)

But the title of this thread is 'Blu-ray to x264 (audio and video)' :confused:

I had no problem re-encoding Transformers (HD-DVD) using DGAVCDec. There is a thread relating to it in this forum. Demux the .h264 file and index it using DGAVCDec with Force Film on, and write an avs script as per the included help file.
For the audio, simply use eac3to.

You said MPC gave an error about not having an open pin in your graph. Do you have an open pin? What is your complete graph in Graphedit?

Cheers, Beastie.

Roppy
3rd January 2008, 23:41
great.. just add that converto... it worked for the h264 but well... working on the bluray sources...

Supermans return is my source
when starting the encoding line
I can see
"avis info 1920X800 @ 23.98 fps (1872691953 frames)"

Last time i let it run... it keeps encoding and encoding.. why such a big framecount? if I add the trim(0,X) it works perfectly... but well.. kinda hard to know the total number of frames in a movie...
any suggestion? idea hints?

Thanks a lot guys =) was going nuts eheh

Snowknight26
4th January 2008, 00:18
You using a graph for this one? What does it look like? Same avs?

Roppy
4th January 2008, 01:26
Only an AVS file which is ...

AVS file
Directshowsource("00000.m2ts", fps=23.9760431376968, audio=false)
Crop(0,140,0,-140)

If using a ... graphedit what would be the filters?
thanks

Snowknight26
4th January 2008, 01:51
If you're doing the Superman Returns Blu-ray, a graph of
Haali Media Splitter (m2ts) -> ffdshow should work.
If not, try WMVideo Decoder DMO instead of ffdshow.

Roppy
4th January 2008, 02:04
it's... encoding same results using only the .avs file without .grf.
My problem is... both ways shows a framecount of 1 872 691 953 frames... which is.. kinda high :P
Is that normal ?

when using haali & wmvideo decoder dmo, i have haali AR between haali and wmv. normal too?
thx

Roppy
4th January 2008, 20:58
And.. i forgot to mention that i have artefacts when using the ConvertToYV12() codec conflict?