Hi Moritz,
Many thanks for the detailed response. 

>> I am helping build a node server that runs ffmpeg to stream a live
>> WebRTC input to HLS and MPEGDASH. Often when the encoding starts it
>> produces a corrupted video output that looks something like this
>> (viewed using VLC):
> 
> Are you saying that after a few frames the video becomes correct?

No, once it starts “bad", it stays “bad".

>> Does anyone have any ideas on what might cause this type of
>> distortion on the output stream or how I can test further to track it
>> down?
> 
> To see what ffmpeg is doing with your input, it would have been helpful
> to look at ffmpeg's complete log output. But:
> 
>> ffmpeg -re -y -loglevel error -hide_banner
> 
> Without "-loglevel error" and without "-hide_banner" please.

I’ve attached the stout produced from ffmpeg when the issue is occurring with 
just those options removed.  I don’t see any issues there so I am thinking you 
may be right about it being an issue with the Web RTC input.

ffmpeg version 3.4.6 Copyright (c) 2000-2019 the FFmpeg developers
   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
   configuration: --disable-debug --disable-doc --disable-ffplay 
--enable-shared --enable-avresample --enable-libopencore-amrnb 
--enable-libopencore-amrwb --enable-gpl --enable-libass --enable-libfreetype 
--enable-libvidstab --enable-libmp3lame --enable-libopenjpeg --enable-libopus 
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp 
--enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree 
--enable-openssl --enable-libfdk_aac --enable-libkvazaar --enable-postproc 
--enable-small --enable-version3 --extra-cflags=-I/opt/ffmpeg/include 
--extra-ldflags=-L/opt/ffmpeg/lib --extra-libs=-ldl --prefix=/opt/ffmpeg
   libavutil      55. 78.100 / 55. 78.100
   libavcodec     57.107.100 / 57.107.100
   libavformat    57. 83.100 / 57. 83.100
   libavdevice    57. 10.100 / 57. 10.100
   libavfilter     6.107.100 /  6.107.100
   libavresample   3.  7.  0 /  3.  7.  0
   libswscale      4.  8.100 /  4.  8.100
   libswresample   2.  9.100 /  2.  9.100
   libpostproc    54.  7.100 / 54.  7.100

 info: Received: ice
 info: Received: ice
 info: Ice candidate added
 info: Ice candidate added
Input #0, rawvideo, from 'tcp://127.0.0.1:43455':
   Duration: N/A, start: 1568117517.228372, bitrate: 110592 kb/s
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480, 110592 
kb/s, 30 tbr, 30 tbn, 30 tbc

Input #1, mp3, from 'tcp://127.0.0.1:35403':
   Duration: N/A, start: 0.000000, bitrate: 192 kb/s
     Stream #1:0
: Audio: mp3, 48000 Hz, mono, s16p, 192 kb/s

Stream mapping:
   Stream #0:0 (rawvideo) -> format (graph 0)
   Stream #0:0 (rawvideo) -> format (graph 1)
   scale (graph 0) -> Stream #0:0 (libx264)
   Stream #1:0 -> #0:1 (mp3 (native) -> aac (native))
   scale (graph 1) -> Stream #0:2 (libx264)
   Stream #1:0 -> #0:3 (mp3 (native) -> aac (native))
 Press [q] to stop, [?] for help

[libx264 @ 0xad76e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX 
FMA3 AVX2 LZCNT BMI2

[libx264 @ 0xad76e0] profile High, level 1.3

[libx264 @ 0xad76e0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 
2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 
mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 
fast_pskip=1 chroma_qp_offset=0 threads=7 lookahead_threads=1 sliced_threads=0 
nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=1 
b_pyramid=0 b_adapt=0 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 
keyint=48 keyint_min=25 scenecut=0 intra_refresh=0 rc_lookahead=10 rc=crf 
mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=749 
vbv_bufsize=1050 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00

[libx264 @ 0xadc1a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX 
FMA3 AVX2 LZCNT BMI2

[libx264 @ 0xadc1a0] profile High, level 3.0
 [libx264 @ 0xadc1a0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 
2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 
mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 
fast_pskip=1 chroma_qp_offset=0 threads=9 lookahead_threads=2 sliced_threads=0 
nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=1 
b_pyramid=0 b_adapt=0 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 
keyint=48 keyint_min=25 scenecut=0 intra_refresh=0 rc_lookahead=10 rc=crf 
mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=749 
vbv_bufsize=1050 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/init-stream0.m4s' for 
writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/init-stream1.m4s' for 
writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/init-stream2.m4s' for 
writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/init-stream3.m4s' for 
writing

Output #0, dash, to '/usr/src/app/cdn-path/mpd/webrtc_test.mpd':
   Metadata:
     encoder         : Lavf57.83.100

    Stream #0:0: Video: h264 (libx264), yuv420p(progressive), 320x240, q=-1--1, 
400 kb/s, 30 fps, 983041.00 tbn, 30 tbc
     Metadata:
       encoder         : Lavc57.107.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 749000/0/400000 buffer size: 1050000 
vbv_delay: -1
     Stream #0:1: Audio: aac, 48000 Hz, mono, fltp, 64 kb/s
     Metadata:
       encoder         : Lavc57.107.100 aac
     Stream #0:2: Video: h264 (libx264), yuv420p(progressive), 480x360, 
q=-1--1, 700 kb/s, 30 fps, 983041.00 tbn, 30 tbc
     Metadata:
       encoder         : Lavc57.107.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 749000/0/700000 buffer size: 1050000 
vbv_delay: -1
     Stream #0:3: Audio: aac, 48000 Hz, mono, fltp, 96 kb/s
     Metadata:
       encoder         : Lavc57.107.100 aac

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

Past duration 0.999992 too large

    Last message repeated 3 times
 frame=   53 fps=0.0 q=28.0 q=28.0 size=N/A time=00:00:01.06 bitrate=N/A dup=90 
drop=12 speed=2.11x
frame=   69 fps= 68 q=28.0 q=28.0 size=N/A time=00:00:01.59 bitrate=N/A dup=114 
drop=12 speed=1.58x
frame=   81 fps= 53 q=28.0 q=28.0 size=N/A time=00:00:01.99 bitrate=N/A dup=132 
drop=12 speed=1.32x
frame=   97 fps= 48 q=28.0 q=28.0 size=N/A time=00:00:02.53 bitrate=N/A dup=156 
drop=12 speed=1.25x
frame=  113 fps= 45 q=28.0 q=28.0 size=N/A time=00:00:03.06 bitrate=N/A dup=180 
drop=12 speed=1.21x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00001.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00001.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00001.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00001.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame=  129 fps= 43 q=28.0 q=28.0 size=N/A time=00:00:03.59 bitrate=N/A dup=196 
drop=12 speed=1.19x
frame=  144 fps= 41 q=28.0 q=28.0 size=N/A time=00:00:04.09 bitrate=N/A dup=210 
drop=12 speed=1.16x
frame=  158 fps= 39 q=25.0 q=26.0 size=N/A time=00:00:04.56 bitrate=N/A dup=222 
drop=12 speed=1.13x
frame=  174 fps= 38 q=28.0 q=31.0 size=N/A time=00:00:05.09 bitrate=N/A dup=236 
drop=12 speed=1.12x
frame=  189 fps= 37 q=28.0 q=31.0 size=N/A time=00:00:05.59 bitrate=N/A dup=238 
drop=12 speed=1.11x
frame=  204 fps= 37 q=28.0 q=28.0 size=N/A time=00:00:06.09 bitrate=N/A dup=238 
drop=12 speed= 1.1x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00002.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00002.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00002.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00002.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame=  220 fps= 36 q=28.0 q=28.0 size=N/A time=00:00:06.63 bitrate=N/A dup=238 
drop=12 speed= 1.1x
frame=  235 fps= 36 q=28.0 q=28.0 size=N/A time=00:00:07.13 bitrate=N/A dup=238 
drop=12 speed=1.09x
frame=  250 fps= 35 q=28.0 q=28.0 size=N/A time=00:00:07.63 bitrate=N/A dup=238 
drop=12 speed=1.08x
frame=  265 fps= 35 q=28.0 q=28.0 size=N/A time=00:00:08.13 bitrate=N/A dup=238 
drop=12 speed=1.08x
frame=  280 fps= 35 q=28.0 q=28.0 size=N/A time=00:00:08.63 bitrate=N/A dup=238 
drop=12 speed=1.07x
frame=  295 fps= 34 q=28.0 q=28.0 size=N/A time=00:00:09.13 bitrate=N/A dup=238 
drop=12 speed=1.07x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00003.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00003.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00003.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00003.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame=  310 fps= 34 q=28.0 q=28.0 size=N/A time=00:00:09.63 bitrate=N/A dup=238 
drop=12 speed=1.06x
frame=  325 fps= 34 q=28.0 q=28.0 size=N/A time=00:00:10.13 bitrate=N/A dup=238 
drop=12 speed=1.06x
frame=  341 fps= 34 q=28.0 q=28.0 size=N/A time=00:00:10.66 bitrate=N/A dup=238 
drop=12 speed=1.06x
Past duration 0.999992 too large

    Last message repeated 9 times
 frame=  356 fps= 34 q=28.0 q=28.0 size=N/A time=00:00:11.16 bitrate=N/A 
dup=238 drop=12 speed=1.05x
Past duration 0.999992 too large

    Last message repeated 27 times
 frame=  371 fps= 33 q=28.0 q=28.0 size=N/A time=00:00:11.66 bitrate=N/A 
dup=238 drop=12 speed=1.05x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame=  386 fps= 33 q=28.0 q=28.0 size=N/A time=00:00:12.16 bitrate=N/A 
dup=238 drop=12 speed=1.05x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame=  401 fps= 33 q=28.0 q=28.0 size=N/A time=00:00:12.66 bitrate=N/A 
dup=238 drop=12 speed=1.05x
Past duration 0.999992 too large

    Last message repeated 9 times
 [dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00004.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00004.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00004.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00004.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

Past duration 0.999992 too large

    Last message repeated 17 times
 frame=  416 fps= 33 q=28.0 q=28.0 size=N/A time=00:00:13.16 bitrate=N/A 
dup=238 drop=12 speed=1.04x
Past duration 0.999992 too large

    Last message repeated 21 times
 frame=  431 fps= 33 q=28.0 q=28.0 size=N/A time=00:00:13.66 bitrate=N/A 
dup=238 drop=12 speed=1.04x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame=  446 fps= 33 q=25.0 q=25.0 size=N/A time=00:00:14.16 bitrate=N/A 
dup=238 drop=12 speed=1.04x
Past duration 0.999992 too large

    Last message repeated 19 times
 frame=  461 fps= 33 q=28.0 q=28.0 size=N/A time=00:00:14.66 bitrate=N/A 
dup=238 drop=12 speed=1.04x
Past duration 0.999992 too large

    Last message repeated 19 times
 frame=  476 fps= 33 q=28.0 q=28.0 size=N/A time=00:00:15.16 bitrate=N/A 
dup=238 drop=12 speed=1.04x
Past duration 0.999992 too large

    Last message repeated 3 times
 frame=  491 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:15.66 bitrate=N/A 
dup=238 drop=12 speed=1.04x
Past duration 0.999992 too large

    Last message repeated 1 times
 [dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00005.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00005.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00005.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00005.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

Past duration 0.999992 too large

    Last message repeated 3 times
 frame=  506 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:16.16 bitrate=N/A 
dup=238 drop=12 speed=1.03x
Past duration 0.999992 too large

    Last message repeated 1 times
 frame=  522 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:16.69 bitrate=N/A 
dup=238 drop=12 speed=1.03x
frame=  537 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:17.19 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  552 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:17.69 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  567 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:18.19 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  583 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:18.73 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  598 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:19.23 bitrate=N/A dup=238 
drop=12 speed=1.03x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00006.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00006.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00006.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00006.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame=  613 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:19.73 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  628 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:20.23 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  643 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:20.73 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  659 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:21.26 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  674 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:21.76 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  689 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:22.26 bitrate=N/A dup=238 
drop=12 speed=1.03x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00007.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00007.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00007.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00007.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame=  704 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:22.76 bitrate=N/A dup=238 
drop=12 speed=1.03x
frame=  719 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:23.26 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  734 fps= 32 q=25.0 q=25.0 size=N/A time=00:00:23.76 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  749 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:24.26 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  764 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:24.76 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  779 fps= 32 q=28.0 q=28.0 size=N/A time=00:00:25.26 bitrate=N/A dup=238 
drop=12 speed=1.02x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00008.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00008.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00008.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00008.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame=  794 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:25.76 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  809 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:26.26 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  824 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:26.76 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  839 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:27.26 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  854 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:27.76 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  870 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:28.29 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  885 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:28.79 bitrate=N/A dup=238 
drop=12 speed=1.02x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00009.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00009.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00009.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00009.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame=  900 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:29.29 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  915 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:29.79 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  930 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:30.29 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  945 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:30.79 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  961 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:31.33 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame=  976 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:31.83 bitrate=N/A dup=238 
drop=12 speed=1.02x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00010.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00010.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00010.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00010.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame=  991 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:32.33 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame= 1006 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:32.83 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame= 1021 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:33.33 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame= 1036 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:33.83 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame= 1051 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:34.33 bitrate=N/A dup=238 
drop=12 speed=1.02x
frame= 1066 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:34.83 bitrate=N/A dup=238 
drop=12 speed=1.02x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00011.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00011.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00011.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00011.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame= 1081 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:35.33 bitrate=N/A dup=238 
drop=12 speed=1.02x
Past duration 0.999992 too large

    Last message repeated 25 times
 frame= 1097 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:35.86 bitrate=N/A 
dup=240 drop=12 speed=1.02x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame= 1112 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:36.36 bitrate=N/A 
dup=240 drop=12 speed=1.02x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame= 1127 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:36.86 bitrate=N/A 
dup=240 drop=12 speed=1.02x
Past duration 0.999992 too large

    Last message repeated 31 times
 frame= 1143 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:37.39 bitrate=N/A 
dup=240 drop=12 speed=1.02x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame= 1158 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:37.89 bitrate=N/A 
dup=240 drop=12 speed=1.02x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame= 1173 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:38.39 bitrate=N/A 
dup=240 drop=12 speed=1.02x
Past duration 0.999992 too large

    Last message repeated 1 times

[dash @ 0xad6260]
Opening '/usr/src/app/cdn-path/mpd/chunk-stream0-00012.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00012.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00012.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00012.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

Past duration 0.999992 too large

    Last message repeated 27 times
 frame= 1188 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:38.89 bitrate=N/A 
dup=240 drop=12 speed=1.02x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame= 1203 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:39.39 bitrate=N/A 
dup=240 drop=12 speed=1.01x
Past duration 0.999992 too large

    Last message repeated 29 times

frame= 1218 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:39.89 bitrate=N/A dup=240 
drop=12 speed=1.01x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame= 1233 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:40.39 bitrate=N/A 
dup=240 drop=12 speed=1.01x
Past duration 0.999992 too large

    Last message repeated 29 times
 frame= 1248 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:40.89 bitrate=N/A 
dup=240 drop=12 speed=1.01x
Past duration 0.999992 too large

    Last message repeated 5 times
 frame= 1264 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:41.43 bitrate=N/A 
dup=240 drop=12 speed=1.01x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00013.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00013.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00013.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00013.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame= 1279 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:41.93 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1294 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:42.43 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1309 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:42.93 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1324 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:43.43 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1339 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:43.93 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1354 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:44.43 bitrate=N/A dup=240 
drop=12 speed=1.01x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00014.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00014.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00014.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00014.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame= 1369 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:44.93 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1385 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:45.46 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1400 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:45.96 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1414 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:46.43 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1430 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:46.96 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1445 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:47.46 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1460 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:47.96 bitrate=N/A dup=240 
drop=12 speed=1.01x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00015.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00015.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00015.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00015.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame= 1475 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:48.46 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1490 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:48.96 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1505 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:49.46 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1521 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:49.99 bitrate=N/A dup=240 
drop=12 speed=1.01x
Past duration 0.999992 too large

    Last message repeated 1 times
 frame= 1536 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:50.49 bitrate=N/A 
dup=240 drop=12 speed=1.01x
frame= 1551 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:50.99 bitrate=N/A dup=240 
drop=12 speed=1.01x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00016.m4s.tmp' for writing

[dash @ 0xad6260]
Opening '/usr/src/app/cdn-path/mpd/chunk-stream1-00016.m4s.tmp' for writing

[dash @ 0xad6260]
Opening '/usr/src/app/cdn-path/mpd/chunk-stream3-00016.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260]
Opening '/usr/src/app/cdn-path/mpd/chunk-stream2-00016.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

frame= 1566 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:51.49 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1581 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:51.99 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1596 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:52.49 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1612 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:53.03 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1627 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:53.53 bitrate=N/A dup=240 
drop=12 speed=1.01x
frame= 1642 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:54.03 bitrate=N/A dup=240 
drop=12 speed=1.01x
[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream0-00017.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream1-00017.m4s.tmp' for writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream3-00017.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

[dash @ 0xad6260] Opening 
'/usr/src/app/cdn-path/mpd/chunk-stream2-00017.m4s.tmp' for writing

[dash @ 0xad6260] Opening '/usr/src/app/cdn-path/mpd/webrtc_test.mpd.tmp' for 
writing

Past duration 0.999992 too large

    Last message repeated 1 times
 frame= 1657 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:54.53 bitrate=N/A 
dup=240 drop=12 speed=1.01x
frame= 1672 fps= 31 q=28.0 q=28.0 size=N/A time=00:00:55.03 bitrate=N/A dup=240 
drop=12 speed=1.01x
If you do spot anything "interesting" please let me know.

> To see whether the input is at fault, you would strip all the output
> magic and just dump a few seconds to file, by keeping all the input
> options, but just writing a simple file, for example:
> 
> $ ffmpeg { input options } -map 0:v -map 1:a -t 5 testout.mp4
> 
> to check whether the same effects are to be seen in that file.

Yes, I’ll try this - but because it’s all being run programmatically using 
nodeJS it will take me a little while to make the code so that all commands are 
running under the same conditions.

>> ffmpeg version 3.4.6 Copyright (c) 2000-2019 the FFmpeg developers
> 
> Though it probably isn't part of your issue, we always recommend to
> test (or even use) a very recent version of ffmpeg. This rules out
> debugging fixed bugs. If you can't find a newer ffmpeg in some other
> repository, and you don't want to build yourself, you can grab a static
> binary from here and test with that:
> 
> https://johnvansickle.com/ffmpeg/
> 
> (Left column, "git master", please.)


Yes - again this is inside a docker build so it will take a little while to 
bring it up to date, but if it is looking like ffmpeg is the issue then I’ll 
give it a go.

Thank you
Ben

> On 10 Sep 2019, at 10:41, Moritz Barsnick <[email protected]> wrote:
> 
> Hi Ben,
> 
> On Tue, Sep 10, 2019 at 06:09:30 +0100, Ben Houghton wrote:
>> I am helping build a node server that runs ffmpeg to stream a live
>> WebRTC input to HLS and MPEGDASH. Often when the encoding starts it
>> produces a corrupted video output that looks something like this
>> (viewed using VLC):
> 
> Are you saying that after a few frames the video becomes correct?
> 
>> HLS output distorted image <https://i.stack.imgur.com/Dxx03.png>
>> MPEGDASH output distorted image <https://i.stack.imgur.com/9YQri.png>
> 
> This doesn't look like an encoding error by ffmpeg, but it could be a
> decoding artifact. In particular if the first frame is not a keyframe
> or just partially received. There's possibly nothing you can do,
> because that's the way the stream is initially picked up. (Just
> guessing so far.)
> 
>> Does anyone have any ideas on what might cause this type of
>> distortion on the output stream or how I can test further to track it
>> down?
> 
> To see what ffmpeg is doing with your input, it would have been helpful
> to look at ffmpeg's complete log output. But:
> 
>> ffmpeg -re -y -loglevel error -hide_banner
> 
> Without "-loglevel error" and without "-hide_banner" please.
> 
> To see whether the input is at fault, you would strip all the output
> magic and just dump a few seconds to file, by keeping all the input
> options, but just writing a simple file, for example:
> 
> $ ffmpeg { input options } -map 0:v -map 1:a -t 5 testout.mp4
> 
> to check whether the same effects are to be seen in that file.
> 
>> ffmpeg version 3.4.6 Copyright (c) 2000-2019 the FFmpeg developers
> 
> Though it probably isn't part of your issue, we always recommend to
> test (or even use) a very recent version of ffmpeg. This rules out
> debugging fixed bugs. If you can't find a newer ffmpeg in some other
> repository, and you don't want to build yourself, you can grab a static
> binary from here and test with that:
> 
> https://johnvansickle.com/ffmpeg/
> 
> (Left column, "git master", please.)
> 
> Regards,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [email protected]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> [email protected] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to