Log in

View Full Version : Reencoding only a part of x264/AVC stream


DivxBr
21st February 2010, 15:24
Hi,

I was thinking, about how to make a kind of "smart rendering" (like virtualdub does for avi) for h264 streams.

So I made a few tests, reencoding part of the content of a mkv file, cutting out old part and re-appending (to original frame sequence - of course, cutting - with mkvmerge - on IDR boundaries).

The problem I found, is that the mkvmerge, when I try to re-append stream parts, shows an error message saying that the private codec's data does not match.

So I used MediaInfo tool to extract encoding parameters from original file, to use them in encoding process:

- Mkv merge still shows different private codec's data;
- The file plays ok with ffdshow, but freezes on re-encoded part (few frames) in MPC-HC (dxva mode);

So my question is: Which part of the info in the original file I have to use (and how to extract it) to reencode for generating a compatible stream so I can append the original & reencoded parts without glitches?

:thanks:

Edit: And by the way, I'm using x264 for encoding.

a4840639
21st February 2010, 16:20
Private codec data is of course different, firstly the version of x264 is mostly not the same, but it does not really matter.

I found 2 possibilities for your situation, there should be more possibilities that I do not know
1:You have changed the resolution during re-encode
2:You are using a not DXVA-compatible setting for re-encode(e.g. too many refs)

DivxBr
21st February 2010, 16:37
Well, I really don't know if I can trust in MediaInfo's Info, because I tried to reencode using the same number of references, same level, and so on.

Maybe there's another tool other than MediaInfo to get the stream data that MUST be followed to do the reencode.