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
16 changes: 14 additions & 2 deletions src/ffmpeg.imageio/ffmpeginput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ extern "C" { // ffmpeg is a C api
#endif

#include <libavutil/imgutils.h>
#include <libavutil/pixdesc.h>
}


Expand Down Expand Up @@ -528,8 +529,19 @@ FFmpegInput::open(const std::string& name, ImageSpec& spec)
m_spec.attribute("FramesPerSecond", TypeRational, &rat);
m_spec.attribute("oiio:Movie", true);
m_spec.attribute("oiio:subimages", int(m_frames));
m_spec.attribute("oiio:BitsPerSample",
m_codec_context->bits_per_raw_sample);
if (m_codec_context->bits_per_raw_sample) {
m_spec.attribute("oiio:BitsPerSample",
m_codec_context->bits_per_raw_sample);
} else {
// If bits_per_raw_sample is not provided, the bit depth of the
// luma channel is the closest equivalent to a single bit depth.
const AVPixFmtDescriptor* pix_format_desc = av_pix_fmt_desc_get(
src_pix_format);
if (pix_format_desc && pix_format_desc->nb_components > 0) {
m_spec.attribute("oiio:BitsPerSample",
pix_format_desc->comp[0].depth);
}
}
m_spec.attribute("ffmpeg:codec_name", m_codec_context->codec->long_name);
/* The ffmpeg enums are documented to match CICP values, except the color range. */
const int cicp[4]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 1: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -22,7 +22,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 2: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -34,7 +34,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 3: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -46,7 +46,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 4: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -58,7 +58,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 5: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -70,7 +70,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 6: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -82,6 +82,6 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
14 changes: 7 additions & 7 deletions testsuite/ffmpeg/ref/out-ffmpeg8.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 1: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -22,7 +22,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 2: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -34,7 +34,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 3: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -46,7 +46,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 4: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -58,7 +58,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 5: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -70,7 +70,7 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
subimage 6: 192 x 108, 3 channel, uint8 FFmpeg movie
Expand All @@ -82,6 +82,6 @@ ref/vp9_display_p3.mkv : 192 x 108, 3 channel, uint8 FFmpeg movie
FramesPerSecond: 24/1 (24)
SCENE: "Scene"
ffmpeg:codec_name: "Google VP9"
oiio:BitsPerSample: 0
oiio:BitsPerSample: 8
oiio:Movie: 1
oiio:subimages: 7
Loading