From 3d81d155b352706f47712ff22f3418d91e372da7 Mon Sep 17 00:00:00 2001 From: xqq Date: Thu, 28 Dec 2017 15:38:45 +0900 Subject: [PATCH] MediaInfo: Export h264 ref_frames --- src/core/media-info.js | 2 ++ src/demux/flv-demuxer.js | 1 + src/demux/sps-parser.js | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/media-info.js b/src/core/media-info.js index 4631b706..70b8f618 100644 --- a/src/core/media-info.js +++ b/src/core/media-info.js @@ -37,6 +37,7 @@ class MediaInfo { this.fps = null; this.profile = null; this.level = null; + this.refFrames = null; this.chromaFormat = null; this.sarNum = null; this.sarDen = null; @@ -63,6 +64,7 @@ class MediaInfo { this.fps != null && this.profile != null && this.level != null && + this.refFrames != null && this.chromaFormat != null && this.sarNum != null && this.sarDen != null); diff --git a/src/demux/flv-demuxer.js b/src/demux/flv-demuxer.js index 3acc66e4..e4d36419 100644 --- a/src/demux/flv-demuxer.js +++ b/src/demux/flv-demuxer.js @@ -951,6 +951,7 @@ class FLVDemuxer { mi.fps = meta.frameRate.fps; mi.profile = meta.profile; mi.level = meta.level; + mi.refFrames = config.ref_frames; mi.chromaFormat = config.chroma_format_string; mi.sarNum = meta.sarRatio.width; mi.sarDen = meta.sarRatio.height; diff --git a/src/demux/sps-parser.js b/src/demux/sps-parser.js index 52801d63..c5e5b878 100644 --- a/src/demux/sps-parser.js +++ b/src/demux/sps-parser.js @@ -99,7 +99,7 @@ class SPSParser { gb.readSEG(); // offset_for_ref_frame } } - gb.readUEG(); // max_num_ref_frames + let ref_frames = gb.readUEG(); // max_num_ref_frames gb.readBits(1); // gaps_in_frame_num_value_allowed_flag let pic_width_in_mbs_minus1 = gb.readUEG(); @@ -198,6 +198,7 @@ class SPSParser { profile_string: profile_string, // baseline, high, high10, ... level_string: level_string, // 3, 3.1, 4, 4.1, 5, 5.1, ... bit_depth: bit_depth, // 8bit, 10bit, ... + ref_frames: ref_frames, chroma_format: chroma_format, // 4:2:0, 4:2:2, ... chroma_format_string: SPSParser.getChromaFormatString(chroma_format),