OpenVisualCloud / SVT-HEVC

SVT HEVC encoder. Scalable Video Technology (SVT) is a software-based video coding technology that is highly optimized for Intel® Xeon® processors. Using the open source SVT-HEVC encoder, it is possible to spread video encoding processing across multiple Intel® Xeon® processors to achieve a real advantage of processing efficiency.
Other
516 stars 172 forks source link

SVT FFMPEG-Plugin - no video when trying to stream mpegts #532

Closed mikaelsson closed 4 years ago

mikaelsson commented 4 years ago

I am trying to check live-streaming possibilities of the plugin. The problem is that there's no video in the output. For now I am trying to use the most basic settings leaving everything else on default. Using the latest versions of ffmpeg and plugin:

ffmpeg version n4.2.2-7-gd5d4c3487c Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
SVT [version]:  SVT-HEVC Encoder Lib v1.4.3
SVT [build]  :  GCC 8.3.1 20190507 (Red Hat 8.3.1-4)     64 bit
LIB Build date: Apr 29 2020 12:23:10

here is ffmpeg string:

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=2788760" \
-c:v libsvt_hevc -s 1920x1080 -r 60 -b:v 10M \
-c:a copy \
-flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=2788760&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

in output it correctly identifies the stream and designates the needed outputs for transcoding. output:

Input #0, mpegts, from 'udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=2788760':
  Duration: N/A, start: 47531.772956, bitrate: N/A
  Program 4602
    Metadata:
      service_name    : Nasa TV UHD
      service_provider:
    Stream #0:0[0x165]: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x166]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 64 kb/s
    Stream #0:2[0x167]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 94 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (libsvt_hevc))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc @ 0x15a71c0] Could not find ref with POC 96
[hevc @ 0x15a71c0] Could not find ref with POC 104
SVT [version]:  SVT-HEVC Encoder Lib v1.4.3
SVT [build]  :  GCC 8.3.1 20190507 (Red Hat 8.3.1-4)     64 bit
LIB Build date: Apr 29 2020 12:23:10
-------------------------------------------
Number of logical cores available: 40
Number of PPCS 107
-------------------------------------------
SVT [config]: Main Profile      Tier (auto)     Level (auto)
SVT [config]: EncoderMode / Tune                                                        : 7 / 1
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat             : 8 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo                              : 1920 / 1080 / 0
SVT [config]: Fps_Numerator / Fps_Denominator / Gop Size / IntraRefreshType             : 60 / 1 / 64 / -1
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure                  : 3 / 0 / 2
SVT [config]: BRC Mode / QP / LookaheadDistance / SceneChange                           : CQP / 32 / 17 / 1
SVT [config]: BitRateReduction / ImproveSharpness                                       : 0 / 0
SVT [config]: tileColumnCount / tileRowCount / tileSliceMode / Constraint MV            : 1 / 1 / 0 / 0
SVT [config]: De-blocking Filter / SAO Filter                                           : 1 / 1
SVT [config]: HME / UseDefaultHME                                                       : 1 / 1
SVT [config]: MV Search Area Width / Height                                             : 16 / 7
SVT [config]: HRD / VBV MaxRate / BufSize / BufInit                                     : 0 / 0 / 0 / 90
-------------------------------------------
Output #0, mpegts, to 'udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=2788760&localaddr=127.0.0.1&ttl=16&pkt_size=1316':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: hevc (libsvt_hevc), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=10-48, 10000 kb/s, 60 fps, 90k tbn, 60 tbc
    Metadata:
      encoder         : Lavc58.54.100 libsvt_hevc
    Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 64 kb/s

however in stats bitrate never goes near the expected 10Mbps, varying from 200kbps to 500kbps approximately:

frame=25847 fps= 60 q=-0.0 Lsize=   26684kB time=00:07:12.24 bitrate= 505.7kbits/s dup=0 drop=4 speed=1.01x

then I dump output into the file using multicat and check it with mediainfo:

General
ID                                       : 1 (0x1)
Complete name                            : ns1.ts
Format                                   : MPEG-TS
File size                                : 654 KiB
Duration                                 : 9 s 900 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 537 kb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Codec ID                                 : 36
Duration                                 : 9 s 966 ms
Bit rate                                 : 446 kb/s
Stream size                              : 542 KiB (83%)

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 9 s 720 ms
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -2 s 833 ms
Stream size                              : 75.9 KiB (12%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 9 s 900 ms
List                                     : 256 (0x100) (HEVC) / 257 (0x101) (MPEG Audio)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television

there is no resolution in video part. playing it using vlc only plays audio.

tianjunwork commented 4 years ago

Hi @mikaelsson , what's your command line? From the log, you are using CQP bitrate control. I didn't see the target bitrate setting. SVT [config]: BRC Mode / QP / LookaheadDistance / SceneChange : CQP / 32 / 17 / 1

mikaelsson commented 4 years ago

hi @tianjunwork,

CQP bitrate control was on by default. I switched to VBR mode and now I am getting at least 7-9 mbps according to log and correct 10 mbps according to mediainfo (which is a bit strange, but it is not the issue), the main issue remains: there is still no video in output.

I am running ffmpeg from the script-file (updated for vbr mode and added gop_size parameter):

#!/bin/bash

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=2788760" \
-c:v libsvt_hevc -s 1920x1080 -r 60 -g 60 -rc 1 -b:v 10000k \
-c:a copy \
-flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=2788760&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

output log

Input #0, mpegts, from 'udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=2788760':
  Duration: N/A, start: 47057.532956, bitrate: N/A
  Program 4602
    Metadata:
      service_name    : Nasa TV UHD
      service_provider:
    Stream #0:0[0x165]: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x166]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 64 kb/s
    Stream #0:2[0x167]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 93 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (libsvt_hevc))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc @ 0x1331d80] Could not find ref with POC 4
[hevc @ 0x1331d80] Could not find ref with POC 8
SVT [version]:  SVT-HEVC Encoder Lib v1.4.3
SVT [build]  :  GCC 8.3.1 20190507 (Red Hat 8.3.1-4)     64 bit
LIB Build date: Apr 29 2020 12:23:10
-------------------------------------------
Number of logical cores available: 40
Number of PPCS 149
-------------------------------------------
SVT [config]: Main Profile      Tier (auto)     Level (auto)
SVT [config]: EncoderMode / Tune                                                        : 7 / 1
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat             : 8 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo                              : 1920 / 1080 / 0
SVT [config]: Fps_Numerator / Fps_Denominator / Gop Size / IntraRefreshType             : 60 / 1 / 60 / -1
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure                  : 3 / 0 / 2
SVT [config]: RCMode / TargetBitrate / LAD / SceneChange / QP Range [10 ~ 48]           : VBR / 10000000 / 59 / 1
SVT [config]: BitRateReduction / ImproveSharpness                                       : 0 / 0
SVT [config]: tileColumnCount / tileRowCount / tileSliceMode / Constraint MV            : 1 / 1 / 0 / 0
SVT [config]: De-blocking Filter / SAO Filter                                           : 1 / 1
SVT [config]: HME / UseDefaultHME                                                       : 1 / 1
SVT [config]: MV Search Area Width / Height                                             : 16 / 7
SVT [config]: HRD / VBV MaxRate / BufSize / BufInit                                     : 0 / 0 / 0 / 90
-------------------------------------------
Output #0, mpegts, to 'udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=2788760&localaddr=127.0.0.1&ttl=16&pkt_size=1316':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: hevc (libsvt_hevc), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=10-48, 10000 kb/s, 60 fps, 90k tbn, 60 tbc
    Metadata:
      encoder         : Lavc58.54.100 libsvt_hevc
    Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 64 kb/s

output stats:

frame=14126 fps= 60 q=-0.0 size=  220786kB time=00:03:57.48 bitrate=7616.1kbits/s speed=1.01x

output of mediainfo:

General
ID                                       : 1 (0x1)
Complete name                            : ns777.ts
Format                                   : MPEG-TS
File size                                : 13.1 MiB
Duration                                 : 9 s 883 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 10.6 Mb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Codec ID                                 : 36
Duration                                 : 9 s 950 ms
Bit rate                                 : 10.0 Mb/s
Stream size                              : 11.9 MiB (91%)

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 9 s 720 ms
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -1 s 334 ms
Stream size                              : 75.9 KiB (1%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 9 s 883 ms
List                                     : 256 (0x100) (HEVC) / 257 (0x101) (MPEG Audio)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television
mikaelsson commented 4 years ago

after running for some time, the bitrate reached 10mpbs in log too

frame=28667 fps= 60 q=-0.0 size=  635165kB time=00:07:59.20 bitrate=10858.1kbits/s dup=0 drop=12 speed=1.01x
tianjunwork commented 4 years ago

Since ffmpeg can calculate output bitrate, it must have received encoded frames from svt-hevc library. Just help debugging, could you try output to a local file instead of udp? Does it work?

mikaelsson commented 4 years ago

I changed only detination part:

#!/bin/bash

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=2788760" \
-c:v libsvt_hevc -s 1920x1080 -r 60 -g 60 -rc 1 -b:v 10000k \
-c:a copy \
-flush_packets 0 -f mpegts "/root/ns3.ts"

there is video present in this case. mediainfo:

General
ID                                       : 1 (0x1)
Complete name                            : ns3.ts
Format                                   : MPEG-TS
File size                                : 39.1 MiB
Duration                                 : 30 s 0 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 10.9 Mb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L4.1@Main
Codec ID                                 : 36
Duration                                 : 30 s 50 ms
Bit rate                                 : 10.3 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Stream size                              : 36.9 MiB (94%)

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 30 s 528 ms
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -2 s 366 ms
Stream size                              : 238 KiB (1%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 30 s 0 ms
List                                     : 256 (0x100) (HEVC) / 257 (0x101) (MPEG Audio)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television

audio is not synced properly, more than 2 seconds off. but it is at least playable in vlc.

tianjunwork commented 4 years ago

Thank you sending the test result. The no video issue is not related to svt ffmpeg plugin. I am not an expert of using ffmpeg udp output. Maybe you could try increase buffer_size?

buffer_size=size
Set the UDP maximum socket buffer size in bytes. This is used to set either the receive or send buffer size, depending on what the socket is used for. Default is 32 KB for output, 384 KB for input. See also fifo_size.
mikaelsson commented 4 years ago

I am sorry, but I must disagree with you. I believe it has something to do with the plugin, simply because if I change libsv_hevc to libx265 (and remove -rc 1 because it is not valid for libx265) everything works. well not quite due to the fact that it can't reach 60fps even on this system, and because of that timing is a bit scewed. But it is "playable". I also tested libx264 just with different stream and streaming to network is not an issue in any of these cases.

libx265 script:

#!/bin/bash

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=2788760" \
-c:v libx265 -s 1920x1080 -r 60 -g 60 -b:v 10000k \
-c:a copy \
-flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=2788760&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

output:

Input #0, mpegts, from 'udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=2788760':
  Duration: N/A, start: 47007.996956, bitrate: N/A
  Program 4602
    Metadata:
      service_name    : Nasa TV UHD
      service_provider:
    Stream #0:0[0x165]: Video: hevc (Main) ([36][0][0][0] / 0x0024), yuv420p(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x166]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 64 kb/s
    Stream #0:2[0x167]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 96 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (libx265))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc @ 0x115e840] Could not find ref with POC 38
[hevc @ 0x115e840] Could not find ref with POC 40
x265 [info]: HEVC encoder version 3.3+19-1d2f556ffb12
x265 [info]: build info [Linux][GCC 8.3.1][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4.1 (Main tier)
x265 [info]: Thread pool 0 using 40 threads on numa nodes 0,1
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 5 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias  : 25 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : ABR-10000 kbps / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing lslices=6 deblock sao
Output #0, mpegts, to 'udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=2788760&localaddr=127.0.0.1&ttl=16&pkt_size=1316':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: hevc (libx265), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 10000 kb/s, 60 fps, 90k tbn, 60 tbc
    Metadata:
      encoder         : Lavc58.54.100 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/10000000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 64 kb/s
[mpegts @ 0x1146640] PES packet size mismatchme=00:00:45.91 bitrate=10715.9kbits/s speed=0.698x
[hevc @ 0x1596500] Could not find ref with POC 58
[hevc @ 0x1596500] Could not find ref with POC 60
[hevc @ 0x1596500] Could not find ref with POC 64
frame= 4121 fps= 44 q=-0.0 Lsize=   87641kB time=00:01:11.48 bitrate=10043.7kbits/s speed=0.764x

mediainfo (time scew comes where it sees 10 seconds dump as 6 seconds):

General
ID                                       : 1 (0x1)
Complete name                            : ns265.ts
Format                                   : MPEG-TS
File size                                : 8.39 MiB
Duration                                 : 6 s 100 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 11.4 Mb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L4.1@Main
Codec ID                                 : 36
Duration                                 : 6 s 183 ms
Bit rate                                 : 10.8 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 60.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.086
Stream size                              : 7.93 MiB (95%)
Writing library                          : x265 3.3+19-1d2f556ffb12:[Linux][GCC 8.3.1][64 bit] 8bit
Encoding settings                        : cpuid=1111039 / frame-threads=5 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=25 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=6 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=1 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / selective-sao=4 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=abr / bitrate=10000 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.01 / no-opt-cu-delta-qp / no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / no-scenecut-aware-qpconformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0
Color range                              : Limited

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 6 s 480 ms
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -393 ms
Stream size                              : 50.6 KiB (1%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 6 s 100 ms
List                                     : 256 (0x100) (HEVC) / 257 (0x101) (MPEG Audio)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television

If I put 30 fps instead of 60, libx265 manages produce stream without any problems. here is just for comparison:

General
ID                                       : 1 (0x1)
Complete name                            : ns265_2.ts
Format                                   : MPEG-TS
File size                                : 11.8 MiB
Duration                                 : 10 s 200 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 9 482 kb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L4@Main
Codec ID                                 : 36
Duration                                 : 10 s 333 ms
Bit rate                                 : 8 948 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.144
Stream size                              : 11.0 MiB (93%)
Writing library                          : x265 3.3+19-1d2f556ffb12:[Linux][GCC 8.3.1][64 bit] 8bit
Encoding settings                        : cpuid=1111039 / frame-threads=5 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1920x1080 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=25 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=6 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=1 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / selective-sao=4 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=abr / bitrate=10000 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.01 / no-opt-cu-delta-qp / no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / no-scenecut-aware-qpconformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0
Color range                              : Limited

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 10 s 80 ms
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -200 ms
Stream size                              : 78.8 KiB (1%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 10 s 200 ms
List                                     : 256 (0x100) (HEVC) / 257 (0x101) (MPEG Audio)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television

Just in case I also tested buffer size option, with 64MB. fifo_size is already 100 times higher than default, 2788760 is about 500MB (fifo_size is measured as multiples of 188 Byte packets):

#!/bin/bash

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=2788760&buffer_size=67108864" \
-c:v libsvt_hevc -s 1920x1080 -r 60 -g 60 -rc 1 -b:v 10000k \
-c:a copy \
-flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=2788760&buffer_size=67108864&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

I am still getting the same stream without playable video.

tianjunwork commented 4 years ago

Add the plugin owner @guojiansheng0925. Hi Jiansheng, to sum up, the ffmpeg plugin works if writes to local file but not udp destination. Could you take a look? Thank you. Hi @mikaelsson , Please expect a delay in responses since it is holiday for Jiansheng.

guojiansheng0925 commented 4 years ago

Hi @mikaelsson , I have tried to reproduce the issue with flowing steps: 1) first terminal: produce stream with FFmpeg on my local machine ffmpeg -re -i ../../content/oceans.mp4 -vcodec copy -f mpegts udp://127.0.0.1:1234 2) second terminal: ffmpeg -ignore_unknown -sn -c:v h264 -i "udp://127.0.0.1:1234" -c:v libsvt_hevc -s 960x400 -r 60 -g 60 -b:v 10000k -c:a copy -flush_packets 0 -f mpegts "udp://127.0.0.1:4321" 3) third terminal: play with FFplay ffplay -protocol_whitelist "file,udp,rtp" -i udp://127.0.0.1:4321

It can reproduce the no video issue, and second terminal always said

Too many packets buffered for output stream 0:1. Conversion failed!

And we can use the parameter - -max_muxing_queue_size 1024 to solve it. https://stackoverflow.com/questions/49686244/ffmpeg-too-many-packets-buffered-for-output-stream-01

I am not sure if we are in the same environment and could you please try the parameter -max_muxing_queue_size? Thank you.

mikaelsson commented 4 years ago

hi @guojiansheng0925 tried max_muxing_size

#!/bin/bash

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864" \
-c:v libsvt_hevc -s 1920x1080 -r 60 -g 60 -rc 1 -b:v 10000k \
-c:a copy \
-max_muxing_queue_size 1024 -flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

still the same result:

General
ID                                       : 1 (0x1)
Complete name                            : ns_muxing_size_1024.ts
Format                                   : MPEG-TS
File size                                : 12.9 MiB
Duration                                 : 9 s 900 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 10.9 Mb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Codec ID                                 : 36
Duration                                 : 9 s 916 ms
Bit rate                                 : 10.3 Mb/s
Stream size                              : 12.1 MiB (94%)

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 9 s 720 ms
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -2 s 750 ms
Stream size                              : 75.9 KiB (1%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 9 s 900 ms
List                                     : 256 (0x100) (HEVC) / 257 (0x101) (MPEG Audio)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television

I cannot ffplay it on the server itself as I only have ssh access, but I can ffprobe it. maybe this will help:

 ffprobe -i "udp://224.0.0.2:4321" -analyzeduration 10240000 -probesize 10240000  -show_format -show_streams -print_format json

results:

[mpegts @ 0x8caac0] decoding for stream 0 failed
[mpegts @ 0x8caac0] Could not find codec parameters for stream 0 (Video: hevc (HEVC / 0x43564548), none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'udp://224.0.0.2:4321':
  Duration: N/A, start: 84.436667, bitrate: N/A
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (HEVC / 0x43564548), none, 60 fps, 60 tbr, 90k tbn, 90k tbc
    Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 64 kb/s
    "streams": [
        {
            "index": 0,
            "codec_name": "hevc",
            "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
            "codec_type": "video",
            "codec_time_base": "1/60",
            "codec_tag_string": "HEVC",
            "codec_tag": "0x43564548",
            "width": 0,
            "height": 0,
            "coded_width": 0,
            "coded_height": 0,
            "has_b_frames": 0,
            "level": -99,
            "refs": 1,
            "id": "0x100",
            "r_frame_rate": "60/1",
            "avg_frame_rate": "60/1",
            "time_base": "1/90000",
            "start_pts": 7873500,
            "start_time": "87.483333",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            }
        },
        {
            "index": 1,
            "codec_name": "mp2",
            "codec_long_name": "MP2 (MPEG audio layer 2)",
            "codec_type": "audio",
            "codec_time_base": "1/48000",
            "codec_tag_string": "[3][0][0][0]",
            "codec_tag": "0x0003",
            "sample_fmt": "fltp",
            "sample_rate": "48000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "id": "0x101",
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 7599300,
            "start_time": "84.436667",
            "bit_rate": "64000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            }
        }
    ],
    "format": {
        "filename": "udp://224.0.0.2:4321",
        "nb_streams": 2,
        "nb_programs": 1,
        "format_name": "mpegts",
        "format_long_name": "MPEG-TS (MPEG-2 Transport Stream)",
        "start_time": "84.436667",
        "probe_score": 50
    }
}
guojiansheng0925 commented 4 years ago

Hi @mikaelsson , I am sorry I can't reproduce this issue on my local environment. Could you please have a try to use a local file to produce the stream via udp, like this: ffmpeg -re -i ../../content/oceans.mp4 -vcodec copy -f mpegts udp://127.0.0.1:1234 And then use your FFmpeg string to see if there is no video.

or

Could you tell me how is your input produced ( udp://@224.0.0.1:1234?overrun_...) May I use it or may I reproduce a similar stream?

Thank you.

mikaelsson commented 4 years ago

hi @guojiansheng0925 , the input is produced from the local file. I am streaming it in loop using tsplay from google's ts-tools. I am making dumps using multicat tool.

this is the source file's mediainfo:

$ mediainfo nasa_uhd.ts 
General
ID                                       : 4 (0x4)
Complete name                            : nasa_uhd.ts
Format                                   : MPEG-TS
File size                                : 1.88 GiB
Duration                                 : 14 min 59 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 18.0 Mb/s

Video
ID                                       : 357 (0x165)
Menu ID                                  : 4602 (0x11FA)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L5.1@High
Codec ID                                 : 36
Duration                                 : 14 min 59 s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 59.940 (60000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 358 (0x166)
Menu ID                                  : 4602 (0x11FA)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 14 min 59 s
Bit rate mode                            : Constant
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -2 s 423 ms
Stream size                              : 6.86 MiB (0%)

Audio #2
ID                                       : 359 (0x167)
Menu ID                                  : 4602 (0x11FA)
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Format version                           : Version 4
Muxing mode                              : ADTS
Codec ID                                 : 15-2
Duration                                 : 14 min 59 s
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -2 s 487 ms

Menu
ID                                       : 356 (0x164)
Menu ID                                  : 4602 (0x11FA)
List                                     : 357 (0x165) (HEVC) / 358 (0x166) (MPEG Audio) / 359 (0x167) (AAC)
Service name                             : Nasa TV UHD
Service type                             : digital television

and in vlc:

src_in_vlc

I tried your string

ffmpeg -re -i nasa_uhd.ts -vcodec copy -f mpegts "udp://127.0.0.1:1234"

the strange part is that if I make a dump of it mediainfo can't parse it and vlc can't play it. but ffmpeg can join it without a problem.

mediainfo of "udp://127.0.0.1:1234" 10 sec dump:

$ mediainfo ns_from_file.ts 
General
Complete name                            : ns_from_file.ts
File size                                : 17.9 MiB

part of vlc's log when I try to play it, vlc cant parse it:

vlc ns_from_file.ts 
VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
[000055fe5a8ed5b0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 8, expected 7) for PID 0
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 8, expected 7) for PID 4096
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 10, expected 9) for PID 0
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 13, expected 12) for PID 4096
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 15, expected 14) for PID 0
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 1, expected 0) for PID 4096
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 2, expected 1) for PID 0
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 4, expected 3) for PID 0
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 6, expected 5) for PID 4096
[00007f8c84001130] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 9, expected 8) for PID 4096

using this string:

#!/bin/bash

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://@127.0.0.1:1234?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864" \
-c:v libsvt_hevc -s 1920x1080 -r 60 -g 60 -rc 1 -b:v 10000k \
-c:a copy \
-max_muxing_queue_size 1024 -flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

the final result is the same as before. mediainfo:

$ mediainfo ns_from_net.ts 
General
ID                                       : 1 (0x1)
Complete name                            : ns_from_net.ts
Format                                   : MPEG-TS
File size                                : 3.26 MiB
Duration                                 : 9 s 700 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 2 810 kb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Codec ID                                 : 36
Duration                                 : 9 s 716 ms
Bit rate                                 : 2 283 kb/s
Stream size                              : 2.64 MiB (81%)

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Codec ID                                 : 3
Duration                                 : 9 s 696 ms
Bit rate mode                            : Constant
Bit rate                                 : 384 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -324 ms
Stream size                              : 454 KiB (14%)

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 9 s 700 ms
List                                     : 256 (0x100) (HEVC) / 257 (0x101) (MPEG Audio)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television

here is the final result in vlc, sound is plaing but not video: dst_in_vlc

guojiansheng0925 commented 4 years ago

Hi @mikaelsson ,

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://@127.0.0.1:1234?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864" \ -c:v libsvt_hevc -s 1920x1080 -r 60 -g 60 -rc 1 -b:v 10000k \ -c:a copy \ -max_muxing_queue_size 1024 -flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

Is there any warnings or errors when you execute the above FFmpeg string? Could you send me all the logs after execute it?

mikaelsson commented 4 years ago

hi @guojiansheng0925

with this as a src:

ffmpeg -re -i nasa_uhd.ts -vcodec copy -f mpegts "udp://127.0.0.1:1234"

and this as a command:

#!/bin/bash

FFREPORT=file=ffreport.log:level=32 ffmpeg -loglevel repeat+info -ignore_unknown -sn -c:v hevc -i "udp://@127.0.0.1:1234?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864" \
-c:v libsvt_hevc -s 1920x1080 -r 60 -g 60 -rc 1 -b:v 10000k \
-c:a copy \
-max_muxing_queue_size 1024 -flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

here is the logs of 2 runs of about 2 minutes. First is taken from a file generated by ffmpeg's report function. But for some reason it ommited svt-plugin's version part in log (probably has something to do with the fact that ffmpeg outputs to stderr and svt to stdout). Because of that I include the log of the next run too, but copied directly from the terminal window.

first log:

ffmpeg started on 2020-05-08 at 12:29:23
Report written to "ffreport.log"
Command line:
ffmpeg -loglevel repeat+info -ignore_unknown -sn -c:v hevc -i "udp://@127.0.0.1:1234?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864" -c:v libsvt_hevc -s 1920x1080 -r 60 -g 60 -rc 1 -b:v 10000k -c:a copy -max_muxing_queue_size 1024 -flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864&localaddr=127.0.0.1&ttl=16&pkt_size=1316"
ffmpeg version n4.2.2-7-gd5d4c3487c Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[udp @ 0x243d800] attempted to set receive buffer to size 67108864 but it only ended up set as 2621440[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] PPS id out of range: 1
[hevc @ 0x2452140] Error parsing NAL unit #3.
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] PPS id out of range: 0
[hevc @ 0x2452140] Error parsing NAL unit #3.
Input #0, mpegts, from 'udp://@127.0.0.1:1234?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864':
  Duration: N/A, start: 22.952000, bitrate: N/A
  Program 1 
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (libsvt_hevc))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc @ 0x24c4ec0] Could not find ref with POC 34
[hevc @ 0x24c4ec0] Could not find ref with POC 36
[hevc @ 0x24c4ec0] Could not find ref with POC 40
Output #0, mpegts, to 'udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864&localaddr=127.0.0.1&ttl=16&pkt_size=1316':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: hevc (libsvt_hevc), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=10-48, 10000 kb/s, 60 fps, 90k tbn, 60 tbc
    Metadata:
      encoder         : Lavc58.54.100 libsvt_hevc
    Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s
frame=    2 fps=0.0 q=0.0 size=       0kB time=00:00:00.31 bitrate=   0.0kbits/s speed=0.313x    
frame=   58 fps= 39 q=0.0 size=       0kB time=00:00:01.27 bitrate=   0.0kbits/s speed=0.847x    
frame=  113 fps= 56 q=-0.0 size=     509kB time=00:00:02.18 bitrate=1908.9kbits/s speed=1.09x    
frame=  165 fps= 66 q=-0.0 size=    1474kB time=00:00:03.04 bitrate=3961.8kbits/s speed=1.21x    
frame=  215 fps= 71 q=-0.0 size=    2829kB time=00:00:03.88 bitrate=5959.9kbits/s speed=1.29x    
frame=  266 fps= 76 q=-0.0 size=    4023kB time=00:00:04.72 bitrate=6969.7kbits/s speed=1.34x    
frame=  317 fps= 79 q=-0.0 size=    5175kB time=00:00:05.59 bitrate=7581.6kbits/s speed=1.39x    
frame=  369 fps= 82 q=-0.0 size=    6205kB time=00:00:06.45 bitrate=7873.2kbits/s speed=1.43x    
frame=  419 fps= 83 q=-0.0 size=    7365kB time=00:00:07.29 bitrate=8269.7kbits/s speed=1.45x    
frame=  465 fps= 83 q=-0.0 size=    8661kB time=00:00:08.04 bitrate=8824.4kbits/s speed=1.44x    
frame=  508 fps= 82 q=-0.0 size=    9600kB time=00:00:08.78 bitrate=8953.1kbits/s speed=1.42x    
frame=  543 fps= 81 q=-0.0 size=   10295kB time=00:00:09.36 bitrate=9010.7kbits/s speed= 1.4x    
frame=  568 fps= 79 q=-0.0 size=   10925kB time=00:00:09.79 bitrate=9140.0kbits/s speed=1.36x    
frame=  603 fps= 78 q=-0.0 size=   11727kB time=00:00:10.36 bitrate=9265.8kbits/s speed=1.34x    
frame=  638 fps= 77 q=-0.0 size=   12665kB time=00:00:10.92 bitrate=9501.2kbits/s speed=1.33x    
frame=  672 fps= 75 q=-0.0 size=   13354kB time=00:00:11.52 bitrate=9496.2kbits/s speed=1.29x    
frame=  707 fps= 74 q=-0.0 size=   14137kB time=00:00:12.07 bitrate=9593.1kbits/s speed=1.26x    
frame=  741 fps= 74 q=-0.0 size=   14908kB time=00:00:12.64 bitrate=9655.7kbits/s speed=1.25x    
frame=  773 fps= 73 q=-0.0 size=   15766kB time=00:00:13.20 bitrate=9784.7kbits/s speed=1.25x    
frame=  802 fps= 71 q=-0.0 size=   16307kB time=00:00:13.65 bitrate=9782.5kbits/s speed=1.21x    
frame=  835 fps= 71 q=-0.0 size=   17033kB time=00:00:14.23 bitrate=9804.5kbits/s speed=1.21x    
frame=  873 fps= 71 q=-0.0 size=   17956kB time=00:00:14.88 bitrate=9885.6kbits/s speed=1.21x    
frame=  905 fps= 70 q=-0.0 size=   18649kB time=00:00:15.40 bitrate=9915.1kbits/s speed=1.19x    
frame=  940 fps= 70 q=-0.0 size=   19455kB time=00:00:15.96 bitrate=9985.8kbits/s speed=1.18x    
frame=  976 fps= 70 q=-0.0 size=   20263kB time=00:00:16.58 bitrate=10009.3kbits/s speed=1.19x    
frame= 1017 fps= 70 q=-0.0 size=   21061kB time=00:00:17.28 bitrate=9984.5kbits/s speed=1.18x    
frame= 1043 fps= 69 q=-0.0 size=   21573kB time=00:00:17.71 bitrate=9977.6kbits/s speed=1.17x    
frame= 1078 fps= 69 q=-0.0 size=   22522kB time=00:00:18.26 bitrate=10102.0kbits/s speed=1.16x    
frame= 1115 fps= 69 q=-0.0 size=   23531kB time=00:00:18.91 bitrate=10192.9kbits/s speed=1.17x    
frame= 1147 fps= 68 q=-0.0 size=   24210kB time=00:00:19.41 bitrate=10214.6kbits/s speed=1.16x    
frame= 1173 fps= 68 q=-0.0 size=   24848kB time=00:00:19.84 bitrate=10255.9kbits/s speed=1.15x    
frame= 1207 fps= 68 q=-0.0 size=   25545kB time=00:00:20.44 bitrate=10234.0kbits/s speed=1.15x    
frame= 1250 fps= 68 q=-0.0 size=   26610kB time=00:00:21.16 bitrate=10298.2kbits/s speed=1.15x    
frame= 1276 fps= 67 q=-0.0 size=   27150kB time=00:00:21.60 bitrate=10297.0kbits/s speed=1.14x    
frame= 1302 fps= 67 q=-0.0 size=   27730kB time=00:00:22.03 bitrate=10310.6kbits/s speed=1.13x    
frame= 1337 fps= 67 q=-0.0 size=   28569kB time=00:00:22.58 bitrate=10363.0kbits/s speed=1.13x    
frame= 1377 fps= 67 q=-0.0 size=   29489kB time=00:00:23.25 bitrate=10387.7kbits/s speed=1.13x    
frame= 1403 fps= 67 q=-0.0 size=   30023kB time=00:00:23.68 bitrate=10382.7kbits/s speed=1.13x    
frame= 1431 fps= 66 q=-0.0 size=   30652kB time=00:00:24.16 bitrate=10389.9kbits/s speed=1.12x    
frame= 1462 fps= 66 q=-0.0 size=   31404kB time=00:00:24.69 bitrate=10417.2kbits/s speed=1.12x    
frame= 1492 fps= 66 q=-0.0 size=   32234kB time=00:00:25.20 bitrate=10478.7kbits/s speed=1.12x    
frame= 1518 fps= 66 q=-0.0 size=   32798kB time=00:00:25.60 bitrate=10492.2kbits/s speed=1.11x    
frame= 1544 fps= 65 q=-0.0 size=   33394kB time=00:00:26.04 bitrate=10505.4kbits/s speed= 1.1x    
frame= 1587 fps= 66 q=-0.0 size=   34364kB time=00:00:26.78 bitrate=10510.3kbits/s speed=1.11x    
frame= 1622 fps= 66 q=-0.0 size=   35220kB time=00:00:27.33 bitrate=10554.6kbits/s speed=1.11x    
frame= 1647 fps= 65 q=-0.0 size=   35753kB time=00:00:27.79 bitrate=10538.6kbits/s speed= 1.1x    
frame= 1682 fps= 65 q=-0.0 size=   36603kB time=00:00:28.34 bitrate=10578.9kbits/s speed= 1.1x    
frame= 1718 fps= 65 q=-0.0 size=   37565kB time=00:00:28.96 bitrate=10623.2kbits/s speed= 1.1x    
frame= 1750 fps= 65 q=-0.0 size=   38293kB time=00:00:29.49 bitrate=10635.1kbits/s speed= 1.1x    
frame= 1776 fps= 65 q=-0.0 size=   38925kB time=00:00:29.92 bitrate=10654.6kbits/s speed= 1.1x    
frame= 1803 fps= 65 q=-0.0 size=   39474kB time=00:00:30.36 bitrate=10651.1kbits/s speed=1.09x    
frame= 1840 fps= 65 q=-0.0 size=   40205kB time=00:00:30.98 bitrate=10629.9kbits/s speed=1.09x    
frame= 1872 fps= 65 q=-0.0 size=   40770kB time=00:00:31.51 bitrate=10598.8kbits/s speed=1.09x    
frame= 1906 fps= 65 q=-0.0 size=   41408kB time=00:00:32.11 bitrate=10563.4kbits/s speed=1.09x    
frame= 1941 fps= 65 q=-0.0 size=   42035kB time=00:00:32.66 bitrate=10542.2kbits/s speed=1.09x    
frame= 1975 fps= 65 q=-0.0 size=   42639kB time=00:00:33.26 bitrate=10500.8kbits/s speed=1.09x    
frame= 2004 fps= 65 q=-0.0 size=   43136kB time=00:00:33.74 bitrate=10472.2kbits/s speed=1.09x    
frame= 2036 fps= 64 q=-0.0 size=   43815kB time=00:00:34.24 bitrate=10480.4kbits/s speed=1.08x    
frame= 2070 fps= 64 q=-0.0 size=   44596kB time=00:00:34.84 bitrate=10483.6kbits/s speed=1.08x    
frame= 2105 fps= 64 q=-0.0 size=   45345kB time=00:00:35.42 bitrate=10486.4kbits/s speed=1.08x    
frame= 2131 fps= 64 q=-0.0 size=   46032kB time=00:00:35.83 bitrate=10523.9kbits/s speed=1.08x    
frame= 2160 fps= 64 q=-0.0 size=   46740kB time=00:00:36.33 bitrate=10537.6kbits/s speed=1.08x    
frame= 2194 fps= 64 q=-0.0 size=   47565kB time=00:00:36.91 bitrate=10556.2kbits/s speed=1.08x    
frame= 2229 fps= 64 q=-0.0 size=   48490kB time=00:00:37.48 bitrate=10596.2kbits/s speed=1.08x    
frame= 2254 fps= 64 q=-0.0 size=   49006kB time=00:00:37.89 bitrate=10593.6kbits/s speed=1.08x    
frame= 2283 fps= 64 q=-0.0 size=   49768kB time=00:00:38.40 bitrate=10617.1kbits/s speed=1.07x    
frame= 2317 fps= 64 q=-0.0 size=   50608kB time=00:00:38.95 bitrate=10643.4kbits/s speed=1.07x    
frame= 2347 fps= 64 q=-0.0 size=   51161kB time=00:00:39.45 bitrate=10622.2kbits/s speed=1.07x    
frame= 2377 fps= 64 q=-0.0 size=   51928kB time=00:00:39.96 bitrate=10645.5kbits/s speed=1.07x    
frame= 2407 fps= 64 q=-0.0 size=   52527kB time=00:00:40.46 bitrate=10634.2kbits/s speed=1.07x    
frame= 2447 fps= 64 q=-0.0 size=   53540kB time=00:00:41.13 bitrate=10662.1kbits/s speed=1.07x    
frame= 2476 fps= 64 q=-0.0 size=   54191kB time=00:00:41.61 bitrate=10667.4kbits/s speed=1.07x    
frame= 2511 fps= 64 q=-0.0 size=   54928kB time=00:00:42.16 bitrate=10670.8kbits/s speed=1.07x    
frame= 2536 fps= 63 q=-0.0 size=   55591kB time=00:00:42.62 bitrate=10684.1kbits/s speed=1.07x    
frame= 2574 fps= 64 q=-0.0 size=   56483kB time=00:00:43.22 bitrate=10704.8kbits/s speed=1.07x    
frame= 2602 fps= 63 q=-0.0 size=   57088kB time=00:00:43.70 bitrate=10700.7kbits/s speed=1.07x    
frame= 2628 fps= 63 q=-0.0 size=   57653kB time=00:00:44.13 bitrate=10700.9kbits/s speed=1.06x    
frame= 2659 fps= 63 q=-0.0 size=   58399kB time=00:00:44.66 bitrate=10711.2kbits/s speed=1.06x    
frame= 2695 fps= 63 q=-0.0 size=   59220kB time=00:00:45.24 bitrate=10723.5kbits/s speed=1.06x    
frame= 2726 fps= 63 q=-0.0 size=   59860kB time=00:00:45.76 bitrate=10714.3kbits/s speed=1.06x    
frame= 2751 fps= 63 q=-0.0 size=   60432kB time=00:00:46.20 bitrate=10715.5kbits/s speed=1.06x    
frame= 2781 fps= 63 q=-0.0 size=   61197kB time=00:00:46.68 bitrate=10739.6kbits/s speed=1.06x    
frame= 2818 fps= 63 q=-0.0 size=   62008kB time=00:00:47.30 bitrate=10738.3kbits/s speed=1.06x    
frame= 2846 fps= 63 q=-0.0 size=   62628kB time=00:00:47.78 bitrate=10736.9kbits/s speed=1.06x    
frame= 2873 fps= 63 q=-0.0 size=   63298kB time=00:00:48.21 bitrate=10754.4kbits/s speed=1.06x    
frame= 2908 fps= 63 q=-0.0 size=   64168kB time=00:00:48.79 bitrate=10773.5kbits/s speed=1.06x    
frame= 2942 fps= 63 q=-0.0 size=   64895kB time=00:00:49.39 bitrate=10763.3kbits/s speed=1.06x    
frame= 2971 fps= 63 q=-0.0 size=   65582kB time=00:00:49.87 bitrate=10772.5kbits/s speed=1.06x    
frame= 3003 fps= 63 q=-0.0 size=   66290kB time=00:00:50.37 bitrate=10779.8kbits/s speed=1.05x    
frame= 3037 fps= 63 q=-0.0 size=   67137kB time=00:00:50.97 bitrate=10789.1kbits/s speed=1.06x    
frame= 3072 fps= 63 q=-0.0 size=   67846kB time=00:00:51.52 bitrate=10786.3kbits/s speed=1.05x    
frame= 3097 fps= 63 q=-0.0 size=   68423kB time=00:00:51.98 bitrate=10782.6kbits/s speed=1.05x    
frame= 3132 fps= 63 q=-0.0 size=   69234kB time=00:00:52.56 bitrate=10790.8kbits/s speed=1.05x    
frame= 3171 fps= 63 q=-0.0 size=   70065kB time=00:00:53.20 bitrate=10787.4kbits/s speed=1.06x    
frame= 3198 fps= 63 q=-0.0 size=   70783kB time=00:00:53.66 bitrate=10805.2kbits/s speed=1.05x    
frame= 3224 fps= 63 q=-0.0 size=   71342kB time=00:00:54.09 bitrate=10803.6kbits/s speed=1.05x    
frame= 3253 fps= 63 q=-0.0 size=   72009kB time=00:00:54.57 bitrate=10808.7kbits/s speed=1.05x    
frame= 3287 fps= 63 q=-0.0 size=   72832kB time=00:00:55.15 bitrate=10818.2kbits/s speed=1.05x    
frame= 3313 fps= 63 q=-0.0 size=   73355kB time=00:00:55.58 bitrate=10811.2kbits/s speed=1.05x    
frame= 3348 fps= 63 q=-0.0 size=   74159kB time=00:00:56.13 bitrate=10822.1kbits/s speed=1.05x    
frame= 3382 fps= 63 q=-0.0 size=   75002kB time=00:00:56.73 bitrate=10829.4kbits/s speed=1.05x    
frame= 3417 fps= 63 q=-0.0 size=   75793kB time=00:00:57.28 bitrate=10838.2kbits/s speed=1.05x    
frame= 3445 fps= 63 q=-0.0 size=   76359kB time=00:00:57.76 bitrate=10828.3kbits/s speed=1.05x    
frame= 3476 fps= 63 q=-0.0 size=   77117kB time=00:00:58.29 bitrate=10836.8kbits/s speed=1.05x    
frame= 3506 fps= 63 q=-0.0 size=   77800kB time=00:00:58.80 bitrate=10839.0kbits/s speed=1.05x    
frame= 3538 fps= 62 q=-0.0 size=   78553kB time=00:00:59.30 bitrate=10850.9kbits/s speed=1.05x    
frame= 3571 fps= 62 q=-0.0 size=   79347kB time=00:00:59.88 bitrate=10855.2kbits/s speed=1.05x    
frame= 3598 fps= 62 q=-0.0 size=   79889kB time=00:01:00.33 bitrate=10846.8kbits/s speed=1.05x    
frame= 3633 fps= 62 q=-0.0 size=   80814kB time=00:01:00.88 bitrate=10873.0kbits/s speed=1.04x    
frame= 3667 fps= 62 q=-0.0 size=   81479kB time=00:01:01.48 bitrate=10855.4kbits/s speed=1.05x    
frame= 3696 fps= 62 q=-0.0 size=   82193kB time=00:01:01.96 bitrate=10865.7kbits/s speed=1.04x    
frame= 3728 fps= 62 q=-0.0 size=   82881kB time=00:01:02.47 bitrate=10868.2kbits/s speed=1.04x    
frame= 3771 fps= 62 q=-0.0 size=   83831kB time=00:01:03.19 bitrate=10867.5kbits/s speed=1.05x    
frame= 3797 fps= 62 q=-0.0 size=   84482kB time=00:01:03.62 bitrate=10877.6kbits/s speed=1.04x    
frame= 3831 fps= 62 q=-0.0 size=   85160kB time=00:01:04.22 bitrate=10862.4kbits/s speed=1.04x    
frame= 3866 fps= 62 q=-0.0 size=   85960kB time=00:01:04.77 bitrate=10871.1kbits/s speed=1.04x    
frame= 3900 fps= 62 q=-0.0 size=   86798kB time=00:01:05.37 bitrate=10876.3kbits/s speed=1.04x    
frame= 3929 fps= 62 q=-0.0 size=   87510kB time=00:01:05.83 bitrate=10889.6kbits/s speed=1.04x    
frame= 3961 fps= 62 q=-0.0 size=   88229kB time=00:01:06.36 bitrate=10891.6kbits/s speed=1.04x    
frame= 3995 fps= 62 q=-0.0 size=   88921kB time=00:01:06.96 bitrate=10878.8kbits/s speed=1.04x    
frame= 4029 fps= 62 q=-0.0 size=   89816kB time=00:01:07.51 bitrate=10898.4kbits/s speed=1.04x    
frame= 4056 fps= 62 q=-0.0 size=   90362kB time=00:01:07.94 bitrate=10894.9kbits/s speed=1.04x    
frame= 4090 fps= 62 q=-0.0 size=   91125kB time=00:01:08.54 bitrate=10890.8kbits/s speed=1.04x    
frame= 4132 fps= 62 q=-0.0 size=   92062kB time=00:01:09.24 bitrate=10892.2kbits/s speed=1.04x    
frame= 4159 fps= 62 q=-0.0 size=   92640kB time=00:01:09.67 bitrate=10892.6kbits/s speed=1.04x    
frame= 4185 fps= 62 q=-0.0 size=   93202kB time=00:01:10.12 bitrate=10887.4kbits/s speed=1.04x    
frame= 4220 fps= 62 q=-0.0 size=   93905kB time=00:01:10.68 bitrate=10883.8kbits/s speed=1.04x    
frame= 4260 fps= 62 q=-0.0 size=   94771kB time=00:01:11.35 bitrate=10880.8kbits/s speed=1.04x    
frame= 4281 fps= 62 q=-0.0 size=   95202kB time=00:01:11.76 bitrate=10868.1kbits/s speed=1.04x    
frame= 4313 fps= 62 q=-0.0 size=   95924kB time=00:01:12.24 bitrate=10877.8kbits/s speed=1.04x    
frame= 4344 fps= 62 q=-0.0 size=   96526kB time=00:01:12.76 bitrate=10866.5kbits/s speed=1.04x    
frame= 4381 fps= 62 q=-0.0 size=   97525kB time=00:01:13.39 bitrate=10885.8kbits/s speed=1.04x    
[hevc @ 0x24c43c0] Could not find ref with POC 24
frame= 4407 fps= 62 q=-0.0 size=   98100kB time=00:01:13.87 bitrate=10878.7kbits/s speed=1.04x    
frame= 4442 fps= 62 q=-0.0 size=   99003kB time=00:01:14.44 bitrate=10894.0kbits/s speed=1.04x    
frame= 4476 fps= 62 q=-0.0 size=   99719kB time=00:01:15.02 bitrate=10888.5kbits/s speed=1.04x    
frame= 4509 fps= 62 q=-0.0 size=  100314kB time=00:01:15.57 bitrate=10873.5kbits/s speed=1.04x    
frame= 4534 fps= 62 q=-0.0 size=  101150kB time=00:01:16.00 bitrate=10901.7kbits/s speed=1.04x    
frame= 4563 fps= 62 q=-0.0 size=  102185kB time=00:01:16.46 bitrate=10947.7kbits/s speed=1.04x    
frame= 4595 fps= 62 q=-0.0 size=  103109kB time=00:01:16.99 bitrate=10970.9kbits/s speed=1.04x    
frame= 4629 fps= 62 q=-0.0 size=  103923kB time=00:01:17.59 bitrate=10972.0kbits/s speed=1.04x    
frame= 4657 fps= 62 q=-0.0 size=  104527kB time=00:01:18.04 bitrate=10971.3kbits/s speed=1.04x    
frame= 4687 fps= 62 q=-0.0 size=  105083kB time=00:01:18.55 bitrate=10958.9kbits/s speed=1.03x    
frame= 4726 fps= 62 q=-0.0 size=  106068kB time=00:01:19.20 bitrate=10971.1kbits/s speed=1.04x    
frame= 4752 fps= 62 q=-0.0 size=  106599kB time=00:01:19.63 bitrate=10966.1kbits/s speed=1.03x    
frame= 4787 fps= 62 q=-0.0 size=  107413kB time=00:01:20.20 bitrate=10970.6kbits/s speed=1.03x    
frame= 4821 fps= 62 q=-0.0 size=  108197kB time=00:01:20.78 bitrate=10971.9kbits/s speed=1.03x    
frame= 4859 fps= 62 q=-0.0 size=  109011kB time=00:01:21.40 bitrate=10969.6kbits/s speed=1.03x    
frame= 4890 fps= 62 q=-0.0 size=  109860kB time=00:01:21.93 bitrate=10983.9kbits/s speed=1.03x    
frame= 4925 fps= 62 q=-0.0 size=  110565kB time=00:01:22.51 bitrate=10977.1kbits/s speed=1.03x    
frame= 4957 fps= 62 q=-0.0 size=  111408kB time=00:01:23.04 bitrate=10990.5kbits/s speed=1.03x    
frame= 4992 fps= 62 q=-0.0 size=  112150kB time=00:01:23.61 bitrate=10987.6kbits/s speed=1.03x    
frame= 5018 fps= 62 q=-0.0 size=  112820kB time=00:01:24.04 bitrate=10996.4kbits/s speed=1.03x    
frame= 5049 fps= 62 q=-0.0 size=  113567kB time=00:01:24.60 bitrate=10996.9kbits/s speed=1.03x    
frame= 5083 fps= 62 q=-0.0 size=  114328kB time=00:01:25.15 bitrate=10998.8kbits/s speed=1.03x    
frame= 5115 fps= 62 q=-0.0 size=  115051kB time=00:01:25.68 bitrate=11000.2kbits/s speed=1.03x    
frame= 5149 fps= 62 q=-0.0 size=  115912kB time=00:01:26.25 bitrate=11008.5kbits/s speed=1.03x    
frame= 5179 fps= 62 q=-0.0 size=  116607kB time=00:01:26.76 bitrate=11010.2kbits/s speed=1.03x    
frame= 5218 fps= 62 q=-0.0 size=  117495kB time=00:01:27.40 bitrate=11011.8kbits/s speed=1.03x    
frame= 5244 fps= 62 q=-0.0 size=  118056kB time=00:01:27.84 bitrate=11009.9kbits/s speed=1.03x    
frame= 5279 fps= 62 q=-0.0 size=  118880kB time=00:01:28.41 bitrate=11014.5kbits/s speed=1.03x    
frame= 5313 fps= 62 q=-0.0 size=  119738kB time=00:01:28.99 bitrate=11022.3kbits/s speed=1.03x    
frame= 5348 fps= 62 q=-0.0 size=  120549kB time=00:01:29.56 bitrate=11025.6kbits/s speed=1.03x    
frame= 5382 fps= 62 q=-0.0 size=  121359kB time=00:01:30.14 bitrate=11028.7kbits/s speed=1.03x    
frame= 5412 fps= 62 q=-0.0 size=  122022kB time=00:01:30.62 bitrate=11030.2kbits/s speed=1.03x    
frame= 5444 fps= 62 q=-0.0 size=  122860kB time=00:01:31.15 bitrate=11041.6kbits/s speed=1.03x    
frame= 5477 fps= 62 q=-0.0 size=  123628kB time=00:01:31.72 bitrate=11040.9kbits/s speed=1.03x    
frame= 5507 fps= 62 q=-0.0 size=  124320kB time=00:01:32.20 bitrate=11044.9kbits/s speed=1.03x    
frame= 5538 fps= 62 q=-0.0 size=  125047kB time=00:01:32.73 bitrate=11046.2kbits/s speed=1.03x    
frame= 5572 fps= 62 q=-0.0 size=  125873kB time=00:01:33.31 bitrate=11050.6kbits/s speed=1.03x    
frame= 5607 fps= 62 q=-0.0 size=  126653kB time=00:01:33.88 bitrate=11050.9kbits/s speed=1.03x    
frame= 5639 fps= 62 q=-0.0 size=  127306kB time=00:01:34.41 bitrate=11045.7kbits/s speed=1.03x    
frame= 5667 fps= 62 q=-0.0 size=  128013kB time=00:01:34.89 bitrate=11050.9kbits/s speed=1.03x    
frame= 5703 fps= 62 q=-0.0 size=  128890kB time=00:01:35.49 bitrate=11056.6kbits/s speed=1.03x    
frame= 5733 fps= 62 q=-0.0 size=  129598kB time=00:01:36.00 bitrate=11059.0kbits/s speed=1.03x    
frame= 5757 fps= 62 q=-0.0 size=  130098kB time=00:01:36.40 bitrate=11054.7kbits/s speed=1.03x    
frame= 5789 fps= 62 q=-0.0 size=  130941kB time=00:01:36.91 bitrate=11068.5kbits/s speed=1.03x    
frame= 5826 fps= 62 q=-0.0 size=  131686kB time=00:01:37.53 bitrate=11060.3kbits/s speed=1.03x    
frame= 5854 fps= 62 q=-0.0 size=  132401kB time=00:01:38.01 bitrate=11065.8kbits/s speed=1.03x    
frame= 5880 fps= 62 q=-0.0 size=  132961kB time=00:01:38.44 bitrate=11063.9kbits/s speed=1.03x    
frame= 5910 fps= 62 q=-0.0 size=  133717kB time=00:01:38.95 bitrate=11070.1kbits/s speed=1.03x    
frame= 5950 fps= 62 q=-0.0 size=  134593kB time=00:01:39.62 bitrate=11067.5kbits/s speed=1.03x    
frame= 5978 fps= 62 q=-0.0 size=  135277kB time=00:01:40.08 bitrate=11073.0kbits/s speed=1.03x    
frame= 6008 fps= 62 q=-0.0 size=  135896kB time=00:01:40.56 bitrate=11070.6kbits/s speed=1.03x    
frame= 6038 fps= 62 q=-0.0 size=  136685kB time=00:01:41.08 bitrate=11076.7kbits/s speed=1.03x    
frame= 6074 fps= 62 q=-0.0 size=  137396kB time=00:01:41.68 bitrate=11068.6kbits/s speed=1.03x    
frame= 6105 fps= 62 q=-0.0 size=  138197kB time=00:01:42.21 bitrate=11075.6kbits/s speed=1.03x    
frame= 6133 fps= 62 q=-0.0 size=  138776kB time=00:01:42.67 bitrate=11072.7kbits/s speed=1.03x    
frame= 6168 fps= 62 q=-0.0 size=  139610kB time=00:01:43.24 bitrate=11077.1kbits/s speed=1.03x    
frame= 6203 fps= 62 q=-0.0 size=  140315kB time=00:01:43.84 bitrate=11068.7kbits/s speed=1.03x    
frame= 6235 fps= 62 q=-0.0 size=  141135kB time=00:01:44.37 bitrate=11077.0kbits/s speed=1.03x    
frame= 6264 fps= 62 q=-0.0 size=  141660kB time=00:01:44.83 bitrate=11069.9kbits/s speed=1.03x    
frame= 6297 fps= 62 q=-0.0 size=  142546kB time=00:01:45.40 bitrate=11078.2kbits/s speed=1.03x    
frame= 6333 fps= 62 q=-0.0 size=  143363kB time=00:01:46.00 bitrate=11078.7kbits/s speed=1.03x    
frame= 6359 fps= 62 q=-0.0 size=  143839kB time=00:01:46.44 bitrate=11070.3kbits/s speed=1.03x    
frame= 6392 fps= 62 q=-0.0 size=  144661kB time=00:01:46.99 bitrate=11076.2kbits/s speed=1.03x    
frame= 6427 fps= 62 q=-0.0 size=  145391kB time=00:01:47.56 bitrate=11072.5kbits/s speed=1.03x    
frame= 6461 fps= 62 q=-0.0 size=  146220kB time=00:01:48.14 bitrate=11076.3kbits/s speed=1.03x    
frame= 6493 fps= 62 q=-0.0 size=  146925kB time=00:01:48.67 bitrate=11075.7kbits/s speed=1.03x    
frame= 6525 fps= 62 q=-0.0 size=  147739kB time=00:01:49.20 bitrate=11083.1kbits/s speed=1.03x    
frame= 6560 fps= 62 q=-0.0 size=  148421kB time=00:01:49.77 bitrate=11075.9kbits/s speed=1.03x    
frame= 6588 fps= 62 q=-0.0 size=  149072kB time=00:01:50.25 bitrate=11076.0kbits/s speed=1.03x    
frame= 6618 fps= 62 q=-0.0 size=  149818kB time=00:01:50.73 bitrate=11083.2kbits/s speed=1.03x    
frame= 6651 fps= 62 q=-0.0 size=  150564kB time=00:01:51.31 bitrate=11080.7kbits/s speed=1.03x    
frame= 6689 fps= 62 q=-0.0 size=  151485kB time=00:01:51.96 bitrate=11084.0kbits/s speed=1.03x    
frame= 6718 fps= 62 q=-0.0 size=  152046kB time=00:01:52.44 bitrate=11077.5kbits/s speed=1.03x    
frame= 6750 fps= 62 q=-0.0 size=  152862kB time=00:01:52.94 bitrate=11087.3kbits/s speed=1.03x    
frame= 6781 fps= 62 q=-0.0 size=  153562kB time=00:01:53.47 bitrate=11086.3kbits/s speed=1.03x    
frame= 6822 fps= 62 q=-0.0 size=  154482kB time=00:01:54.14 bitrate=11087.0kbits/s speed=1.03x    
frame= 6844 fps= 62 q=-0.0 size=  154983kB time=00:01:54.52 bitrate=11085.7kbits/s speed=1.03x    
frame= 6876 fps= 62 q=-0.0 size=  155830kB time=00:01:55.05 bitrate=11095.1kbits/s speed=1.03x    
frame= 6902 fps= 62 q=-0.0 size=  156440kB time=00:01:55.51 bitrate=11094.5kbits/s speed=1.03x    
frame= 6936 fps= 62 q=-0.0 size=  157181kB time=00:01:56.06 bitrate=11094.1kbits/s speed=1.03x    
frame= 6962 fps= 62 q=-0.0 size=  157763kB time=00:01:56.49 bitrate=11093.9kbits/s speed=1.03x    
frame= 6988 fps= 61 q=-0.0 size=  158411kB time=00:01:56.92 bitrate=11098.3kbits/s speed=1.03x    
frame= 7014 fps= 61 q=-0.0 size=  159047kB time=00:01:57.36 bitrate=11101.9kbits/s speed=1.03x    
frame= 7048 fps= 61 q=-0.0 size=  159803kB time=00:01:57.93 bitrate=11100.1kbits/s speed=1.03x    
frame= 7077 fps= 61 q=-0.0 size=  160394kB time=00:01:58.41 bitrate=11096.0kbits/s speed=1.03x    
frame= 7106 fps= 61 q=-0.0 size=  160995kB time=00:01:58.89 bitrate=11092.7kbits/s speed=1.03x    
frame= 7135 fps= 61 q=-0.0 size=  161796kB time=00:01:59.40 bitrate=11100.8kbits/s speed=1.03x    
frame= 7160 fps= 61 q=-0.0 size=  162279kB time=00:01:59.80 bitrate=11096.0kbits/s speed=1.02x    
frame= 7186 fps= 61 q=-0.0 size=  162941kB time=00:02:00.24 bitrate=11101.2kbits/s speed=1.02x    
frame= 7214 fps= 61 q=-0.0 Lsize=  165329kB time=00:02:00.72 bitrate=11219.1kbits/s speed=1.02x    
video:146647kB audio:5656kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.551981%

second log:

ffmpeg started on 2020-05-08 at 12:43:06
Report written to "ffreport.log"
ffmpeg version n4.2.2-7-gd5d4c3487c Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[udp @ 0x913800] attempted to set receive buffer to size 67108864 but it only ended up set as 2621440PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] PPS id out of range: 1
[hevc @ 0x928140] Error parsing NAL unit #3.
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] PPS id out of range: 0
[hevc @ 0x928140] Error parsing NAL unit #3.
Input #0, mpegts, from 'udp://@127.0.0.1:1234?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864':
  Duration: N/A, start: 11.288000, bitrate: N/A
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (libsvt_hevc))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc @ 0x9d1ac0] Could not find ref with POC 56
[hevc @ 0x9d1ac0] Could not find ref with POC 64
SVT [version]:  SVT-HEVC Encoder Lib v1.4.3
SVT [build]  :  GCC 8.3.1 20190507 (Red Hat 8.3.1-4)     64 bit
LIB Build date: Apr 29 2020 12:23:10
-------------------------------------------
Number of logical cores available: 40
Number of PPCS 149
-------------------------------------------
SVT [config]: Main Profile      Tier (auto)     Level (auto)
SVT [config]: EncoderMode / Tune                                                        : 7 / 1
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat             : 8 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo                              : 1920 / 1080 / 0
SVT [config]: Fps_Numerator / Fps_Denominator / Gop Size / IntraRefreshType             : 60 / 1 / 60 / -1
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure                  : 3 / 0 / 2
SVT [config]: RCMode / TargetBitrate / LAD / SceneChange / QP Range [10 ~ 48]           : VBR / 10000000 / 59 / 1
SVT [config]: BitRateReduction / ImproveSharpness                                       : 0 / 0
SVT [config]: tileColumnCount / tileRowCount / tileSliceMode / Constraint MV            : 1 / 1 / 0 / 0
SVT [config]: De-blocking Filter / SAO Filter                                           : 1 / 1
SVT [config]: HME / UseDefaultHME                                                       : 1 / 1
SVT [config]: MV Search Area Width / Height                                             : 16 / 7
SVT [config]: HRD / VBV MaxRate / BufSize / BufInit                                     : 0 / 0 / 0 / 90
-------------------------------------------
Output #0, mpegts, to 'udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=27887600&buffer_size=67108864&localaddr=127.0.0.1&ttl=16&pkt_size=1316':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: hevc (libsvt_hevc), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=10-48, 10000 kb/s, 60 fps, 90k tbn, 60 tbc
    Metadata:
      encoder         : Lavc58.54.100 libsvt_hevc
    Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 384 kb/s
[hevc @ 0xd24140] Could not find ref with POC 2400:01:25.24 bitrate=10944.6kbits/s speed=1.03x
frame= 7202 fps= 61 q=-0.0 Lsize=  165181kB time=00:02:00.52 bitrate=11227.0kbits/s speed=1.02x
video:146515kB audio:5648kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.555688%
Press any key to continue...
guojiansheng0925 commented 4 years ago

Hi @mikaelsson , I am sorry I still can not reproduce the issue. I suggest we should sync the environment for the further analysis. Simplify the environment as much as possible. Prepare a yuv file and FFmpeg on your own computer to remove the influence of other potential issues. Could you please do as the following step strictly?

Step 0: build the FFmpeg with the configuration --enable-gpl --enable-libsvthevc --enable-libx265 Step 1: Generate the ts file from the yuv (I tried with cars.yuv, repeated command cat cars.yuv>>cars_long.yuv to make it more than 1000 frames). ffmpeg -s 1280x720 -i cars_long.yuv -c:v libx265 cars265.ts Step2: ffmpeg -re -i cars265.ts -vcodec copy -f mpegts udp://127.0.0.1:1234 Step3: ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://127.0.0.1:1234" -c:v libsvt_hevc -s 1280x720 -r 60 -g 60 -b:v 10000k -c:a copy -flush_packets 0 -f mpegts "udp://127.0.0.1:4321" -max_muxing_queue_size 1024 Step 4: ffplay -protocol_whitelist "file,udp,rtp" -i udp://127.0.0.1:4321

Wait a moment and check if the above command can reproduce the issue.

cars_1280x720.h264.txt The attached file is my test sequence, you can remove the txt suffix and decode it to get the yuv file I used. ffmpeg -c:v h264 -i cars_1280x720.h264 cars.yuv

Thanks.

mikaelsson commented 4 years ago

Hi @guojiansheng0925 , I did the steps (almost all), and since we are talking about environment, maybe the following info will be helpful in some way: I am running this setup on HPE Proliant dl380 g10 with Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz. Only things disabled are virtualization and hyperthreading. also Red Hat Enterprise Linux release 8.1 (Ootpa) with 4.18.0-147.5.1.el8_1.x86_64 kernel. sysctl:

# Maximum receive socket buffer size
net.core.rmem_max = 67108864

# Maximum send socket buffer size
net.core.wmem_max = 67108864

# Default receive socket buffer size
net.core.rmem_default = 67108864
# Default send socket buffer size
net.core.wmem_default = 67108864

# The number of pages allowed for queueing by all UDP sockets
net.ipv4.udp_mem = 8388608 16777216 33554432

# Minimum, initial and max TCP receive buffer
net.ipv4.tcp_rmem = 4096 87380 33554432

# Minimum, initial and max TCP send buffer
net.ipv4.tcp_wmem = 4096 65536 33554432

kernel.sched_rt_runtime_us = 1000000

this last setting taken from here: https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/Docs/svt-hevc_encoder_user_guide.md

as for steps-- Step 0: I did not update the version to the latest, just rebuilt it

ffmpeg version n4.2.2-7-gd5d4c3487c Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-gpl --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100

Step 1: I downloaded attached file and decoded it with provided command.

ffmpeg -c:v h264 -i cars_1280x720.h264 cars.yuv
ffmpeg version n4.2.2-7-gd5d4c3487c Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-gpl --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, h264, from 'cars_1280x720.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, rawvideo, to 'cars.yuv':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 276480 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.54.100 rawvideo
frame=  200 fps=0.0 q=-0.0 Lsize=  270000kB time=00:00:08.00 bitrate=276480.0kbits/s speed=46.6x
video:270000kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

noticed here that there are 200 frames, so I did cat cars.yuv >> cars_long.yuv 5 times and have a file with 1000 frames. generated file for streaming with:

ffmpeg -s 1280x720 -i cars_long.yuv -c:v libx265 cars265.ts
ffmpeg version n4.2.2-7-gd5d4c3487c Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-gpl --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[rawvideo @ 0x24691c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'cars_long.yuv':
  Duration: 00:00:40.00, start: 0.000000, bitrate: 276480 kb/s
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, 276480 kb/s, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.3+19-1d2f556ffb12
x265 [info]: build info [Linux][GCC 8.3.1][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: Thread pool 0 using 40 threads on numa nodes 0,1
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 5 / wpp(12 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias  : 25 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing lslices=4 deblock sao
Output #0, mpegts, to 'cars265.ts':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: hevc (libx265), yuv420p, 1280x720, q=2-31, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.54.100 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 1000 fps=115 q=-0.0 Lsize=    2700kB time=00:00:39.88 bitrate= 554.6kbits/s speed= 4.6x
video:2385kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 13.196766%
x265 [info]: frame I:      5, Avg QP:25.76  kb/s: 4548.80
x265 [info]: frame P:    270, Avg QP:27.07  kb/s: 1307.95
x265 [info]: frame B:    725, Avg QP:34.89  kb/s: 151.06
x265 [info]: Weighted P-Frames: Y:1.9% UV:0.0%
x265 [info]: consecutive B-frames: 5.1% 3.6% 38.9% 27.3% 25.1%

encoded 1000 frames in 8.64s (115.67 fps), 485.41 kb/s, Avg QP:32.74

just in case tried ffprobe on file:

ffprobe -i cars265.ts
ffprobe version n4.2.2-7-gd5d4c3487c Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-gpl --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mpegts, from 'cars265.ts':
  Duration: 00:00:40.00, start: 1.480000, bitrate: 552 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv), 1280x720, 25 fps, 25 tbr, 90k tbn, 25 tbc

and mediainfo

General
ID                                       : 1 (0x1)
Complete name                            : cars265.ts
Format                                   : MPEG-TS
File size                                : 2.64 MiB
Duration                                 : 39 s 920 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 554 kb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L3.1@Main
Codec ID                                 : 36
Duration                                 : 40 s 0 ms
Bit rate                                 : 526 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.023
Stream size                              : 2.51 MiB (95%)
Writing library                          : x265 3.3+19-1d2f556ffb12:[Linux][GCC 8.3.1][64 bit] 8bit
Encoding settings                        : cpuid=1111039 / frame-threads=5 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=1280x720 / interlace=0 / total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=3 / no-allow-non-conformance / repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / open-gop / min-keyint=25 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=4 / scenecut=40 / hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=0 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=3 / limit-refs=1 / no-limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / no-frame-dup / no-hme / weightp / no-weightb / no-analyze-src-pics / deblock=0:0 / sao / no-sao-non-deblock / rd=3 / selective-sao=4 / early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=0.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=28.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / ipratio=1.40 / pbratio=1.30 / aq-mode=2 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / cll=0,0 / min-luma=0 / max-luma=255 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / hist-threshold=0.01 / no-opt-cu-delta-qp / no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=0 / analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 / refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / no-scenecut-aware-qpconformance-window-offsets / right=0 / bottom=0 / decoder-max-rate=0
Color range                              : Limited

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 39 s 920 ms
List                                     : 256 (0x100) (HEVC)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television

everything is ok here and the file is playable in vlc.

Step 2:

ffmpeg -re -i cars265.ts -vcodec copy -f mpegts udp://127.0.0.1:1234

just in case ffprobed again (I ommited several identical messages about NAL parsing in order to not overload the post ):

ffprobe -i "udp://127.0.0.1:1234"
ffprobe version n4.2.2-7-gd5d4c3487c Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-gpl --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
...
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
Input #0, mpegts, from 'udp://127.0.0.1:1234':
  Duration: N/A, start: 4.360000, bitrate: N/A
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv), 1280x720, 25 fps, 25 tbr, 90k tbn, 25 tbc

Everything is ok here.

Step 3: I did a small change to -g and -r parameters only, as the source file is 25 fps, 60 seemed unnatural here. It does not change the workflow, but I think I should let you know.

#!/bin/bash

ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://127.0.0.1:1234" \
-c:v libsvt_hevc -s 1280x720 -r 25 -g 25 -b:v 10000k \
-c:a copy \
-flush_packets 0 -f mpegts "udp://127.0.0.1:4321" -max_muxing_queue_size 1024

here I ommited NAL parsing errors as in previous step. I launch the source streaming, wait until log says it started counting frames, then launch the script. when the source stops streaming due to it reaching the end, this just stays on, until I stop it with 'ctrl+c'.

ffmpeg version n4.2.2-7-gd5d4c3487c Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-gpl --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Trailing options were found on the commandline.
[hevc @ 0x3aa4c00] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3aa4c00] Error parsing NAL unit #1.
[hevc @ 0x3aa4c00] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3aa4c00] Error parsing NAL unit #1.
...
[hevc @ 0x3aa4c00] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3aa4c00] Error parsing NAL unit #1.
[hevc @ 0x3aa4c00] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3aa4c00] Error parsing NAL unit #1.
[hevc @ 0x3aa4c00] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3aa4c00] Error parsing NAL unit #1.
Input #0, mpegts, from 'udp://127.0.0.1:1234':
  Duration: N/A, start: 3.440000, bitrate: N/A
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv), 1280x720, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (libsvt_hevc))
Press [q] to stop, [?] for help
[hevc @ 0x3aae2c0] Could not find ref with POC 48
[hevc @ 0x3aae2c0] Could not find ref with POC 46
[hevc @ 0x3aae2c0] Could not find ref with POC 50
[hevc @ 0x3aae2c0] Could not find ref with POC 52
SVT [version]:  SVT-HEVC Encoder Lib v1.4.3
SVT [build]  :  GCC 8.3.1 20190507 (Red Hat 8.3.1-4)     64 bit
LIB Build date: Apr 29 2020 12:23:10
-------------------------------------------
Number of logical cores available: 40
Number of PPCS 54
-------------------------------------------
SVT [config]: Main Profile      Tier (auto)     Level (auto)
SVT [config]: EncoderMode / Tune                                                        : 7 / 1
SVT [config]: EncoderBitDepth / CompressedTenBitFormat / EncoderColorFormat             : 8 / 0 / 1
SVT [config]: SourceWidth / SourceHeight / InterlacedVideo                              : 1280 / 720 / 0
SVT [config]: Fps_Numerator / Fps_Denominator / Gop Size / IntraRefreshType             : 25 / 1 / 25 / -1
SVT [config]: HierarchicalLevels / BaseLayerSwitchMode / PredStructure                  : 3 / 0 / 2
SVT [config]: BRC Mode / QP / LookaheadDistance / SceneChange                           : CQP / 32 / 17 / 1
SVT [config]: BitRateReduction / ImproveSharpness                                       : 0 / 0
SVT [config]: tileColumnCount / tileRowCount / tileSliceMode / Constraint MV            : 1 / 1 / 0 / 0
SVT [config]: De-blocking Filter / SAO Filter                                           : 1 / 1
SVT [config]: HME / UseDefaultHME                                                       : 1 / 1
SVT [config]: MV Search Area Width / Height                                             : 16 / 7
SVT [config]: HRD / VBV MaxRate / BufSize / BufInit                                     : 0 / 0 / 0 / 90
-------------------------------------------
Output #0, mpegts, to 'udp://127.0.0.1:4321':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: hevc (libsvt_hevc), yuv420p, 1280x720, q=10-48, 10000 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.54.100 libsvt_hevc
^Came=  922 fps= 35 q=-0.0 size=    1386kB time=00:00:33.80 bitrate= 335.9kbits/s speed=1.27x

Step 4: I cannot use ffplay on this server. I can use ffprobe. And this is what it says while the streaming and the transcoding are active:

ffprobe -i "udp://127.0.0.1:4321"
ffprobe version n4.2.2-7-gd5d4c3487c Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --enable-gpl --enable-libsvthevc --enable-libx265
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
[hevc @ 0x3f48dc0] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x3f48dc0] Error parsing NAL unit #1.
...
[hevc @ 0x37bba00] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x37bba00] Error parsing NAL unit #1.
[hevc @ 0x37bba00] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x37bba00] Error parsing NAL unit #1.
[hevc @ 0x37bba00] PPS id out of range: 0
[mpegts @ 0x2e66880] decoding for stream 0 failed
[mpegts @ 0x2e66880] Could not find codec parameters for stream 0 (Video: hevc (HEVC / 0x43564548), none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'udp://127.0.0.1:4321':
  Duration: N/A, start: 14.400000, bitrate: N/A
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: hevc (HEVC / 0x43564548), none, 25 fps, 25 tbr, 90k tbn, 90k tbc

Thanks

guojiansheng0925 commented 4 years ago

Hi @mikaelsson , I tried use ffprobe and get the same result. It doesn't matter it can be played well with ffplay and vlc on my machine (ubuntu18.04) . This result is caused by losing head information, we can adjust the order of command execution to avoid this. ffmpeg -ignore_unknown -sn -c:v hevc -i "udp://127.0.0.1:1234" -c:v libsvt_hevc -s 1280x720 -r 60 -g 60 -b:v 10000k -c:a copy -flush_packets 0 -f mpegts "udp://127.0.0.1:4321" -max_muxing_queue_size 1024 ffprobe -i "udp://127.0.0.1:4321" and push the stream at last: ffmpeg -re -i cars265.ts -vcodec copy -f mpegts udp://127.0.0.1:1234

And then there won't be warnings in ffprobe:

gjs@gjs-nuc:~/code/svt/ffmpeg_dev$ ffprobe -i "udp://127.0.0.1:4321" ffprobe version n4.2.2-9-g759a970f39 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --enable-gpl --enable-libsvthevc --enable-libx265 WARNING: library configuration mismatch avutil configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libsvthevc --enable-libx265 avcodec configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libsvthevc --enable-libx265 avformat configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libsvthevc --enable-libx265 avdevice configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libsvthevc --enable-libx265 avfilter configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libsvthevc --enable-libx265 swscale configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libsvthevc --enable-libx265 swresample configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libsvthevc --enable-libx265 postproc configuration: --enable-shared --enable-libx264 --enable-gpl --enable-nonfree --enable-libsvthevc --enable-libx265 libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 Input #0, mpegts, from 'udp://127.0.0.1:4321': Duration: N/A, start: 1.516667, bitrate: N/A Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv), 1280x720, 60 fps, 60 tbr, 90k tbn, 60 tbc gjs@gjs-nuc:~/code/svt/ffmpeg_dev$

Let's come back to the no video issue, could you please try to play it? I think it is easy to compile FFmpeg on your personal computer. Or you may try to use other media player to play the result on your server.

Thanks.

oviano commented 4 years ago

Forgive me if this is entirely unrelated to the issue you are discussing, but I'll offer it anyway just in case it helps:

I have a video streaming server built using the FFmpeg libraries and as of yesterday I added SVT-HEVC support. I take raw audio and video data (captured) and use the FFmpeg libraries to encoder both streams and produce an mpeg-ts output.

I found that the DTS of the packets generated by SVT-HEVC starts from near zero (slightly negative actually, depending on configuration) rather than values similar to the input data PTS and I found this screwed up the interleaving of the audio and video packets in the mpeg-ts. This led to my video player application being unable to correctly playback the stream.

My app also uses NVENC and I noticed that the DTS values that FFmpeg outputs when using NVENC-HEVC are similar to the PTS values.

So I made a small change to the SVT-HEVC FFmpeg plugin so that it stores the the PTS of the first frame submitted to encode, and adds this as an offset to all the DTS of the packets that gets output.

This fixed my issue and it then behaved the same as NVENC.

I just wonder if in the issue described in this thread it might be caused by the same thing - maybe when the packets are chucked straight to UDP the DTS is still "wrong" whereas when FFmpeg produces a file from it maybe it "corrects" them as it writes them or something.

tianjunwork commented 4 years ago

Hi @oviano Thank you joining the discussion and providing your insight! Is that ok to submit a PR/patch so that @mikaelsson could quickly try out? Thank you.

oviano commented 4 years ago

@tianjunwork here is a drop-in replacement for the libsvt_hevc.c file which is the same as the one here in your repo plus my modification.

https://ovcollyer.synology.me:5001/d/f/553688144730438077

However, I think if this is a legitimate issue then it would be better to fix it inside the SVT-HEVC code itself. I can see there is already another fix in the gstreamer plugin which works around negative DTS values. If DTS was rebased from PTS in the SVT-HEVC code then neither of these workarounds in the plugins would be necessary.

tianjunwork commented 4 years ago

Hi @oviano, thank you for sharing it:) Agree. We will investigate SVT-HEVC itself if any change could be made. @mikaelsson , could you try oviano's libsvt_hevc.c to see if your issue be possibly fixed?

oviano commented 4 years ago

So interestingly since my fix for the DTS issue, I've found that I am able to intermittently repeat something that seems close to the issue being reported here; my server appears to encode correctly using SVT-HEVC (I mean, there are no errors reported by the FFmpeg libraries) but I get the following trace in my playing application:

Error parsing NAL unit #1. PPS id out of range: 0 PPS id out of range: 0 Error parsing NAL unit #1. PPS id out of range: 0 PPS id out of range: 0 Error parsing NAL unit #1. PPS id out of range: 0 PPS id out of range: 0 Error parsing NAL unit #1. PPS id out of range: 0 PPS id out of range: 0 Error parsing NAL unit #1. PPS id out of range: 0 PPS id out of range: 0 Error parsing NAL unit #1. PPS id out of range: 0 PPS id out of range: 0 Error parsing NAL unit #1. PPS id out of range: 0 max_analyze_duration 7000000 reached at 7000000 microseconds st:0 decoding for stream 0 failed Could not find codec parameters for stream 0 (Video: hevc, 1 reference frame (HEVC / 0x43564548), none): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' optioInput #0, mpegts, from 'internal': Duration: N/A, start: 37370.912522, bitrate: N/A Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: hevc, 1 reference frame (HEVC / 0x43564548), none, 60 fps, 60 tbr, 90k tbn, 90k tbc Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 130 kb/s PPS id out of range: 0 Error parsing NAL unit #1. PPS id out of range: 0 Error parsing NAL unit #1. PPS id out of range: 0 Error parsing NAL unit #1.

This happens around maybe 25-50% of the time when encoding a 1280x720 stream using SVT-HEVC. I haven't managed to make it happen with an 1920x1080 encode.

I also raised the "max_analyze_duration" period from 7s to 30s, but it still produces the same issue.

Conclusion: the issue reported here probably isn't related to the DTS issue I noticed, instead there seems to be certain conditions which cause SVT-HEVC to construct in an incorrect elementary stream.

mikaelsson commented 4 years ago

hi @tianjunwork , @oviano , @guojiansheng0925 First of all thank you, @oviano, for your patch. I tried it but unfortunatelly I did not notice any difference.

Now the good news. I tried to the procedure backwards as @guojiansheng0925 proposed in his previous post. So if I start ffprobe or multicat BEFORE transcoding, then I get the complete information with resolution and everything. If I start it after starting transcoding, I get the same stuff like I described in my previous posts. for example: started ffprobe, started transcoding, ffprobe outputs correct info and exits, instantly launch ffprobe again and it outputs info without video resolution.

I made small recordings to check the playback. Oviano's patch was not used while making these.

svt_mc_str_tr.zip

svt_mc_tr_str.zip

svt_str_tr_mc.zip

svt_tr_str_mc.zip

naming contains the order in which components were launched: mc

multicat -u -U @224.0.0.2:4321 str_tr_mc.ts

str

ffmpeg -re -i cars265.ts -vcodec copy -f mpegts udp://224.0.0.1:1234

tr

#!/bin/bash

FFREPORT=file=ffreport.log:level=32 ffmpeg -loglevel repeat+info -ignore_unknown -sn -c:v hevc -i "udp://@224.0.0.1:1234?overrun_nonfatal=1&fifo_size=27887600" \
-c:v libsvt_hevc -s 1280x720 -r 25 -g 25 -rc 1 -b:v 3000k \
-c:a copy \
-max_muxing_queue_size 1024 -flush_packets 0 -f mpegts "udp://224.0.0.2:4321?overrun_nonfatal=1&fifo_size=27887600&localaddr=127.0.0.1&ttl=16&pkt_size=1316"

In cases where str is started first the next command is started only after previous starts to output frames. I hope this helps.

oviano commented 4 years ago

Ok, that's interesting and suggests to me that the problem is when joining the MPEG-TS stream after the start.

To back-up this theory I am able to get a 100% reproduction rate in my code when I join a second player to my server after the stream has started.

So without fully understanding the internals of this sort of stuff it looks to me as if the SVT-HEVC elementary stream is missing some information (or incorrectly writing something) that would usually be periodically resent by the MPEG-TS packetizer to allow a client to join the stream at any point (which is of course the point of an MPEG-TS stream).

oviano commented 4 years ago

I wonder if we were to encode a TS file of let’s say 60s long and then chopped it in half into two files whether the second file would have the same issue.

I might try it tomorrow.

oviano commented 4 years ago

So as I suspected, the same issue occurs if you take a TS file and cut it in half.

Here is a TS file encoded using svt-hevc using ffmpeg:

https://ovcollyer.synology.me:5001/d/f/554222187444222691

Here is the same file split roughly at the halfway point:

1st: https://ovcollyer.synology.me:5001/d/f/554233652333035042 2nd: https://ovcollyer.synology.me:5001/d/f/554233118186322869

The first half plays correctly in VLC, but the second-half produces audio only consistent with the issue described in this thread. This is of course not expected or desired behaviour in an mpeg-ts stream.

I have never seen this issue with mpeg-ts files that were produced using nvenc-hevc, nvenc-h264, x265 or x264 so I presume it must be a bug in the elementary stream that svt-hevc generates which means that it doesn't work properly with mpeg-ts.

tianjunwork commented 4 years ago

@oviano Thanks a lot for doing the experiment. That helps. We will investigate more based on what you saw with TS. To be on the same page, could you let us know how you split the TS file?

oviano commented 4 years ago

Yes I used the macOS split command, eg

split -b 14m encode_svt.ts svt_encode.

tianjunwork commented 4 years ago

I see. Thank you.

oviano commented 4 years ago

You’re welcome. Let me know if you want me to try anything else or provide any more information!

guojiansheng0925 commented 4 years ago

Hi @mikaelsson @oviano @tianjunwork ,

Let's start with my conclusion: 1) It can be played well in the case of the player receive all the information of the stream. 2) If we start playing it in the half of the stream encoded by svt-hevc, the video can not be played.

It may be a feature of svt-hevc, not a bug.

As we know, hevc bit stream is consist of NAL Units: image The IDR frame, SPS and PPS are necessary for playing. When we start playing in the middle of a hevc bit stream, it will be played well after received the next IDR frame. But in the case of svt-hevc, there is only one IDR frame at the front of the bit stream. I said it is a feature because we it was written in the section 5.1 of user guide. https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/Docs/svt-hevc_encoder_user_guide.md#hierarchical-coding-structure-parameters No more I frames in both LowDelay and Random-Access mode.

I can't reproduce the issue because I create the ts stream by : ffmpeg -s 1280x720 -i cars.yuv -c:v libx265 cars265.ts The no video issue can be reproduced when using libsvt_hevc: ffmpeg -s 1280x720 -i cars.yuv -c:v libsvt_hevc cars265.ts

@oviano , the trace you mentioned:

Error parsing NAL unit #1. PPS id out of range: 0 PPS id out of range: 0

is caused by losing header information (SPS PPS IDR), the decoder can't parsing the following NAL Units.

So we should start the player and run the processing command firstly, then start to push the stream.

Thanks.

oviano commented 4 years ago

The workaround of starting the stream first would not work in the case of, for example, broadcast TV where the TS is constantly being broadcast.

In this case, any set top box attempting to tune into the broadcast would not work if the stream had been encoded using SVT-HEVC because it would never receive the stream header.

Is there an option to send repeated IDR frames - would IntraRefreshType set to a positive value solve it?

guojiansheng0925 commented 4 years ago

Hi @oviano ,

I have tried some parameters but there is still only one IDR frame. SvtHevcEncApp -i cars1.yuv -w 1280 -h 720 -n 200 intra-period 20 -irefresh-type -1 -b test1.h265

image

@tianjunwork could you provide more information? Thanks.

oviano commented 4 years ago

@guojiansheng0925 thanks for the interesting insights.

oviano commented 4 years ago

I’m curious as to how live streaming could work with SVT if it’s necessary to receive the start of the stream.

Regardless of the container, whether it be MPEG TS or something else it would seem that for a client to be able to join mid stream there would need to be more IDR frames, but I admit there may be things I do not understand!

oviano commented 4 years ago

Hi @oviano ,

I have tried some parameters but there is still only one IDR frame. SvtHevcEncApp -i cars1.yuv -w 1280 -h 720 -n 200 intra-period 20 -irefresh-type -1 -b test1.h265

image

@tianjunwork could you provide more information? Thanks.

Ok, I figured it out from looking at the code (EbPacketizationProcess.c).

The key is the intraRefreshType. I'm using VBR mode, and in this case the intraRefreshType needs to be set to a positive number that is the number of intraRefreshPeriods. So let's say you have an intraRefreshPeriod of 46 frames, then an intraRefreshType of 1 would mean write the headers again every 46 frames, a value for intraRefreshType of 2 would mean every 46 x 2 frames, etc.

I found the following command produces multiple IDR, with headers every 5s or so:

SvtHevcEncApp -w 1920 -h 1080 -bit-depth 8 -i capture.yuv -rc 1 -tbr 3200000 -fps-num 50 -fps-denom 1 -irefresh-type 5 -intra-period 46 -b encode.265

I haven't tried this with ffmpeg and mpeg-ts yet, but I'm hopeful it will work.

Screenshot 2020-05-23 at 15 44 44
oviano commented 4 years ago

So just confirming that I have this working now in FFmpeg with a split file.

@mikaelsson I think the all that is needed is to add -forced-idr 0 to your FFmpeg command line and then it shouldn't matter which order you run your commands.

mikaelsson commented 4 years ago

Hello @oviano, thank you so much. that actually works. VLC has trouble playing the dumped file as it plays only one frame, but windows media player does the job.

I have tried -forced-idr in the past but I guess I was misinterpreting the meaning. Since in the help topic it's range is listed from -1 to INT_MAX I thought it was the number of frames. I was setting it to 60 or 25. Turns out it is some kind of a multiplier. If I set it to 10, for example, it needs a little time before ffprobe starts detecting correct info. Setting it to a low value like 0 or 1 makes ffprobe detect everything right away.

I need to run some tests and if all goes well I'll close this issue in a couple of days.

oviano commented 4 years ago

My view coming at this fresh was that it was not clear at all from the documentation what the intra refresh type means. I had to look at the source code to figure it out.

My suggestion to the developers would be to consider splitting this parameter into two:

intraRefreshPeriod - as now

intraRefreshType - 0 CRA or 1 IDR. So as now but just two simple options. Default 0.

intraRefreshHeaders - 0 to INT MAX. IDR refresh type only. Number of intra refresh periods that should occur before resending headers (VPS, PPS, SPS). Default 0 (meaning don’t resend headers). (Note: Values above 1 only valid for VBR rate control method)

I think it’s combining these last two into one parameter that makes it hard to understand

Then the FFmpeg plugin should follow the same pattern with parameters names consistent with the SvtEncApp command

-irefresh-type -irefresh-headers

instead of the single:

-forced-idr

At the very least the documentation could be a little clearer even if you don’t split the parameter.

tianjunwork commented 4 years ago

@oviano Thank you for the feedback on intraRefreshType. I agree it needs more time/test to understand what does >0 mean. Since some customers are already using it, better to keep compatible on interface. I will add a detailed explanation in the user guide appendix about usage of intraRefreshType.

tianjunwork commented 4 years ago

538 explains more about intraRefreshType.

mikaelsson commented 4 years ago

Hello, Sorry, it took me some time to get around to this.

solution: I am using -rc 1 and -forced-idr 1. Resulted stream dumps are playable in most players. I think only the first idr is complete, all the following lack some kinid of information which results the problems on some players. but that is out of the scope of this issue.

Big thanks to everyone @tianjunwork , @guojiansheng0925 , @oviano .