[FFmpeg-user] Dissecting a transport stream (.ts) temporally

Ted Park kumowoon1025 at gmail.com
Sun Mar 1 17:03:27 EET 2020


Hi,

> I hope this example makes it more clear:
> 
> The TV channel broadcasted news at 20:00 and started with a movie at ~20:15. The recorded .ts file starts at ~20:05 so the beginning isn't missed.
> During the news, audio channel #0:3 is stereo, when the movie starts it switches to 5.1.
> 
> 
> When I play the file in mpv with the corresponding channel selected and skip to just before the movie starts, audio is silent for a split second and mpv prints "Invalid audio PTS: 514.912589 -> 515.065922" to the terminal. Therefore, I assume that the 5.1 audio starts at ~515 (seconds) and it would be cool to be able to get this timestamp with ffmpeg so I wouldn't have to manually seek the recorded video with a player beforehand.

Ah, okay I think I understand now. It’d depend on what recorded the stream, but I think that delay might have been the decoder “noticing” that the audio could be decoded to 5.1 and the resulting delay while it changed its configuration. It might not have been signaled in the original bitstream, and decoders use it differently.
At the very least you would need to decode the audio to find where it changes, the ashowinfo filter might detect and print the channel layout.

Regards,
Ted Park



More information about the ffmpeg-user mailing list