Skip to content

Commit

Permalink
MediaInfo: Export h264 ref_frames
Browse files Browse the repository at this point in the history
  • Loading branch information
xqq committed Dec 28, 2017
1 parent a8f9da1 commit 3d81d15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core/media-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/demux/flv-demuxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/demux/sps-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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),

Expand Down

0 comments on commit 3d81d15

Please sign in to comment.