[Live-devel] %5BLive-devel%5D%20Problem%20trying%20to%20use%20libavcodec%20and%20live555

Shaswata Jash shaswata at alumnux.com
Thu Oct 26 22:08:07 PDT 2006


As said by Ross, LIVE doesn't encode or decode. 
Now first of all take a look at the following code -

FramedSource* MPEG1or2VideoFileServerMediaSubsession
::createNewStreamSource(unsigned /*clientSessionId*/, unsigned& estBitrate) {
  estBitrate = 500; // kbps, estimate

  ByteStreamFileSource* fileSource
    = ByteStreamFileSource::createNew(envir(), fFileName);
  if (fileSource == NULL) return NULL;
  fFileSize = fileSource->fileSize();

  return MPEG1or2VideoStreamFramer
    ::createNew(envir(), fileSource, fIFramesOnly, fVSHPeriod);
}

If you notice that it is using ByteStreamFileSource which reads bytes from a file and then MPEG1or2VideoStreamFramer uses those data from ByteStreamFileSource to create a MPEG1or2 video frame. 

So without changing any other code, you can make a tweak-
i) Create a class similar to ByteStreamFileSource 
ii) Your created class (derived from FramedFileSource) will directly return the encoded frame (using ffmpeg that you have already done)
iii) For that you have to implement that doGetNextFrame() 

In this scheme, only drawback is that MPEG1or2VideoStreamFramer parses an already framed media data. But advantage of this scheme is that you need not change in other live classes where code may be quite involved.

With regards,
Shaswata

  ----- Original Message ----- 
  From: José Manuel Sánchez 
  To: live-devel at ns.live555.com 
  Sent: Friday, October 27, 2006 1:04 AM
  Subject: [Live-devel]%5BLive-devel%5D%20Problem%20trying%20to%20use%20libavcodec%20and%20live555


  Thanks for the quick response. I'll try to clarify what I'm trying to do.

  This is what I intend to do:

  file -> ffmpeg -> modify frame -> ffmpeg -> liveMedia -> network -> vlc

  I want to load a movie, modify the raw frames, encode it again and send it to another computer which has a VLC client. 
  I have been successful with the last part (with the example testMPEG1or2VideoStreamer), and with the first one (I can read the file with libavcoded and then see the decoded frames). 
  The next thing I have tried is this: 

  file -> ffmpeg -> liveMedia -> network -> vlc

  This is where it fails. I decode the movie with av_read_frame, and then I connect the output with a MPEG1or2StreamFramer, which is connected with a MPEG1or2RTPSink. 
  This is more or less the code of the test.

  Should I decode the frame and put it to MPEG1or2StreamFramer or is the AVPacket what it's expecting?
  The main problem is that I don't know what each module is expecting. Does the liveMedia send decoded frames? does it encode them? 


  Thanks,

  Antonio Garcia



------------------------------------------------------------------------------


  _______________________________________________
  live-devel mailing list
  live-devel at lists.live555.com
  http://lists.live555.com/mailman/listinfo/live-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20061026/a96572a6/attachment.html 


More information about the live-devel mailing list