Originally Posted by Phloyd
That is indeed the case. I mentioned it in this post
in the last sentence.
The problem is that for HD DVD the frames are tagged as fields, and in some cases 2 fields, some cases 3 fields (to give 3:2 pulldown). So the first thing you need to do is to change all of those tags to be frames.
Secondly, and I am not sure how important this is, the buffer timings should also be changed since they are set up for 3:2 pulldown also. These should be adjusted to better match 24 fps than 30 fps.
This information can be found in the Picture timing SEI message semantics section of the spec. The pict_struct has the frame/field thing and cpb_removal_delay and dpb_output_delay are the buffer timing parameters. You should be able to see these values in the h264_parse.exe output.
How are you doing?
I am on this exact problem but I was fortunate enough to find a blu-ray compliant version of the hddvd movie so the job is "already done". I tested the file on my PS3 and all plays perfectly. Now, the problem is to replicate that on any HD-DVD 29.97fps AVC video to convert it correctly to blu-ray 23.976fps AVC video.
As you mentioned above, the main problem seems to be the buffer values. I have no idea why they change how they do between my two files. Maybe I should read the documentation you mentioned about the SEI structures but even so I wonder if I will understand something.
I compared both files (hd-dvd and blu-ray) with elecard stream analyzer and I got mainly the following differences:
In every H264 SEI structure, the guy replaced pic_struct from whatever value it was before (it changes in the 29.97 file from HEI structure to another) to 0 all the time (0 = frame instead of interlaced). The num_clock_ts is also changed to always be equal to 1. The cpb_removal_delay changes compared to the 29.97 file but the value of the change differs each time. Same thing for dpb_output_delay.
In every H264 Sequence Parameter Set, the guy changed the gaps_in_frame_num_value_allowed_flag from 1 to 0 but we already knew that. Also, in the same sequence parameter set, he changed num_units_in_tick from 1001 in the 29.97fps file to 5005 in the 23.976fps file. He changed the time_scale from 60000 in the 29.97fps file to 240000 in the 23.976fps file.
In each of the P slices he ADDED some three new elements in the 23.976 compared to the 29.97. Here are the elements:
Now, the hard to figure out parts in all this are the "cpb_removal_delay" and "dpb_output_delay" flags in each H264 SEI structure. I can't figure out the pattern after checking it out a little (will continue to check).
TO help you guys see it more clearly, I created two files using elecard stream analyzer. Those presents the entire structures of the first 5 megabytes of each of the files. I named the hd-dvd compliant file "hddvd_29_97.txt" and the bluray one "bluray_23_976.txt".
Do a compare on those two files using any standard text file compare program and you should easily see the differences between the two files.
I hope somebody can figure something out so that we can apply the same thing to any HD-DVD 29.97fps avc movie file to make them blu-ray compliant.
A program probably was used to do this reverse pulldown conversion without recompressing the file but which one? I doubt an hex edit of the entire file was done.
hddvd_29_97.txt 143.8564453125k . file
bluray_23_976.txt 141.2822265625k . file