Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AM_INIT_AUTOMAKE([1.11 subdir-objects])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE([disable])

VERSION_INFO="5:1:0"
VERSION_INFO="5:1:1"

AC_MSG_CHECKING([if debug build is enabled])

Expand Down
2 changes: 2 additions & 0 deletions doc/ffms2-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ typedef struct {
unsigned int ContentLightLevelMax;
unsigned int ContentLightLevelAverage;
int Flip;
int64_t LastEndPTS;
} FFMS_VideoProperties;
```
A struct containing metadata about a video track.
Expand Down Expand Up @@ -1094,6 +1095,7 @@ The fields are:
- `unsigned int ContentLightLevelMax;` - Maximum content luminance (cd/m^2).
- `unsigned int ContentLightLevelAverage;` - Average content luminance (cd/m^2).
- `int Flip;` - Flip direction to be applied *before* rotation: 0 for no operation, >0 for horizontal flip, <0 for vertical flip.
- `int64_t LastEndPTS;` - The end PTS of the last packet of the stream.

### FFMS_AudioProperties

Expand Down
1 change: 1 addition & 0 deletions doc/ffms2-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- 5.1
- FFmpeg 7.1 is now the minimum requirement.
- Added layered decoding support, for e.g. spatial MV-HEVC.
- Added LastEndPTS to FFMS_VideoProperties. This field is the equivalent of LastEndTime, but it is expressed in the video timebase.

- 5.0
- Fixed all issues with FFmpeg 6.1 which is now the minimum requirement
Expand Down
4 changes: 3 additions & 1 deletion include/ffms.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define FFMS_H

// Version format: major - minor - micro - bump
#define FFMS_VERSION ((5 << 24) | (1 << 16) | (0 << 8) | 0)
#define FFMS_VERSION ((5 << 24) | (1 << 16) | (1 << 8) | 0)

#include <stdint.h>
#include <stddef.h>
Expand Down Expand Up @@ -406,6 +406,8 @@ typedef struct FFMS_VideoProperties {
unsigned int ContentLightLevelAverage;
/* Introduced in FFMS_VERSION ((2 << 24) | (31 << 16) | (0 << 8) | 0) */
int Flip; /* -1 = Vertical flip, 1 = Horizontal flip */
/* Introduced in FFMS_VERSION ((5 << 24) | (1 << 16) | (1 << 8) | 0) */
int64_t LastEndPTS;
} FFMS_VideoProperties;

typedef struct FFMS_AudioProperties {
Expand Down
9 changes: 6 additions & 3 deletions src/core/videosource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,12 @@ void FFMS_VideoSource::SetVideoProperties() {
VP.ColorRange = AVCOL_RANGE_JPEG;


VP.FirstTime = ((Frames[Frames.RealFrameNumber(0)].PTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
VP.LastTime = ((Frames[Frames.RealFrameNumber(Frames.VisibleFrameCount()-1)].PTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
VP.LastEndTime = (((Frames[Frames.RealFrameNumber(Frames.VisibleFrameCount()-1)].PTS + Frames.LastDuration) * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
auto FirstPTS = Frames[Frames.RealFrameNumber(0)].PTS;
auto LastPTS = Frames[Frames.RealFrameNumber(Frames.VisibleFrameCount()-1)].PTS;
VP.LastEndPTS = LastPTS + Frames.LastDuration;
VP.FirstTime = ((FirstPTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
VP.LastTime = ((LastPTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;
VP.LastEndTime = ((VP.LastEndPTS * Frames.TB.Num) / (double)Frames.TB.Den) / 1000;

if (CodecContext->width <= 0 || CodecContext->height <= 0)
throw FFMS_Exception(FFMS_ERROR_DECODING, FFMS_ERROR_CODEC,
Expand Down
Loading