robertosfield wrote:
> Hi Eveengy? Pereguda?  Could you sign so we know how to address you thanks.
> 
> As for the problems you have, I'm not an ffmpeg expert so will only be
> able to provide general suggestions.  I have just tried running two
> videos in parallel with osgmovie -e ffmpeg movieone.ogg movetwo.avi
> and it runs both together fine.  I'm using OSG svn/trunk.  What
> version of the OSG and ffmpeg are you using?
> 
> Robert.
> 
> 


Hi Robert. I use Stable Release OpenSceneGraph-3.0.1 and ffmpeg-52. I read code 
of osgmovie and used some fragments of it. However, the fact is that after 
finishing of the video file the code can be looped or has state END_OF_STREAM

Code:
if (loop())
{
m_clocks.reset(m_start);
rewindButDontFlushQueues();
}
else
m_state = END_OF_STREAM;



in the last case in the bool FFmpegDecoder::readNextPacket() you can see 

Code:
case END_OF_STREAM:
return readNextPacketEndOfStream();




Method readNextPacketEndOfStream() has next listing


Code:

bool FFmpegDecoder::readNextPacketEndOfStream()
{
const FFmpegPacket packet(FFmpegPacket::PACKET_END_OF_STREAM);

m_audio_queue.timedPush(packet, 10);
m_video_queue.timedPush(packet, 10);

return false;
}




In the class FFmpegDecoderAudio, in method size_t 
FFmpegDecoderAudio::decodeFrame(void * const buffer, const size_t size) has the 
next fragment:

Code:
else if (m_packet.type == FFmpegPacket::PACKET_END_OF_STREAM)
{
m_end_of_stream = true;
}
else if (m_packet.type == FFmpegPacket::PACKET_FLUSH)
{
avcodec_flush_buffers(m_context);
}
// just output silence when we reached the end of stream
if (m_end_of_stream)
{
memset(buffer, 0, size);
return size;
}



It means that when the end if file is reached the bool variable m_end_of_stream 
is set into true and decoder create just output silence when we reached the end 
of stream. However, when I call rewind() and play() this variable keeps the 
value true, and is never changed into false. 
Does it mean that code:

Code:
if (m_end_of_stream)
{
memset(buffer, 0, size);
return size;
}


will be called every time after finishing file and rewinding?

And, of course, there is not any possibilities to find the fact of reaching of 
the end if video in file. there is not any callback functions or state 
variable, which can be bind with state "finish of playing file and rewinding in 
the beginning".

May be I have some mistakes, but I do not know where they are?[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53354#53354





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to