Page 1 of 1

Digital video files: mid-stream changes

Posted: Thu Mar 23, 2017 12:23 am
by peter_b
Nowadays digital broadcasts are concatenated clips wrapped in a transport stream.
Recording that stream (e.g. as MPEG-TS / ".ts" file) can therefore contain different encodings with different technical properties inside.
So called "mid-stream changes".

Most applications however, expect one videofile to have one set of properties:
  • resolution (width * height)
  • framerate (fps)
  • audio/video codec
  • audio samplerate/channels
  • etc.
Here I'll collect some information about how to analyze - and possibly fix such files.

ffprobe: find mid-stream resolution changes

Posted: Thu Mar 23, 2017 12:27 am
by peter_b
This command will list all resolutions (width/height) found within a digital videofile:

Code: Select all

$ cat $VIDEO_IN | grep "width\|height" | sort | uniq
For example, applying this to an off-the-air recording (=one MPEG-TS file) may return:
height=594
height=720
width=1056
width=1280
This is actually a real-world example: The resolution of the TV show is different than the commercial breaks in between.