Digital video files: mid-stream changes

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 383
Joined: Tue Nov 12, 2013 2:05 am

Digital video files: mid-stream changes

Post 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.
User avatar
peter_b
Chatterbox
Posts: 383
Joined: Tue Nov 12, 2013 2:05 am

ffprobe: find mid-stream resolution changes

Post 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.
Post Reply