Using FFMPEG to Record a MPTS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using FFMPEG to Record a MPTS

David Stephens
Greetings!

I am attempting to use FFMPEG to record a multi-program transport stream
(MPTS) which arrives as UDP. There are four Programs in the MPTS. Each
program consists of a video (h264) and seven or eight audios (mp2). And
each Program has a defined set of PIDs assigned to that Program. So, for
example, Program 1 has PID 100 (0x64) for video and PIDs 101-107
(0x65-0x6B) for audio. Among the four Programs there are 34 streams (0-33).

I need to record this MPTS as a .TS file while maintaining the original PID
numbers. I am attempting to force the PID numbering using 34 "-streamid"
parameters. For example:

-streamid 0:0x64 -streamid 1:0x65 -streamid 2:0x66

The command line runs but the resulting file renumbers the PIDs
incorrectly. And this renumbering is different for each run. It is
different each time, it appears, because FFMPEG associates the stream
numbers and PID numbers differently for each run. The input UDP stream ran
continuously during these two tests; it was not stopped or paused.

I have attached a text file showing the command line and the console output
for two runs. Notice in the first attempt that Program 1 is associated with
streams 18-19-23-24-21-20-25-22. And in the second try Program 1 is
associated with streams 33-19-29-30-27-26-31-28.

This variability would seem to make consistent PID numbering impossible
using "streamid".

Is there another way?

--

*David Stephens*

*AOL/Verizon Digital Media*

*Dulles, VA571-376-2634*

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

FFMPEG Examples and Test Results 20180302.txt (25K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using FFMPEG to Record a MPTS

Marton Balint


On Fri, 2 Mar 2018, David Stephens wrote:

> Greetings!
>
> I am attempting to use FFMPEG to record a multi-program transport stream
> (MPTS) which arrives as UDP. There are four Programs in the MPTS. Each
> program consists of a video (h264) and seven or eight audios (mp2). And
> each Program has a defined set of PIDs assigned to that Program. So, for
> example, Program 1 has PID 100 (0x64) for video and PIDs 101-107
> (0x65-0x6B) for audio. Among the four Programs there are 34 streams (0-33).
>
> I need to record this MPTS as a .TS file while maintaining the original PID
> numbers. I am attempting to force the PID numbering using 34 "-streamid"
> parameters. For example:
>
> -streamid 0:0x64 -streamid 1:0x65 -streamid 2:0x66
>
> The command line runs but the resulting file renumbers the PIDs
> incorrectly. And this renumbering is different for each run. It is
> different each time, it appears, because FFMPEG associates the stream
> numbers and PID numbers differently for each run. The input UDP stream ran
> continuously during these two tests; it was not stopped or paused.
>
> I have attached a text file showing the command line and the console output
> for two runs. Notice in the first attempt that Program 1 is associated with
> streams 18-19-23-24-21-20-25-22. And in the second try Program 1 is
> associated with streams 33-19-29-30-27-26-31-28.
>
> This variability would seem to make consistent PID numbering impossible
> using "streamid".
>
> Is there another way?

You can always map explicitly every input stream (e.g. -map 0:i:101,
etc.), this way the order of the output streams should be the same.

Regards,
Marton
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Using FFMPEG to Record a MPTS

Carl Eugen Hoyos-2
In reply to this post by David Stephens
2018-03-02 16:14 GMT+01:00, David Stephens
<[hidden email]>:

> I need to record this MPTS as a .TS file while maintaining
> the original PID numbers.

The ffmpeg command line tool is a transcoding utility that also
allows to remux streams, it was not made for what you need.
(It - very well - "records" things like rawvideo input from
devices and audio from different inputs, it is not a transport
stream editor though.)
You need a specific tool to handle transport streams: The
tool is a magnitude smaller (and simpler) than FFmpeg but
at the same time, it will suit you needs much better.
There used to by ProjectX, there were other tools iirc.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".