Adding librtmp package - for use in ffmpeg

Hello everyone,

Recently I have been experimenting with some custom versions of ffmpeg, as I needed h264 support and ts demuxing. However, it has come to my attention that although the already compiled packages available online contain support for RTMP, the self compiled ffmpeg-full do not. Furthermore, ffmpeg-custom doesn't even have an RTMP option! Thus I would like to add support for librtmp, but I am encountering some problems.

So far, I have gathered the following info:

  1. In order to support RTMP, ffmpeg needs the following build arguements: --enable-protocol=rtmp --enable-librtmp --enable-encoder=flv --enable-decoder=flv. This makes sense, as RTMP uses FLV and we need the library to add support. However, it cannot find the library as the openwrt do not contain it

  2. The librtmp git repository can be found here. This is what I've been trying to get into a Makefile to add librtmp as an openwrt package. By default, librtmp is included with ffmpeg.

So far, I've got the following Makefile which I am almost certain isn't even half way complete:

# Copyright (C) 2019
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.

include $(TOPDIR)/




include $(INCLUDE_DIR)/

define Package/librtmp

define Package/librtmp/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/librtmp $(1)/usr/bin/

$(eval $(call BuildPackage,librtmp))

I have made this, following the documentation and other packages that are already available. This Makefile is inside the directory openwrt/package/feeds/packages/librtmp.

When running the command make package/librtmp/download V=s I get the following result:

ERROR: please fix package/feeds/packages/librtmp/Makefile - see logs/package/feeds/packages/librtmp/dump.txt for details
Collecting package info: done
make[1]: Entering directory '/home/chrismin13/openwrt'
make[2]: Entering directory '/home/chrismin13/openwrt/package/feeds/packages/librtmp'
Makefile:33: *** ERROR: Unknown pack format for file /home/chrismin13/openwrt/tmp/dl/.  Stop.
make[2]: Leaving directory '/home/chrismin13/openwrt/package/feeds/packages/librtmp'
time: package/feeds/packages/librtmp/download#0.06#0.00#0.08
make[1]: *** [package/Makefile:109: package/feeds/packages/librtmp/download] Error 2
make[1]: Leaving directory '/home/chrismin13/openwrt'
make: *** [/home/chrismin13/openwrt/include/ package/librtmp/download] Error 2

The log mentioned in the above output is the following:

Package: librtmp
Version: 1
Depends: +libc +GCC_LIBSSP:libssp +USE_GLIBC:librt +USE_GLIBC:libpthread 
Section: libs
Category: Libraries
Repository: packages
Title: librtmp
License: GPL-2.0
LicenseFiles: COPYING
Type: ipkg
Description: librtmp


Makefile:33: *** ERROR: Unknown pack format for file /home/chrismin13/openwrt/tmp/dl/.  Stop.

Any advice on how to get this working would be greatly appreciated! I've also got the task of adding this in the ffmpeg-custom options, but that seems to be slightly easier and will be done later on anyways.

Thanks in advance,

You're missing PKG_SOURCE_VERSION and PKG_MIRROR_HASH (can be missing, not sure.). PKG_SOURCE_DATE is also useful. Try:



PKG_MIRROR_HASH can be fixed with make check FIXUP=1

1 Like

Have you tried ?
That should contain everything you need out of the box.

If you still want librtmp you can use this tarball instead
Checksum here:

You're also missing InstallDev, ffmpeg wont find it without that section.

Thank you for your reply! This perfectly covered my use case. I've compiled the pull request as a package and it's been working perfectly on my Newifi3 D2 with an MT7621. I hope the pull request gets merged soon, v4 had a lot of improvements!

That's very good news, thanks for following up. As far as merging goes I honestly don't know since I don't have the time for supporting it in a timely manner for all platforms which is why I haven't listed myself as maintainer.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.