Opened 4 years ago

Last modified 4 years ago

#4506 new defect

ffmpeg does not seem to receive replayed packets

Reported by: fohletex Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

The following situation is given: I have a video I encoded with ffmpeg in x265 on ubuntu 14.04. I streamed (UDP) the video as MPEGTS to the localhost and captured the transmitted packets with tcpdump in a pcap file. When I replay the pcap file with tcpreplay, neither ffplay nor ffmpeg seem to receive the stream. Although the packets are really transmitted, as I could verify in wireshark and iptraf.

The packets seem to be correct, due to the fact that I can extract the UDP conversation stream into an own file which can be played manually again via ffplay without any problems. I can also stream the video directly to the localhost and receive it with ffplay or ffmpeg. Only when I stream from tcpreplay there are problems.

Note that general streaming works on my machine: I am able to stream the video directly and receive it.

I know that there is a ticket open for tcpreplay, that streaming to the localhost can work, but can also not work. But due to my upper described experiences among this topic it seems, that tcpreplay is able to replay the localhost packets. For example, I can tcpreplay and tcpdump the local transmission completely, so it's not like the packets are not sent.

How to reproduce:

Terminal 1:

% ffplay udp://127.0.0.1:1234
ffplay version N-71455-gfbdaebb Copyright (c) 2003-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/home/user/ffmpeg_build --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      54. 22.101 / 54. 22.101
  libavcodec     56. 34.100 / 56. 34.100
  libavformat    56. 30.100 / 56. 30.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 14.100 /  5. 14.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100

or

% ffmpeg -i udp://localhost:1234 -c:v rawvideo myvideo.avi
ffmpeg version N-71455-gfbdaebb Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/home/user/ffmpeg_build --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      54. 22.101 / 54. 22.101
  libavcodec     56. 34.100 / 56. 34.100
  libavformat    56. 30.100 / 56. 30.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 14.100 /  5. 14.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100

Both seem not to work. The video does not start playing.

Terminal 2:

% sudo tcpreplay -i lo mypcapfile.pcap 
Warning in sendpacket.c:sendpacket_open_pf() line 669:
Unsupported physical layer type 0x0304 on lo.  Maybe it works, maybe it wont.  See tickets #123/318
sending out lo 
processing file: mypcapfile.pcap
Actual: 3276 packets (4795040 bytes) sent in 9.82 seconds.		Rated: 488293.3 bps, 3.73 Mbps, 333.60 pps
Statistics for network device: lo
	Attempted packets:         3276
	Successful packets:        3276
	Failed packets:            0
	Retried packets (ENOBUFS): 0
	Retried packets (EAGAIN):  0

And here the output when I stream the video directly ...

Terminal 1:

% ffmpeg -re -i myvideo.ts -c:v copy -an -f mpegts -bsf:v h264_mp4toannexb udp://127.0.0.1:1234
ffmpeg version N-71455-gfbdaebb Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/home/user/ffmpeg_build --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      54. 22.101 / 54. 22.101
  libavcodec     56. 34.100 / 56. 34.100
  libavformat    56. 30.100 / 56. 30.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 14.100 /  5. 14.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from 'myvideo.ts':
  Duration: 00:00:10.04, start: 54.791800, bitrate: 3606 kb/s
  Program 1 
    Stream #0:0[0x65]: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv), 1920x1080, 24 fps, 24 tbr, 90k tbn, 24 tbc
Output #0, mpegts, to 'udp://127.0.0.1:1234':
  Metadata:
    encoder         : Lavf56.30.100
    Stream #0:0: Video: hevc ([36][0][0][0] / 0x0024), yuv420p, 1920x1080, q=2-31, 24 fps, 24 tbr, 90k tbn, 24 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=   16 fps=0.0 q=-1.0 size=     349kB time=00:00:00.58 bitrate=4898.7kbits/frame=   28 fps= 28 q=-1.0 size=     588kB time=00:00:01.08 bitrate=4449.5kbits/frame=   40 fps= 26 q=-1.0 size=     953kB time=00:00:01.58 bitrate=4930.0kbits/frame=   52 fps= 26 q=-1.0 size=    1204kB time=00:00:02.08 bitrate=4734.4kbits/frame=   64 fps= 25 q=-1.0 size=    1451kB time=00:00:02.58 bitrate=4601.7kbits/frame=   76 fps= 25 q=-1.0 size=    1838kB time=00:00:03.08 bitrate=4883.2kbits/frame=   88 fps= 25 q=-1.0 size=    2299kB time=00:00:03.58 bitrate=5255.7kbits/frame=  100 fps= 25 q=-1.0 size=    2747kB time=00:00:04.08 bitrate=5512.0kbits/frame=  112 fps= 25 q=-1.0 size=    3014kB time=00:00:04.58 bitrate=5387.2kbits/frame=  125 fps= 25 q=-1.0 size=    3098kB time=00:00:05.12 bitrate=4952.2kbits/frame=  137 fps= 25 q=-1.0 size=    3187kB time=00:00:05.62 bitrate=4641.9kbits/frame=  149 fps= 25 q=-1.0 size=    3297kB time=00:00:06.12 bitrate=4409.1kbits/frame=  161 fps= 25 q=-1.0 size=    3439kB time=00:00:06.62 bitrate=4252.5kbits/frame=  173 fps= 24 q=-1.0 size=    3510kB time=00:00:07.12 bitrate=4035.2kbits/frame=  185 fps= 24 q=-1.0 size=    3715kB time=00:00:07.62 bitrate=3991.7kbits/frame=  197 fps= 24 q=-1.0 size=    3946kB time=00:00:08.12 bitrate=3978.3kbits/frame=  210 fps= 24 q=-1.0 size=    4159kB time=00:00:08.66 bitrate=3931.2kbits/frame=  222 fps= 24 q=-1.0 size=    4302kB time=00:00:09.16 bitrate=3844.7kbits/frame=  234 fps= 24 q=-1.0 size=    4518kB time=00:00:09.66 bitrate=3828.4kbits/frame=  241 fps= 24 q=-1.0 Lsize=    4563kB time=00:00:09.95 bitrate=3753.5kbits/s    
video:4204kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.546336%

Terminal 2:

% ffplay udp://127.0.0.1:1234
ffplay version N-71455-gfbdaebb Copyright (c) 2003-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --prefix=/home/user/ffmpeg_build --extra-cflags=-I/home/user/ffmpeg_build/include --extra-ldflags=-L/home/user/ffmpeg_build/lib --bindir=/home/user/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      54. 22.101 / 54. 22.101
  libavcodec     56. 34.100 / 56. 34.100
  libavformat    56. 30.100 / 56. 30.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 14.100 /  5. 14.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mpegts, from 'udp://127.0.0.1:1234':0KB sq=    0B f=0/0   
  Duration: N/A, start: 1.483333, bitrate: N/A
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv), 1920x1080, 24 fps, 24 tbr, 90k tbn, 24 tbc
  13.72 M-V: -0.270 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0

Change History (1)

comment:1 Changed 4 years ago by fohletex

I would like to attach the .pcap-file. But due to memory upload limitations I can not. Please contact me if you need the .pcap file that I can deliver it to you in another way.

Note: See TracTickets for help on using tickets.