[Live-devel] Problem with Amino set-top box.

Wei Weng wweng at kencast.com
Fri Dec 29 15:01:12 PST 2006


On Wed, 2006-12-27 at 11:37 -0800, Ross Finlayson wrote:
> >  > However, I instead suggest that you use the
> >>  "testMPEG1or2ProgramToTransportStream" application (distributed in
> >>  the "testProgs" directory) to convert your Program Stream file to a
> >>  Transport Stream file.  You can then stream this (using our RTSP
> >>  server applications) to an Amino STB.
> >
> >Thanks for the help so far.
> >
> >I have been looking into the source for all those test applications
> >lately. Is there any way to transcode the program stream on the fly?
> 
> Yes.  If you look at the code for the 
> "testMPEG1or2ProgramToTransportStream" demo application, you'll see 
> that reads from a "ByteStreamFileSource", and writes to a "FileSink". 
> You can replace the "ByteStreamFileSource" with a source object for 
> your Program Stream (or, if your Program Stream source is accessible 
> as a file, then you can simply continue using a 
> "ByteStreamFileSource", but with a different input file name).
> 
> Then, replace the "FileSink" with a "MPEG2TransportStreamFramer", 
> chained to a "SimpleRTPSink", as illustrated by the code for 
> "testMPEG2TransportStreamer" (multicast streaming) or 
> "MPEG2TransportFileServerMediaSubsession" (unicast streaming).

I started off with a rather simple program:


  // Open the input file as a 'byte-stream file source':
  ByteStreamFileSource* fileSource
    = ByteStreamFileSource::createNew(*env, inputFileName, inputDataChunkSize);
  if (fileSource == NULL) {
    *env << "Unable to open file \"" << inputFileName
	 << "\" as a byte-stream file source\n";
    exit(1);
  }
  
  // Create a 'framer' for the input source (to give us proper inter-packet gaps):
  videoSource = MPEG2TransportStreamFramer::createNew(*env, fileSource);

  // Create an appropriate 'RTP sink' from the RTP 'groupsock':
  videoSink =
    SimpleRTPSink::createNew(*env, &rtpGroupsock, 33, 90000, "video", "mp2t",
			     1, True, False /*no 'M' bit*/);

  // Basically copied and pasted from source file: testMPEG2TransportStream.cpp
  // about the videoSink and videoSource. Skip the details to make concise point.

  // Finally, start playing:
  *env << "Beginning to read from file...\n";
  videoSink->startPlaying(*videoSource, afterPlaying, videoSink);

The inputFilename is a MPEG2 Program Stream file.

But I kept getting the error message:

RTCPInstance[0x949e7a0]::RTCPInstance()
schedule(1.798675->1167432428.065084)
Beginning to read...
Missing sync byte!
Missing sync byte!

The "Missing sync byte!" would repeat itself for quite a few times,
then exit.

(I have DEBUG flag turned on, so I can see those error messages pumping
out on the console)

I was expecting the program stream file transcoded to transport stream,
and then output gracefully.

What did I miss?

Thanks and I greatly appreciate your help!


Wei




More information about the live-devel mailing list