<p>As for test I use just a file with data as input and I would like to stream it as video. For this purpose I used ffmpeg:</p>

<pre><code>C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo 
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -i merged.dump 
  -vcodec libx264 -threads 4 -crf 51 -preset ultrafast -an -f mpegts udp://localhost:20001
</code></pre>

<p>(I broke the line for readability). And with MPEG4 as video codec:</p>

<pre><code>C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo 
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -i merged.dump -vcodec mpeg4 
  -f mpegts udp://localhost:20001
</code></pre>

<p>While ffmpeg was streaming data I executed ffplay to see I can read the stream. I could.</p>

<p>So then I tried the same with VLC player and PotPlayer, giving stream address as "udp://localhost:20001" and "udp://@:20001", with firewall enabled and completely disabled. With those players I have no success at all -- PotPlayer after few seconds gives me an error that it cannot read stream, VLC on the other hand show progress (bouncing yellow line) ad infinitum.</p>

<p>What should I do to make non-ffplay software read the stream as well?</p>

<p><em>I use Windows 10 if this matters.</em></p>

<hr>

<p>I executed:</p>

<pre><code>C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo 
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -re 
  -i clean-frames.dump -vcodec libx264 -threads 4 -crf 51 -preset ultrafast -an 
  -f mpegts udp://localhost:20001 2&gt; log.log
</code></pre>

<p>And here is the log file:</p>

<pre><code>ffmpeg version git-2020-05-23-26b4509 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 48.100 / 56. 48.100
  libavcodec     58. 87.101 / 58. 87.101
  libavformat    58. 43.100 / 58. 43.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 83.100 /  7. 83.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[rawvideo @ 000001a01bb9f0c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'clean-frames.dump':
  Duration: 00:02:27.50, start: 0.000000, bitrate: 424673 kb/s
    Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 2592x2048, 424673 kb/s, 10 tbr, 10 tbn, 10 tbc
Stream mapping:
  Stream #0:0 -&gt; #0:0 (rawvideo (native) -&gt; h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 000001a01bbaabc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001a01bbaabc0] profile High, level 5.0, 4:0:0, 8-bit
Output #0, mpegts, to 'udp://localhost:20001':
  Metadata:
    encoder         : Lavf58.43.100
    Stream #0:0: Video: h264 (libx264), gray, 2592x2048, q=-1--1, 10 fps, 90k tbn, 10 tbc
    Metadata:
      encoder         : Lavc58.87.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=    6 fps=0.0 q=46.0 size=      15kB time=00:00:00.00 bitrate=10938181.8kbits/s speed=2.17e-05x    
...
frame= 1475 fps= 10 q=-1.0 Lsize=     950kB time=00:02:27.40 bitrate=  52.8kbits/s speed=0.999x    
video:108kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 779.101868%
[libx264 @ 000001a01bbaabc0] frame I:6     Avg QP:43.83  size: 13976
[libx264 @ 000001a01bbaabc0] frame P:1469  Avg QP:45.48  size:    18
[libx264 @ 000001a01bbaabc0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 000001a01bbaabc0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 000001a01bbaabc0] coded y intra: 0.0% inter: 0.0%
[libx264 @ 000001a01bbaabc0] i16 v,h,dc,p: 83% 13%  4%  1%
[libx264 @ 000001a01bbaabc0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 000001a01bbaabc0] kb/s:6.00
</code></pre>

<p>Literally entire log is here: <a href="https://pastebin.com/6g3JD6Gk" rel="nofollow noreferrer">https://pastebin.com/6g3JD6Gk</a></p>

CC BY-SA 4.0
2020-05-26T18:54:36.197Z
Try adding `-re` input option, and include the **complete** log from command #1.
llogan
CC BY-SA 4.0
2020-05-27T06:55:46.803Z
@llogan, thank you. I updated the question.
astrowalker
<ffmpeg><streaming>
How to create widely readable video stream with ffmpeg?
astrowalker
# How to create widely readable video stream with ffmpeg?

(Asked by: username_0 on 2020-05-26)

As for test I use just a file with data as input and I would like to stream it as video. For this purpose I used ffmpeg:
C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo 
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -i merged.dump 
  -vcodec libx264 -threads 4 -crf 51 -preset ultrafast -an -f mpegts udp://localhost:20001

(I broke the line for readability). And with MPEG4 as video codec:
C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo 
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -i merged.dump -vcodec mpeg4 
  -f mpegts udp://localhost:20001

While ffmpeg was streaming data I executed ffplay to see I can read the stream. I could.
So then I tried the same with VLC player and PotPlayer, giving stream address as "udp://localhost:20001" and "udp://@:20001", with firewall enabled and completely disabled. With those players I have no success at all -- PotPlayer after few seconds gives me an error that it cannot read stream, VLC on the other hand show progress (bouncing yellow line) ad infinitum.
What should I do to make non-ffplay software read the stream as well?
I use Windows 10 if this matters.

I executed:
C:\tools\ffmpeg-20200523-26b4509-win64-static\bin\ffmpeg.exe -y -f rawvideo 
  -vcodec rawvideo -video_size 2592x2048 -r 10 -pix_fmt gray -re 
  -i clean-frames.dump -vcodec libx264 -threads 4 -crf 51 -preset ultrafast -an 
  -f mpegts udp://localhost:20001 2> log.log

And here is the log file:
ffmpeg version git-2020-05-23-26b4509 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 48.100 / 56. 48.100
  libavcodec     58. 87.101 / 58. 87.101
  libavformat    58. 43.100 / 58. 43.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 83.100 /  7. 83.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[rawvideo @ 000001a01bb9f0c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rawvideo, from 'clean-frames.dump':
  Duration: 00:02:27.50, start: 0.000000, bitrate: 424673 kb/s
    Stream #0:0: Video: rawvideo (Y800 / 0x30303859), gray, 2592x2048, 424673 kb/s, 10 tbr, 10 tbn, 10 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 000001a01bbaabc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001a01bbaabc0] profile High, level 5.0, 4:0:0, 8-bit
Output #0, mpegts, to 'udp://localhost:20001':
  Metadata:
    encoder         : Lavf58.43.100
    Stream #0:0: Video: h264 (libx264), gray, 2592x2048, q=-1--1, 10 fps, 90k tbn, 10 tbc
    Metadata:
      encoder         : Lavc58.87.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=    6 fps=0.0 q=46.0 size=      15kB time=00:00:00.00 bitrate=10938181.8kbits/s speed=2.17e-05x    
...
frame= 1475 fps= 10 q=-1.0 Lsize=     950kB time=00:02:27.40 bitrate=  52.8kbits/s speed=0.999x    
video:108kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 779.101868%
[libx264 @ 000001a01bbaabc0] frame I:6     Avg QP:43.83  size: 13976
[libx264 @ 000001a01bbaabc0] frame P:1469  Avg QP:45.48  size:    18
[libx264 @ 000001a01bbaabc0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 000001a01bbaabc0] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.0%  0.0%  0.0%  0.0%  0.0%    skip:100.0%
[libx264 @ 000001a01bbaabc0] coded y intra: 0.0% inter: 0.0%
[libx264 @ 000001a01bbaabc0] i16 v,h,dc,p: 83% 13%  4%  1%
[libx264 @ 000001a01bbaabc0] i8c dc,h,v,p: 100%  0%  0%  0%
[libx264 @ 000001a01bbaabc0] kb/s:6.00

Literally entire log is here: https://pastebin.com/6g3JD6Gk

**Tags:** ffmpeg, streaming

> **Comments:**
> **username_1**: Try adding `-re` input option, and include the **complete** log from command #1.  
> **username_0**: @username_1, thank you. I updated the question.  

---

## 0 answers

