wang-bin / QtAV

A cross-platform multimedia framework based on Qt and FFmpeg. 基于Qt和FFmpeg的跨平台高性能音视频播放框架. Recommand to use new sdk https://github.com/wang-bin/mdk-sdk
http://qtav.org
3.93k stars 1.5k forks source link

Play still recording FLV file - duration #202

Open modmanx opened 10 years ago

modmanx commented 10 years ago

When I play still recording FLV file, duration and media_end_pos is set at the file load time AVPlayer::load. When video position get's to media_end_pos set at load time, video stops. If I put media_end_pos = std::numeric_limits<qint64>::max(); then video plays as it's suppose, even after position is over duration.

Is it possible to implement a method in AVPlayer where I could manually set the duration and or media_end_pos?

I noticed that MKV file that I'm recording with same options as FLV, gets "Unknown" duration, but it's not seekable as FLV is.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1779446-play-still-recording-flv-file-duration?utm_campaign=plugin&utm_content=tracker%2F307703&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F307703&utm_medium=issues&utm_source=github).
wang-bin commented 10 years ago

Good question and interesting. I have not considered it. How do you record and play? What about other players?

modmanx commented 10 years ago

VLC - When I open the same file (while still recording) it detects the duration but it can play beyond detected duration (fe.: 01:17 / 00:50) As I mentioned, if I set media_end_pos = std::numeric_limits<qint64>::max(); in AVPlayer.cpp@607 (just to test) then your player works fine too.

I'm recording video from Blackmagic device.

wang-bin commented 10 years ago

the stream must contain information about durations. how can we detect them?