[FFmpeg-user] Step 1 encode video, Step 2 stream over UDP-> NOT working (HEVC, UDP, x265, streaming)

Rudi Hrvatin rudi.hrvatin at gmail.com
Wed Dec 17 10:34:33 CET 2014


Hi everyone!

I'm a beginner here and trying to accomplish something simple. Any help is
appriciated! :)

*STEP 1* is to encode a file.
*STEP 2* stream the file over UDP.
*STEP 3* is to receive the stream and save it on a different PC.
*STEP 4* PSNR over the encoded file and


*STEP 1* is to encode a file:

ffmpeg -i BQTerrace_1920x1080_60_qp22.bin -r 25 -b:v 2500k -c:v libx265
-preset medium
-x265-params crf=27   -y  -f mp4 test.mp4

This works fine, I get just some warning. The video if playable using
ffplay so I think this *works fine*.

ffmpeg -i BQTerrace_1920x1080_60_qp22.bin -r 25 -b:v 2500k -c:v libx265
-preset medium
-x265-params crf=27   -y  -f mp4 test.mp4
ffmpeg version N-68441-g4fa42e0 Copyright (c) 2000-2014 the FFmpeg
developers
  built on Dec 14 2014 22:13:03 with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b
--enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm
--enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink
--enable-zlib
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 14.100 / 56. 14.100
  libavformat    56. 15.105 / 56. 15.105
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  3.101 /  5.  3.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
[hevc @ 0000000002bde080] *Unknown HEVC profile: 0*
    Last message repeated 3 times
[hevc @ 0000000002bcce60] Stream #0: *not enough frames to estimate rate;
consider increasing probesize*
Input #0, hevc, from 'BQTerrace_1920x1080_60_qp22.bin':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: hevc, yuv420p10le(tv), 1920x1080, 25 fps, 25 tbr,
1200k tbn, 25 tbc
x265 [info]: HEVC encoder version 1.4
x265 [info]: build info [Windows][GCC 4.9.2][64 bit] 8bpp
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: WPP streams / frame threads / pool  : 17 / 2 / 4
x265 [info]: CTU size / RQT depth inter / intra  : 64 / 1 / 1
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut       : 25 / 250 / 40
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb / refs: 1 / 1 / 0 / 3
x265 [info]: Rate Control / AQ-Strength / CUTree : CRF-27.0 / 1.0 / 1
x265 [info]: tools: rd=3 lft sao signhide tmvp
[hevc @ 0000000006910ec0] *Unknown HEVC profile: 0*
    Last message repeated 1 times
Output #0, mp4, to 'test.mp4':
  Metadata:
    encoder         : Lavf56.15.105
    Stream #0:0: Video: hevc (libx265) ([35][0][0][0] / 0x0023), yuv420p,
1920x1080, q=2-31, 2500 kb/s, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.14.100 libx265
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (libx265))
Press [q] to stop, [?] for help
[hevc @ 0000000006910ec0]* Unknown HEVC profile: 0*
    Last message repeated 1 times
frame=  600 fps=6.5 q=0.0 Lsize=    7118kB time=00:00:23.92
bitrate=2437.9kbits/s
video:7110kB audio:0kB subtitle:0kB other streams:0kB global headers:1kB
muxing overhead: 0.111920%
x265 [info]: frame I:      3, Avg QP:27.06  kb/s: 35236.67
x265 [info]: frame P:    121, Avg QP:27.73  kb/s: 9571.68
x265 [info]: frame B:    476, Avg QP:33.05  kb/s: 403.04
x265 [info]: global :    600, Avg QP:31.95  kb/s: 2426.21
x265 [info]: Weighted P-Frames: Y:9.1% UV:6.6%
x265 [info]: consecutive B-frames: 0.8% 0.0% 3.2% 6.5% 89.5%



*STEP 2* stream the file over UDP:

ffmpeg -re -i test.mp4 -c copy -f mp4  udp://172.18.60.47:1234

This commands produces some errors. What am I doing wrong? (I also tried
without the -f mp4 but also didn't work).


ffmpeg -re -i test.mp4 -c copy -f mp4  udp://172.18.60.47:1234
ffmpeg version N-68441-g4fa42e0 Copyright (c) 2000-2014 the FFmpeg
developers
  built on Dec 14 2014 22:13:03 with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b
--enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm
--enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
--enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
--enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink
--enable-zlib
  libavutil      54. 15.100 / 54. 15.100
  libavcodec     56. 14.100 / 56. 14.100
  libavformat    56. 15.105 / 56. 15.105
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  3.101 /  5.  3.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.15.105
  Duration: 00:00:24.00, start: 0.000000, bitrate: 2429 kb/s
    Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv),
1920x1080, 2427 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
[mp4 @ 0000000004cd05a0]* muxer does not support non seekable output*
Output #0, mp4, to 'udp://172.18.60.47:1234':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.15.105
    Stream #0:0(und): Video: hevc ([35][0][0][0] / 0x0023), yuv420p,
1920x1080, q=2-31, 2427 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
*Could not write header for output file #0 (incorrect codec parameters ?):
Error number -22 occurred*




*STEP 3* is to receive the stream and save it. But until I get the STEP 2
working I cannot continue.

*STEP 4* is already working!



Any help appreciated! This is part of my master thesis so I would really
like to continue with my experiments. :)



Best regards,

Rudi Hrvatin


More information about the ffmpeg-user mailing list