nwf1115
nwf1115

Reputation: 37

Separating MPEGTS Multi-queue, Padded Stream with 3 Videos

I have output from a Python program that comes out as a single .AVI that contains 3 video streams, however, it seems that they are all combined. The videos are not concatenated, but they are interlaced. The code that produces it is pretty abstract and the only thing I can tell is that they used Gstreamer to combine the videos. I can pick out H.264 encoding and mpegts and output as an .AVI. Using ffprobe on the file I get the following output:

Input #0, mpegts, from 'output.avi':
  Duration: 00:05:00.07, start: 12045.450000, bitrate: 33695 kb/s
  Program 1
    Stream #0:0[0xdd]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), >1920x1080 [SAR 1:1 DAR 16:9], 15 fps, 15 tbr, 90k tbn, 30 tbc

I'm needing to separate the videos contained in this .AVI file, but I'm having trouble doing so using ffmpeg since there are not separate streams for each video.

Does anyone have any tips on how to do this using ffmpeg or gstreamer?

Update: Upon further experimentation, it does not seem that the frames are interlaced, rather the stream of data was in some way, combined in some manner.

Update: Video output is an mpegts multiqueue, padded stream. Although it is one file, each video stream embedded in the file has its own port. I can open it in wireshark and view the data stream. I guess this changes my question to: Can you filter this single file containing multiple streams by port?

Upvotes: 0

Views: 199

Answers (1)

kesh
kesh

Reputation: 5543

Try this to separate interleaved frames:

ffmpeg -i INPUT -filter_complex select=n=3:e='mod(n\,3)+1'[v1][v2][v3] \
  -map [v1] OUTPUT1 -map [v2] OUTPUT2 -map [v3] OUTPUT3

If you need to specify output options, make sure to duplicate for each output file.

Upvotes: 1

Related Questions