[Live-devel] the time that had played is error
kingaceck
kingaceck at 163.com
Sun Jan 13 17:34:49 PST 2013
Hi
I have extended live555 media server to support mp4 file.when playing using vlc,I click the pause button and then click play button.The time that had played at vlc panel becomes 00:00.
I played the mpg file to test this issue and the time that had played at vlc panel is ok.
Why the issue only occured in playing my mp4 file(h264 aac 1080p)?Is there any steps that missed in my *ServerMediaSubsession for mp4 file or any other question:
/*
* ffmpeg_H264_server_media_subsession.cpp
*
*/
#include "BasicUsageEnvironment.hh"
#include "liveMedia.hh"
#include "../ffmpeg_demux.h"
#include "../ffmpeg_server_demux.h"
#include "../ffmpeg_demuxed_elementary_stream.h"
#include "ffmpeg_h264_server_media_subsession.h"
FfmpegH264ServerMediaSubsession *FfmpegH264ServerMediaSubsession::CreateNew(
FfmpegServerDemux& demux, u_int8_t stream_id, Boolean reuse_source)
{
return new FfmpegH264ServerMediaSubsession(demux, stream_id, reuse_source);
}
FfmpegH264ServerMediaSubsession::~FfmpegH264ServerMediaSubsession() {
// TODO Auto-generated destructor stub
//delete (FfmpegServerDemux*)(&ffmpeg_demux_);
Medium::close((FfmpegServerDemux*)(&ffmpeg_demux_));
}
FfmpegH264ServerMediaSubsession::FfmpegH264ServerMediaSubsession(
FfmpegServerDemux& demux, u_int8_t stream_id, Boolean reuse_source):
H264VideoFileServerMediaSubsession(demux.envir(), NULL, reuse_source),
ffmpeg_demux_(demux),
stream_id_(stream_id)
{
// TODO Auto-generated constructor stub
}
FramedSource *FfmpegH264ServerMediaSubsession::createNewStreamSource(
unsigned clientSessionId, unsigned& estBitrate)
{
estBitrate = 500; //kbps��estimate
FramedSource* es = ffmpeg_demux_.NewElementaryStream(clientSessionId, stream_id_);
if (es == NULL) return NULL;
//return H264VideoStreamDiscreteFramer::createNew(envir(), es);
return H264VideoStreamFramer::createNew(envir(), es);
}
void FfmpegH264ServerMediaSubsession
::seekStreamSource(FramedSource* inputSource, double& seekNPT, double /*streamDuration*/, u_int64_t& /*numBytes*/) {
H264VideoStreamFramer* framer = (H264VideoStreamFramer*)inputSource;
framer->flushInput();
// "inputSource" is a filter; its input source is the original elem stream source:
FfmpegDemuxedElementaryStream* elemStreamSource
= (FfmpegDemuxedElementaryStream*)(((FramedFilter*)inputSource)->inputSource());
// Next, get the original source demux:
FfmpegDemux& sourceDemux = elemStreamSource->sourceDemux();
// and flush its input buffers:
sourceDemux.FlushInput();
sourceDemux.seekStreamSource(seekNPT);
}
float FfmpegH264ServerMediaSubsession::duration() const {
return ffmpeg_demux_.fileDuration();
}
2013-01-14
kingaceck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130114/770e2c4c/attachment-0001.html>
More information about the live-devel
mailing list