5 Replies Latest reply on Jan 24, 2013 6:19 AM by slimmdw

    Custom importer and GetTimeInfo8

    slimmdw

      I'm working with h264 video muxed into an mpeg2 transport stream. I also have audio in an mpeg2ts that I am trying to sync up with it. When importing the videos directly into premiere pro CS6, they are both given a start time of 00:00:00:00 even though they should be different in order to sync.

       

      So our solution, to avoid any sort of reencoding, was to append our own PES packet to the stream that would contain the time information we needed and then write a custom importer to look for and read this packet. This importer would defer to the built in MPEG importer (thus return imBadFile for imGetInfo8 and imOpenFile8 selector) and would listen for othe imGetTimeInfo8 selector at which point it would fill in the time information.

       

      The problem I have is that the imGetTimeInfo8 selector is never sent! I tried this husing both the SDK_File_Importer and SDK_Custom_Importer samples as a base, on multiple test files. The videos still seem to load into Premiere just fine (still with the 00:00:00:00 time code though) so it's clearly going through the MPEG importer after I defer to it. I'm debugging in VS so I can see that I get the following selectors:

       

       

      38 imGetPrefs8

      38 imGetPrefs8

      57 imQueryContentState

      37 imGetInfo8

      60 imQueryStreamLabel

      (this repeats a total of 3 times)

       

       

      I'm assuming that there's some series of flags/fields that I need to have filled out a certain way in order for imGetTimeInfo8 to be sent, but I can't figure them out and the documentation doesn't tell me enough (at least not as far as I can tell). Or maybe I'm failing to  I have left all the methods from the samples 'as is', except for returning the imBaseFile where required, and changing support from the .sdk(c) to the m2ts formats.

       

      So in short, my question is: What needs to happen in order to ensure that GetTimeInfo8 gets called, namely when passing the majority of the import to an existing plugin?

       

      Thanks

        • 1. Re: Custom importer and GetTimeInfo8
          Rallymax-forum Level 3

          If you reply imBadFile you are giving up all future queries since it'll be handled by another Importer that accepts the format discovered.

          If I'm understanding you correctly that them implies that unless you decode the video you can't additionally provide this custom timestamp info.

          • 2. Re: Custom importer and GetTimeInfo8
            slimmdw Level 1

            Rallymax-forum wrote:

             

            If you reply imBadFile you are giving up all future queries since it'll be handled by another Importer that accepts the format discovered.

             

            That's what I was afraid of, the documentation just didnt' seem to make that very evident. Is there a way to just ceed control for that single selector call and still request that all other's go through you? Or would there be a way to "load" the MPEG plugin and call it directly? It's rather impractical for me to, essentially, rerwite an entire importer just to override a single method.

            • 3. Re: Custom importer and GetTimeInfo8
              Rallymax-forum Level 3

              short answer no.

              long answer... kinda.

              If you work out what the registered mpeg decoder dll is you could load it yourself and shim from your imImporter() to theirs for all operations other than timestamp. That's assuming that you can mix the decode of the TS frames for you to pull out the custom PES markers you put into the stream.

              I'd say your best bet would be to license a h.264 decoder (it's patent protected in (at minimum) the USA so open source can't be used) to marry into your importer.

              1 person found this helpful
              • 4. Re: Custom importer and GetTimeInfo8
                Rallymax-forum Level 3

                another thought...

                You could just make your own re-muxer that opens both the mpegts[video] and mpegts[audio] streams.

                You wouldn't re-encode, just re-mux with the appropriate padding to get the two streams in sync.

                This re-muxed stream would then inport into Premiere using the shipped decoders.

                • 5. Re: Custom importer and GetTimeInfo8
                  slimmdw Level 1

                  Sounds like I can't do quite what I want then without significantly more effort than I hoped. Oh well .

                   

                  Thanks you very much for your help Rallymax.