[RESOLVED] Demuxed h264 video: unable to open

Support forum for DGDecNV
Post Reply
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

[RESOLVED] Demuxed h264 video: unable to open

Post by artol »

Hi,

I found out that I can not make any use of the .h264 files demuxed from Blu-ray-sourced .m2ts files by DGIndexNV. I tried importing demuxed .h264 files to Scenarist BD at work and EasyBD Lite at home, both throw errors on input.

Of course usually this is not a problem because there are plenty of tools out there to extract .h264 streams from .m2ts files so that BD authoring tools accept them (ffmpeg does this nicely too). But the problem is I don't have source .m2ts anymore, there are gone and not obtainable again. The .h264 files demuxed by DGIndexNV are obviously OK (DGIndexNV opens and plays them), I just can't make BD authoring tools accept the files.

Is there a solution for me (except for re-encoding through DGDecNV)?
DAE avatar
Nick007
Posts: 38
Joined: Wed Sep 29, 2010 12:20 pm

Re: Demuxed h264 video: unable to open

Post by Nick007 »

Mux them to mkv with mkvmerge or eac3to? Or to m2ts with tsMuxer?
Why are you demuxing it in the first place?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

@artol

Please give me your ffmpeg command for demuxing. Then I can compare what it produces to what DGIndexNV produces. Alternatively, using a M2TS that you have, demux with both and give me links to the two resulting raw files. It doesn't have to be very large, 50MB or so should be fine.
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: Demuxed h264 video: unable to open

Post by artol »

@admin,

My bad, I found that ffmpeg demux is also problematic. It is actually eac3to which does demuxes that I can import to the BD-authoring suites:

Code: Select all

eac3to.exe 00000.m2ts  -demux
Two samples are here: http://www.sendspace.com/filegroup/RE9d ... ETbuxsw7Zw .

@ Nick007,

I did try to make .m2ts using tsMuxer to demux it to "valid" .h264. It didn't work, such files are still rejected.

My goal is to author standard-complaint Blu-ray (HDMV, not AVCHD) using this video. I can't use tsMuxer for final disc because its HDMV generation is too unreliable.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

The differences are very interesting. Can you please give me the M2TS that you demuxed those two from (again, 50MB of the M2TS should be fine)? With that I'll be able to get to the bottom of this. Thank you.
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: Demuxed h264 video: unable to open

Post by artol »

User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

There are two differences between the eac3to and dgindexnv demuxed files:

1. The dgindexnv file has an extra copy of the first SPS at the start of the file. This *should* be harmless.

2. This change to every SPS (eac3to has changed these from the original SPS):

> num_units_in_tick: 1 [ORIGINAL]
> time_scale: 48
---
< num_units_in_tick: 1000 [EAC3TO]
< time_scale: 48000

These two *should* be equivalent.

To find out which of these is causing a problem for your tools, I have patched the dgindexnv demuxed stream to remove the extra SPS but leave the original num_units_in_tick and time_scale. Please download this patched stream and advise whether your tools accept it.

http://rationalqm.us/misc/dg_patched.h264
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: Demuxed h264 video: unable to open

Post by artol »

Works with EasyBD Lite! Will check also with Scenarist BD tomorrow.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

Good to hear.

I'm thinking it is not so much the extra SPS that causes the problem, but that it is the lack of an AUD NALU before it. So can you please also check this file (which has the extra SPS also preceded by an AUD):

http://rationalqm.us/misc/dg_patched_2.h264

Once we arrive at the crucial factor I will release a fix for DGIndexNV. Thank you for pointing this out and assisting me to find the cause.
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: Demuxed h264 video: unable to open

Post by artol »

This one is quirky: EasyBD Lite imports the file and compiles the Blu-ray, though the "Video File Properties" button gets disabled in EasyBD Lite interface (it was working with the previous file).
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: Demuxed h264 video: unable to open

Post by artol »

There's more: my Panasonic DMP-BD75 does not play the Blu-ray compiled with the last file (black screen, than "playback stopped").

Blu-ray compiled with the previous version (dg_patched.h264) is playable.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

OK, thank you. I will make a fixed version for you to test.
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: Demuxed h264 video: unable to open

Post by artol »

Scenarist BD: dg_patched.h264 is fine, dg_patched_2.h264 gives "ERROR: The picture is not encoded as multi-slice picture with 4 or more slices per picture in case of Level 4.1.(Slice:0)".
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

I plan to add an option called "strict demuxing". It will avoid outputting the extra SPS/PPS's at the start. This will help you for future projects but not the ones you have already demuxed. You can fix those with a binary editor (such as Hex Editor Neo) by deleting the extra leading SPS/PPS's.
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: Demuxed h264 video: unable to open

Post by artol »

Thank you for the upcoming feature. As for my existing files, the SPS/PPS tip was priceless - I was able to fix them manually after some research on h264 binary structure. Kudos for exceptionally quick response!
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

Sweet!
User avatar
laserfan
Posts: 108
Joined: Thu Sep 09, 2010 5:16 pm

Re: Demuxed h264 video: unable to open

Post by laserfan »

artol wrote:As for my existing files, the SPS/PPS tip was priceless - I was able to fix them manually after some research on h264 binary structure.
I wonder if you might kindly relate for posterity an example of one of these repairs.
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: Demuxed h264 video: unable to open

Post by artol »

My quick-and-dirty way was to find third occurrence of 00 00 01 byte sequence in the stream (NAL Unit header start) and delete everything before.
User avatar
laserfan
Posts: 108
Joined: Thu Sep 09, 2010 5:16 pm

Re: Demuxed h264 video: unable to open

Post by laserfan »

artol wrote:My quick-and-dirty way was to find third occurrence of 00 00 01 byte sequence in the stream (NAL Unit header start) and delete everything before.
Thanks for telling! :)
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

That may not always be correct, because there may be multiple extra SPS/PPS's.

The reliable way is to look for the first AUD 00 00 01 09, and delete all the preceding NALUs, i.e., everything before the 00 00 01 09.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Demuxed h264 video: unable to open

Post by admin »

I have released version 2046 that contains a workaround for this. Set Bare_Demux=1 in your INI file. Then demuxed files will be compatible with your authoring application.
DAE avatar
artol
Posts: 10
Joined: Mon Sep 16, 2013 11:57 pm

Re: [RESOLVED] Demuxed h264 video: unable to open

Post by artol »

I have tested the new version. It works nicely. Thank you very much.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: [RESOLVED] Demuxed h264 video: unable to open

Post by admin »

Thanks for the status update and for bringing this issue to my attention.
Post Reply