You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dea20c0
Browse filesBrowse the repository at this point in the historyBrowse files
MediaReaderOptions sets the timeout, the analysis duration and the probe
size of a reader, so that a camera whose keyframes come further apart than
FFmpeg's 5 seconds reports its video size when it opens. Opening gets the
analysis duration on top of the timeout. MediaFileSource takes a reader
opened that way.
Refs #598
Copy file name to clipboardExpand all lines: docs/guide/media/media-files.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -347,11 +347,31 @@ If the server cannot be reached, the constructor throws an `IOException` once th
347
347
A live stream has no end and no length:
348
348
349
349
- Its `MediaInfo` reports a duration of 0.
350
-
- Its `MediaInfo` can report a video size of 0x0. Many cameras say how large their pictures are only with each keyframe, which may come too late for the reader. The video plays all the same, and its frames have their size.
351
350
- Looping does not apply, and seeking is reported as an error.
352
351
- Pausing stops reading from the server, but the server keeps sending. Resuming carries on from where playback paused, which leaves it behind real time by as long as it was paused.
353
352
- To get back to live, close the source and open it again.
354
353
354
+
### Video Size of a Camera
355
+
356
+
Many cameras say how large their pictures are only with each keyframe. FFmpeg reads 5 seconds of a source when it opens it. If the first keyframe comes later, `MediaInfo` reports a video size of 0x0. The video plays all the same, and its frames have their size.
357
+
358
+
To know the size when the source opens, let FFmpeg read for longer than the camera's keyframe interval:
The source takes over the reader and closes it. Opening takes up to the analysis duration on top of the timeout, as the camera sends in real time. FFmpeg also stops after 5 MB. For a stream of a high bit rate, raise that limit with `probeSize(bytes)` as well.
374
+
355
375
## Closing
356
376
357
377
Closing a `MediaFileSource` stops playback, and releases the player along with both media sources. Before that, release the senders a peer connection handed out, and the tracks:
0 commit comments