[Live-devel] Problem to transform mp4 (AAC, H264) to Elementary h264

Miguel Orenes miguel.orenes at displaynote.com
Tue Apr 9 07:03:33 PDT 2013


Hi everyone.
I am trying to send a video file recorded on Android to a media server by using "testMPEG2TransportStreamer.cpp" later to create the TS file by using "testH264VideoToTransportStream.cpp" to an own media server. I copied the video to my PC in order to avoid problems with live555 on Android, step by step :).

I know that "testH264VideoToTransportStream + testMPEG2TransportStreamer " works fine because I downloaded "slamtv60.264" from live555.com and sent out.ts, resulted from  "testH264VideoToTransportStream",  by "testMPEG2TransportStreamer"  to my media server and could play the live stream in VLC (on windows) and Android *without* problems in the same time(as a media server must do).
Then, my problem is that I am not able to transform my Android video to an *elementary h264* file.  In this moment my code is the next:

void createH264ElementaryFile()
{
  // Begin by setting up our usage environment:
  TaskScheduler* scheduler = BasicTaskScheduler::createNew();
  env = BasicUsageEnvironment::createNew(*scheduler);

  // Open the input file as a 'byte-stream file source':
  FramedSource* inputSource = ByteStreamFileSource::createNew(*env, inputFileName);
  if (inputSource == NULL) {
    *env << "Unable to open file \"" << inputFileName
       << "\" as a byte-stream file source\n";
    exit(1);
  }


  // Open the output file as a 'file sink':
  H264VideoFileSink* outputSink = H264VideoFileSink::createNew(*env, h264FileSink);
  if (outputSink == NULL) {
    *env << "Unable to open file \"" << h264FileSink << "\" as a file sink\n";
    exit(1);
  }

  // Finally, start playing:
  *env << "Beginning to read...\n";
  outputSink->startPlaying(*inputSource, afterPlayingcreateH264ElementaryFile, NULL);

  env->taskScheduler().doEventLoop(); // does not return
}

I read that I need to insert  before each NAL unit an start code (0x00000001), then I think I need to develop a "H264FramedSource" in order to insert the code, but I am not able to find an example or a tip to implement a solution.

Any suggestions?
Many thanks!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130409/eeff58dc/attachment.html>


More information about the live-devel mailing list