Python Script to Get Number of Slices and Heights in Video Stream within mp4-file
The python script GetAVCSliceInfo.py (python 2x) is tailored to determine how many slices are present in the video stream and what are the heights of each slice. The script processes the first video sample in the input mp4-file and prints number of slices and the height in MBs of each slice ( if the number […]
Python Script to Check PCR Integrity
The python script PcrAnalysis.py is tailored to check PCR integrity (or timing integrity) of MPEG TS stream. This script analyzes: whether PCR interval is smaller or equal to 100ms (as required by MPEG System standard). If not a violation is reported. whether PCR values are monotonic unless the discontinuity flag is set. If not a […]
How Extract Video Elementary Stream from MPEG DASH segment
Shortly on MPEG-DASH DASH is a complex hierarchical schema: MPD-file (the manifest file) is divided into periods, each period is divided into adaptation sets, adaptation set is divided in representations and each representation is divided into segments: How Generate MPEG-DASH with shaka-packager A single DASH segment is commonly not decodable since […]
Detection of Shot Boundaries and Gradual Transitions
Introduction This paper was inspired by the book “CONTENT-BASED ANALYSIS OF DIGITAL VIDEO” by Alan Hanjalic, 2004. Reliable detection of scene cuts and gradual transitions (fades, wipes, dissolves) can improve coding efficiency (e.g. in case of a scene cut the next frame is set to I-frame). In addition, video index or scene index can be […]
Flat/Texture Block Classification
The method of detection flat/texture/detail areas in frequency domain is well-known and described in various variations in literature (therefore i omit referencing to specific articles). I provide rather schematical description of the method. Knowing of the type of a block (flat or detailed) enables to adjust quantization step-sizes (it is well known that the human […]
Discontinuity Indicators
The main purpose of discontinuity_indicator flag (which is signaled at ts-packet header) is to make excerpt/segment easliy concatenated or inserted into MPEG-2 Systems stream (TS stream). Notice that TS stream is commonly comprised from a number of elementary media streams (video and audio). If you wish to concatenate your TS stream to another one you […]
How Count AVC/H.264 Video Frames in MPEG-2 Systems (Transport Stream) file?
Transport stream is commonly comprised by several elementary (“atomic”) streams (e.g. video and audio) and each elementary stream is specified by unique number PID which is present at the header of each transport packet. To find the PID of video stream i suggest exploiting tsinfo utility from open-source tstools library. The official site of tstools […]
Why Scalability Not Widely Used?
Both AVC/H.264 and HEVC/H.265 supports quality (SNR) and spatial scalability. The Quality (SNR) layering means that an encoder employs coarse quantization (high QPs) for the base layer, and successively finer quantization (smaller QPs) for the enhancement layers and as a result the quality is successively improved . from lower layers to higher ones. The Quality […]
Edge Activity or Percentage of Edge Pixels
Spatial activity or Edge activity of frame or video sequence is important parameter for encoder’s settings (e.g. for determination of frame quantization level). On the one hand high edge acitivity in a scene means that this scene is difficult for encoding (required more bits for edge retention), on the other hand dense edge patterns masks […]
Flatening region of Quality-Bitrate Curve
Schematically Quality-Rate curve can be illustrated in the following graph: It’s obvious that Quality-Rate curve depends on video content (e.g. significant motion), video resolution and your encoder’s settings. However, it’s important to detect whether your encoder with a predefined bit-rate places your video in the Flat Region or not. You need find a Bitrate threshold, […]