# Problem streaming ffmpeg output to rtmp.   RTMP\_ReadPacket, failed to read RTMP packet header

**URL:** <https://community.wowza.com/t/problem-streaming-ffmpeg-output-to-rtmp-rtmp-readpacket-failed-to-read-rtmp-packet-header/50488>\
**Category:** Wowza Streaming Engine\
**Created:** [January 5, 2018, 5:52pm UTC](https://community.wowza.com/t/problem-streaming-ffmpeg-output-to-rtmp-rtmp-readpacket-failed-to-read-rtmp-packet-header/50488 "2018-01-05T17:52:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Hastings](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@Robert\_Hastings](https://community.wowza.com/u/Robert_Hastings)\
**Post date:** [January 5, 2018, 5:52pm UTC](https://community.wowza.com/t/problem-streaming-ffmpeg-output-to-rtmp-rtmp-readpacket-failed-to-read-rtmp-packet-header/50488/1 "2018-01-05T17:52:03Z")

</div>

I can stream udp but not rtmp.

Here is my command and output:

./ffmpeg -re -i “sample.mp4” -vcodec copy -acodec copy -f flv rtmp://localhost:1935/live/stream ffmpeg version N-45279-g1a104bf Copyright © 2000-2012 the FFmpeg developers built on Oct 10 2012 19:23:23 with gcc 4.7.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 51. 74.100 / 51. 74.100 libavcodec 54. 65.100 / 54. 65.100 libavformat 54. 31.100 / 54. 31.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘sample.mp4’: Metadata: major\_brand : qt minor\_version : 512 compatible\_brands: qt creation\_time : 1970-01-01 00:00:00 encoder : Lavf52.73.0 Duration: 00:09:56.45, start: 0.000000, bitrate: 524 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 424x240, 420 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc Metadata: creation\_time : 1970-01-01 00:00:00 handler\_name : DataHandler Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 99 kb/s Metadata: creation\_time : 1970-01-01 00:00:00 handler\_name : DataHandler RTMP\_ReadPacket, failed to read RTMP packet header rtmp://localhost:1935/live/stream: Unknown error occurred

Here is the output in the access log:

2018-01-0508:25:05CSTconnect-pendingsessionINFO100127.0.0.1-\_defaultVHost\_live\_definst\_0.0[any]1935rtmp://localhost:1935/live127.0.0.1rtmp-unknown38028502331753073-------------rtmp://localhost:1935/live- 2018-01-0508:25:05CSTconnectsessionINFO200127.0.0.1-\_defaultVHost\_live\_definst\_0.001[any]1935rtmp://localhost:1935/live127.0.0.1rtmp-unknown38028502331753073-------------rtmp://localhost:1935/live- 2018-01-0508:25:05CSTcreatestreamINFO200–\_defaultVHost\_live\_definst\_0.001[any]1935rtmp://localhost:1935/live127.0.0.1rtmp-unknown380285023329034131000------rtmp://localhost:1935/livertmp://localhost:1935/live-rtmp://localhost:1935/live- 2018-01-0508:25:05CSTdestroystreamINFO200–\_defaultVHost\_live\_definst\_0.002[any]1935rtmp://localhost:1935/live127.0.0.1rtmp-unknown380285023333837941000------rtmp://localhost:1935/livertmp://localhost:1935/live-rtmp://localhost:1935/live- 2018-01-0508:25:05CSTdisconnectsessionINFO200380285023-\_defaultVHost\_live\_definst\_0.004[any]1935rtmp://localhost:1935/live127.0.0.1rtmp-unknown38028502333383794-------------rtmp://localhost:1935/live- 2018-01-0508:26:05CSTapp-stopapplicationINFO200\_definst\_live/_definst_—61263.418-------------------------

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [January 5, 2018, 6:18pm UTC](https://community.wowza.com/t/problem-streaming-ffmpeg-output-to-rtmp-rtmp-readpacket-failed-to-read-rtmp-packet-header/50488/2 "2018-01-05T18:18:15Z")

</div>

You need to either disable source authentication or add a username and password. More information regarding source security can be found in our article below.

[https://www.wowza.com/docs/how-to-configure-security-using-wowza-streaming-engine-manager](https://www.wowza.com/docs/how-to-configure-security-using-wowza-streaming-engine-manager)

```auto
./ffmpeg -re -i "sample.mp4" -codec copy -f flv "rtmp://localhost:1935/live/streamflashver=FMLE/3.0\20(compatible;\20FMSc/1.0) live=true pubUser=username pubPasswd=password"

```

---

<div class="post-metadata">

**Author:** ![Robert\_Hastings](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@Robert\_Hastings](https://community.wowza.com/u/Robert_Hastings)\
**Post date:** [January 5, 2018, 7:29pm UTC](https://community.wowza.com/t/problem-streaming-ffmpeg-output-to-rtmp-rtmp-readpacket-failed-to-read-rtmp-packet-header/50488/3 "2018-01-05T19:29:16Z")

</div>

Thanks. That works
