mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.63k stars 2.92k forks source link

Video/audio artifacts with RTP stream #6693

Open nE0sIghT opened 5 years ago

nE0sIghT commented 5 years ago

mpv version and platform

> mpv --version
mpv 0.29.1 Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
ffmpeg library versions:
   libavutil       56.22.100
   libavcodec      58.35.100
   libavformat     58.20.100
   libswscale      5.3.100
   libavfilter     7.40.101
   libswresample   3.3.100
ffmpeg version: 4.1.3

Gentoo GNU/Linux

Reproduction steps

Try to view any RTP stream in LAN of my Internet provider like

mpv rtp://@233.33.210.16:5050

Expected behavior

Video and audio without artifacts

Actual behavior

Periodical video/audio artifacts with mpv, but no issues with ffplay.

Log file

http://coldzone.ru/upload/rtp/stream.log

Sample files

Stream captured with tcpdump while playing it with ffplay http://coldzone.ru/upload/rtp/stream.cap

gunnarmarten commented 5 years ago

Try setting the low latency profile with --profile=low-latency. This might help. And checkout the low latency section of the docs:

https://github.com/mpv-player/mpv/blob/master/DOCS/man/mpv.rst#low-latency-playback

nE0sIghT commented 5 years ago

I tryed low-latency profile, untimed and no-correct-pts options without success.

low-latency profile log: http://dpaste.com/1Q4Y1FD

nE0sIghT commented 5 years ago

In case it will help - verbose ffplay (without artifacts) log: http://coldzone.ru/upload/rtp/ffplay.log

gunnarmarten commented 5 years ago

What happens if you create a .sdp file and play that with mpv (like: mpv stream.sdp)? The sdp infos are in the ffplay logfile:

v=0
c=IN IP4 233.33.210.16
m=application 5050 RTP/AVP 33
nE0sIghT commented 5 years ago
> mpv stream.sdp 
Playing: stream.sdp
[ffmpeg/demuxer] sdp: max delay reached. need to consume packet
[ffmpeg/demuxer] sdp: RTP: missed 754 packets
[ffmpeg] Assertion pos >= 188 failed at src/libavformat/mpegts.c:2530

> cat stream.sdp 
v=0
c=IN IP4 233.33.210.16
m=application 5050 RTP/AVP 33

> ffplay -protocol_whitelist file,udp,rtp stream.sdp 
ffplay version 4.1.3 Copyright (c) 2003-2019 the FFmpeg developers
  built with gcc 8.2.0 (Gentoo 8.2.0-r6 p1.7)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-4.1.3/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-O3 -march=native -pipe -fomit-frame-pointer' --disable-static --enable-avfilter --enable-avresample --disable-stripping --disable-optimizations --disable-libcelt --enable-nonfree --disable-indev=v4l2 --disable-outdev=v4l2 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --disable-gnutls --disable-gmp --enable-gpl --disable-hardcoded-tables --enable-iconv --disable-libtls --disable-libxml2 --enable-lzma --enable-network --disable-opencl --enable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --enable-vaapi --enable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --enable-libcaca --enable-openal --enable-opengl --disable-libv4l2 --enable-libpulse --disable-libdrm --disable-libjack --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libcodec2 --disable-libfdk-aac --enable-libopenjpeg --enable-libbluray --disable-libgme --disable-libgsm --disable-mmal --disable-libmodplug --disable-libopus --disable-libilbc --disable-librtmp --disable-libssh --enable-libspeex --disable-libsrt --enable-librsvg --enable-ffnvcodec --enable-libvorbis --enable-libvpx --disable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-libflite --enable-frei0r --disable-libfribidi --enable-fontconfig --enable-ladspa --enable-libass --disable-lv2 --enable-libfreetype --disable-librubberband --disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-libvo-amrwbenc --enable-libmp3lame --disable-libkvazaar --disable-libaom --disable-libopenh264 --disable-libsnappy --enable-libtheora --enable-libtwolame --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --disable-gnutls --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-amd3dnow --disable-amd3dnowext --disable-avx2 --disable-fma3 --disable-fma4 --disable-xop --cpu=host --disable-doc --disable-htmlpages --enable-manpages
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Assertion pos >= 188 failed at src/libavformat/mpegts.c:2530
ghost commented 5 years ago

How can I reproduce this?

nE0sIghT commented 5 years ago

@wm4 I think there is should be a way to replay captured http://coldzone.ru/upload/rtp/stream.cap stream. I wil try to use https://github.com/appneta/tcpreplay/ for this and share results.

nE0sIghT commented 5 years ago

Here is instructions: http://blog.itekako.com/technical/2017/03/07/rtp-stream-replay/ I didn't tested this yet and looks like replaying RTP stream needs one more PC eg virtual one.