wangf1978 / DumpTS

Extract elementary stream from all kinds of media files, show inside media meta information and reconstruct Transport-Stream, ISOBMFF, Matroska and MMT media files
MIT License
59 stars 15 forks source link

Adding some fixes to MMT code #2

Closed trollcop closed 5 years ago

trollcop commented 5 years ago

Heya,

I'm using this to go through some TLV/MMT files and I noticed a bug in the code which skips MPT_descriptors, you do bs.Read(&std::vector) but it's size remains at zero, causing a crash. I guess your sample MMT files didn't have such descriptors, so you didn't notice.

That's commit #1, and second one adds support for --pid to go up to 0xffff (mmt can have PIDs above 1fff since the field is 16bit there). I haven't tested it but it should work.

Anyway, there's some issues still as the

DumpTS.exe input.tlv --srcfmt=mmt --output=output.hevc --outputfmt=es --pid=0xa041

Exits after unsynching with 7F header after few 100kbytes, but that's to be determined with further debugging (my source file should be clean).

wangf1978 commented 5 years ago

Thanks.

0x1fff is NULL packet for TS stream, it is invalid for MMT.

trollcop commented 5 years ago

0x1fff is NULL packet for TS stream, it is invalid for MMT.

Yes, but what I mean is that MMT PIDs are 16bit, where TS PIDs are 12bit. So pid such as 0xa000 is valid for MMT, and --pid should not have been limited to 12-bit.

wangf1978 commented 5 years ago

Yes, you are right, I have merged your changes. Thanks for your contribution.