Hi,I'm evaluation this lib and was wondering if the following is possible:
decode a stream frame by frame, where i supply the frames.I've tried to perform it in the following way:
1) create transcoder
2) create videostreaminfo
3) configure stream info, but don't attach a stream/file
4) add this config to the transcoder inputs5) create videostreaminfo
6) configure it with same framerate and dimensions, but stream type uncompressed7) open transcoder
8) push frame data
9) if push successfull, pull decodedHowever when i run this code i'm getting the following error:
Assertion failed
File: Transcoder.cpp
Line: 2110
Expression: stream
MemoryStream ms;
ms.append(sps_start, sps_end);
ms.append(pps_start, pps_end);
ms.append(iframe_start, iframe_end);
MediaInfo* info; // already created
info->setInputStream(&ms);
info->setInputType(primo::codecs::StreamType::H264); // the stream type must be specified explicitly
info->load();
// ...
// init transcoder for decoding
// push data from the memory stream (SPS+PPS+I_FRAME) to the transcoder before proceeding with regular frames.
// it's OK to push the whole appended data (ms.data) because frames do have start codes
MediaInfo* info;
info->setInputType(primo::codecs::StreamType::H264);
MediaInfo* info = getMediaInfo( keyFrame );
and then in the line
AutoRelease<MediaSocket> socket1 (Library::createMediaSocket());
AutoRelease<MediaPin> pin1 (Library::createMediaPin());
pin1->setConnection(PinConnection::Auto);
pin1->setStreamInfo(info->streams()->at(0));
socket1->setStreamType(info->inputType());
2. Or make sure that you reset the input stream in MediaInfo before calling MediaSocket::createFromMediaInfo():
info->setInputStream(NULL);
3. Or you can fully implement the primo::Reference interface used by the MemoryInputStream but I don't recommend this because it's more complex and you don't need it. And you will still have to remove the stream form the input socket (socket->setStream(NULL)) in order to use Transcoder::push().
--
You received this message because you are subscribed to the Google Groups "AVBlocks Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avblocks-suppo...@googlegroups.com.
To post to this group, send email to avblocks...@googlegroups.com.
Visit this group at http://groups.google.com/group/avblocks-support.
For more options, visit https://groups.google.com/groups/opt_out.