[FFmpeg-trac] #5239(avformat:new): support options for MPEGTS muxer when using RTP_MPEGTS
FFmpeg
trac at avcodec.org
Sat Nov 18 12:40:54 EET 2017
#5239: support options for MPEGTS muxer when using RTP_MPEGTS
-------------------------------------+------------------------------------
Reporter: mattdicken | Owner:
Type: enhancement | Status: new
Priority: normal | Component: avformat
Version: git-master | Resolution:
Keywords: rtp_mpegts | Blocked By:
Blocking: | Reproduced by developer: 1
Analyzed by developer: 1 |
-------------------------------------+------------------------------------
Comment (by lhh92):
I have tried what as suggested by thovo. I recompiled passing a hardcoded
muxrate through to the mpegts part of the chain. Solely doing this does
not fix the issue. Instead you get an ever increasing bitrate reported. I
looked into the issue and it appears to be with the get_pcr command in the
mpegtsenc.c file. This value returned increments much slower than when
running the same file with the normal mpegts format. Looking at the s->pb
it seemed that the data was being written to it in much smaller chunks. I
have tried setting the mpegts context pb to that of the rtp_mpegts context
and this does remove the issue of every increasing stream bitrate;
however, when you analyse the PCR in the output stream it is not correct
(it varies)
Suggestions on what where to look next?
{{{
AVDictionary *d = NULL; // "create" an empty dictionary
AVDictionaryEntry *t = NULL;
av_dict_set(&d, "mux_rate", "12000000", 0);
av_dict_set(&d, "muxrate", "12000000", 0);
for (i = 0; i < s->nb_streams; i++) {
AVStream* st = avformat_new_stream(mpegts_ctx, NULL);
if (!st)
goto fail;
st->time_base = s->streams[i]->time_base;
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
avcodec_parameters_copy(st->codecpar, s->streams[i]->codecpar);
}
if ((ret = avio_open_dyn_buf(&mpegts_ctx->pb)) < 0)
goto fail;
if ((ret = avformat_write_header(mpegts_ctx, &d)) < 0)
goto fail;
for (i = 0; i < s->nb_streams; i++) {
s->streams[i]->time_base = mpegts_ctx->streams[i]->time_base;
}}}
{{{
ffmpeg version N-88512-g5ab41a25ba Copyright (c) 2000-2017 the FFmpeg
developers
built with gcc 6.4.0 (GCC)
configuration: --arch=x86 --target-os=mingw32 --cross-
prefix=i686-w64-mingw32- --enable-static --disable-shared --disable-sse3
--disable-optimizations --disable-stripping --disable-mmx --disable-ssse3
--enable-debug=3
libavutil 56. 0.100 / 56. 0.100
libavcodec 58. 1.100 / 58. 1.100
libavformat 58. 0.102 / 58. 0.102
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 0.101 / 7. 0.101
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 2ac04820] decode_slice_header error
[h264 @ 2ac04820] no frame!
[h264 @ 2ac04820] Reinit context to 1280x720, pix_fmt: yuvj420p
[mpegts @ 28fa3e20] max_analyze_duration 5000000 reached at 5013333
microseconds st:1
[mpegts @ 28fa3e20] start time for stream 2 is not set in
estimate_timings_from_pts
[mpegts @ 28fa3e20] PES packet size mismatch
Last message repeated 1 times
Input #0, mpegts, from 'remux_test.ts':
Duration: 00:09:11.39, start: 46592.868000, bitrate: 7789 kb/s
Program 1
Metadata:
service_name : 1718Q0D_HAM
service_provider: FomLtd
Stream #0:0[0xfb]: Video: h264 (High), 1 reference frame
([27][0][0][0] / 0x001B), yuvj420p(pc, progressive, left), 1280x720, 50
fps, 50 tbr, 90k tbn, 100 tbc
Stream #0:1[0x12d]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000
Hz, stereo, fltp, 144 kb/s
Stream #0:2[0x105]: Data: bin_data ([6][0][0][0] / 0x0006)
[udp @ 28fa8b20] 'circular_buffer_size' option was set but it is not
supported on this build (pthread support is required)
[udp @ 28fa8c50] 'circular_buffer_size' option was set but it is not
supported on this build (pthread support is required)
[mpegts @ 28faa4b0]
mpets: mux_rate: 12000000
[mpegts @ 28faa4b0] muxrate 12000000, pcr every 159 pkts, sdt every 3989,
pat/pmt every 797 pkts
Output #0, rtp_mpegts, to 'rtp://127.0.0.1:5000':
Metadata:
encoder : Lavf58.0.102
Stream #0:0: Video: h264 (High), 1 reference frame ([27][0][0][0] /
0x001B), yuvj420p(pc, progressive, left), 1280x720 (0x0), q=2-31, 50 fps,
50 tbr, 90k tbn, 50 tbc
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp, 144 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 73 fps= 20 q=-1.0 size= 140714kB time=00:00:01.89
bitrate=609904.1kbits/s speed=0.518x
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5239#comment:6>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list