[FFmpeg-trac] #2748(documentation:open): Inconsistent UDP output packet size

FFmpeg trac at avcodec.org
Tue Jul 9 15:06:38 CEST 2013


#2748: Inconsistent UDP output packet size
-------------------------------------+-------------------------------------
             Reporter:  lancey       |                    Owner:
                 Type:  defect       |                   Status:  open
             Priority:  minor        |                Component:
              Version:  git-master   |  documentation
             Keywords:  mpegts udp   |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by lancey):

 The problem is that when adding the pkt_size=xxxx option, provided xxxx is
 a multiple of 188, I expect FFMPEG to produce output with packets which
 are all sized of xxxx bytes. But that is not the case, even if we are
 merely copying an input TS without any processing.

 Example:

 {{{
 # ffmpeg -re -i test.ts -c:v copy -c:a copy -f mpegts
 udp://239.101.102.103:3001?pkt_size=1316
 ffmpeg version N-54565-g970c8df Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Jul  8 2013 23:13:17 with gcc 4.7 (Debian 4.7.2-5)
   configuration: --enable-libfdk-aac --prefix=/usr --enable-libx264
 --enable-gpl --enable-nonfree --enable-version3
   libavutil      52. 38.100 / 52. 38.100
   libavcodec     55. 18.102 / 55. 18.102
   libavformat    55. 11.101 / 55. 11.101
   libavdevice    55.  2.100 / 55.  2.100
   libavfilter     3. 79.100 /  3. 79.100
   libswscale      2.  3.100 /  2.  3.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  3.100 / 52.  3.100
 [mpeg2video @ 0x1d55900] Invalid frame dimensions 0x0.
     Last message repeated 10 times
 [mpegts @ 0x1d51840] PES packet size mismatch
 Input #0, mpegts, from 'test.ts':
   Duration: 00:01:00.56, start: 29903.192933, bitrate: 3145 kb/s
   Program 8
     Metadata:
       service_name    : ?CITY TV
       service_provider: ?VIVACOM
     Stream #0:0[0x3b]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p, 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x3a]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
 stereo, s16p, 256 kb/s
 Output #0, mpegts, to 'udp://239.101.102.103:3001?pkt_size=1316':
   Metadata:
     encoder         : Lavf55.11.101
     Stream #0:0: Video: mpeg2video ([2][0][0][0] / 0x0002), yuv420p,
 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 90k tbn, 25 tbc
     Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, 256
 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
 Press [q] to stop, [?] for help
 PES packet size mismatch.0 size=   23802kB time=00:01:00.00
 bitrate=3249.7kbits/s
 frame= 1491 fps= 25 q=-1.0 Lsize=   24127kB time=00:01:00.44
 bitrate=3270.1kbits/s
 video:20337kB audio:1874kB subtitle:0 global headers:0kB muxing overhead
 8.623568%
 }}}

 Sample of the output - we see random packet sizes, n x 188:

 {{{
 16:02:35.598098 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598118 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598129 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 752
 <<<
 16:02:35.598155 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598163 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598169 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598175 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598181 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 752
 <<<
 16:02:35.598188 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598195 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598200 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 188
 <<<
 16:02:35.598215 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598221 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598227 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316
 16:02:35.598232 IP 10.0.3.8.34947 > 239.101.102.103.3001: UDP, length 1316

 }}}

 Problem is much more severe when doing some processing inside ffmpeg.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2748#comment:4>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list