Re: [FFmpeg-user] Using FFMPEG to Record a MPTS

2018-03-04 Thread Carl Eugen Hoyos
2018-03-02 16:14 GMT+01:00, David Stephens
:

> 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
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Using FFMPEG to Record a MPTS

2018-03-02 Thread 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
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Using FFMPEG to Record a MPTS

2018-03-02 Thread 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*
First try:


Command line:

sudo ffmpeg -y -i udp://232.1.1.1:5003?multicast=1 -map 0:v -map 0:a -streamid 
0:0x64 -streamid 1:0x65 -streamid 2:0x66 -streamid 3:0x67 -streamid 4:0x68 
-streamid 5:0x69 -streamid 6:0x6A -streamid 7:0x6B -streamid 8:0xC8 -streamid 
9:0xC9 -streamid 10:0xCA -streamid 11:0xCB -streamid 12:0xCC -streamid 13:0xCD 
-streamid 14:0xCE -streamid 15:0xCF -streamid 16:0x12C -streamid 17:0x12D 
-streamid 18:0x12E -streamid 19:0x12F -streamid 20:0x130 -streamid 21:0x131 
-streamid 22:0x132 -streamid 23:0x133 -streamid 24:0x134 -streamid 25:0x190 
-streamid 26:0x191 -streamid 27:0x192 -streamid 28:0x193 -streamid 29:0x194 
-streamid 30:0x195 -streamid 31:0x196 -streamid 32:0x197 -streamid 33:0x198 -c 
copy /home/slicer/testrec.ts

Console output:

Input #0, mpegts, from 'udp://232.1.1.1:5003?multicast=1':
  Duration: N/A, start: 95349.723878, bitrate: N/A
  Program 1 
Metadata:
  service_name: InCar Cam 1
  service_provider: IMSP
Stream #0:18[0x64]: Video: h264 (Main) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 
tbr, 90k tbn, 59.94 tbc
Stream #0:19[0x65](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
stereo, s16p, 64 kb/s
Stream #0:23[0x66](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:24[0x67](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:21[0x68](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:20[0x69](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:25[0x6a](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:22[0x6b](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
  Program 2 
Metadata:
  service_name: InCar Cam 2
  service_provider: IMSP
Stream #0:10[0xc8]: Video: h264 (Main) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 
tbr, 90k tbn, 59.94 tbc
Stream #0:11[0xc9](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
stereo, s16p, 64 kb/s
Stream #0:12[0xca](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:13[0xcb](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:14[0xcc](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:15[0xcd](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:16[0xce](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:17[0xcf](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
  Program 3 
Metadata:
  service_name: Video
  service_provider: IMSP
Stream #0:0[0x12c]: Video: h264 (Main) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 
tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x12d](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:2[0x12e](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:3[0x12f](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:4[0x130](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream #0:5[0x131](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
mono, s16p, 64 kb/s
Stream