FAQ  •  Register  •  Login

[SOLVED] FFMPEG and RTMP

<<

dcolhoun

Serviio newbie

Posts: 14

Joined: Mon Mar 07, 2011 11:20 am

Post Sat Apr 28, 2012 4:22 am

[SOLVED] FFMPEG and RTMP

Hi All

I am getting this error in the log file - [FFMPEGWrapper] FFmpeg is not compiled with librtmp support, RTMP streaming will not work.

I have built FFMPEG as per the wiki here http://wiki.serviio.org/doku.php?id=build_ffmpeg_linux

On Ubuntu 12.04

Any advice would be appreciated
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Apr 29, 2012 11:26 am

Re: FFMPEG and RTMP

It's looking for the string "--enable-rtmp" in the FFmpeg output. You can check for it by executing ffmpeg
<<

jabrown0604

Serviio lover

Posts: 88

Joined: Sun Jan 22, 2012 8:25 pm

Location: Illinois

Post Sun Apr 29, 2012 9:05 pm

Re: FFMPEG and RTMP

I wonder if this issue is still not fixed in 12.04 with librtmp not built correctly for ubuntu. It was a handshake error when I was dealing with it. I have not had time to test this but I can check this week. I am getting a third "server" to test with. I will add this to the list to see what version 12.04 has got available. The link below is how I fixed my librtmp issue. May or may not be useful.
viewtopic.php?f=5&t=5329&start=10#p38297
“Those who have succeeded at anything and don’t mention luck are kidding themselves.”
Server-Mac Mini / OS-WHS 2011 SP1 / TV/HTS-Sharp Aquos/Samsung HT-C6600
<<

wae3iejohhohZae5

Streaming enthusiast

Posts: 27

Joined: Sun Apr 29, 2012 9:10 pm

Post Sun Apr 29, 2012 9:24 pm

Re: FFMPEG and RTMP

zip wrote:It's looking for the string "--enable-rtmp" in the FFmpeg output. You can check for it by executing ffmpeg

ffmpeg does no longer output the configuration on Ubuntu 12.04 LTS.

Example output on Ubuntu 10.04 LTS:
  Code:
$ ffmpeg
FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.3, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --extra-version=4:0.5.1-1ubuntu1.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 1 / 52.20. 1
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 4. 0 /  0. 4. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Dec 21 2011 18:41:38, gcc: 4.4.3
At least one output file must be specified

Example output on Ubuntu 12.04 LTS:
  Code:
$ ffmpeg
ffmpeg version 0.8.1-4:0.8.1-0ubuntu1, Copyright (c) 2000-2011 the Libav developers
  built on Mar 22 2012 05:09:06 with gcc 4.6.3
This program is not developed anymore and is only provided for compatibility. Use avconv instead (see Changelog for the list of incompatible changes).
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'


Also, it seems like the default Ubuntu 12.04 LTS repositories have everything required to make ffmpeg understand all RTMP formats:
  Code:
$ ffmpeg -protocols
ffmpeg version 0.8.1-4:0.8.1-0ubuntu1, Copyright (c) 2000-2011 the Libav developers
  built on Mar 22 2012 05:09:06 with gcc 4.6.3
This program is not developed anymore and is only provided for compatibility. Use avconv instead (see Changelog for the list of incompatible changes).
Supported file protocols:
Input:
applehttp
concat
crypto
file
gopher
http
httpproxy
mmsh
mmst
pipe
rtmp
rtp
tcp
udp
Output:
file
gopher
http
httpproxy
md5
pipe
rtmp
rtp
tcp
udp
  Code:
sudo aptitude install libavcodec-extra-53 libavformat-extra-53
  Code:
$ ffmpeg -protocols
ffmpeg version 0.8.1-4:0.8.1-0ubuntu1, Copyright (c) 2000-2011 the Libav developers
  built on Mar 22 2012 05:09:06 with gcc 4.6.3
This program is not developed anymore and is only provided for compatibility. Use avconv instead (see Changelog for the list of incompatible changes).
Supported file protocols:
Input:
applehttp
concat
crypto
file
gopher
http
httpproxy
mmsh
mmst
pipe
rtmp
rtmpt
rtmpe
rtmpte
rtmps
rtp
tcp
udp
Output:
file
gopher
http
httpproxy
md5
pipe
rtmp
rtmpt
rtmpe
rtmpte
rtmps
rtp
tcp
udp
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Apr 29, 2012 10:20 pm

Re: FFMPEG and RTMP

It looks like the ffmpeg provided by your repo is the forked version (libav.org). Not sure if it'll still work, I haven't tested it and Serviio is built to work with the main FFmpeg code base. Give it a try, if all works you can ignore the message, it's just an info that something might be wrong.
<<

dcolhoun

Serviio newbie

Posts: 14

Joined: Mon Mar 07, 2011 11:20 am

Post Mon Apr 30, 2012 4:26 am

Re: FFMPEG and RTMP

Thanks for all the replies

jabrown0604 - please let me know what your tests show
<<

patronanejo

Serviio newbie

Posts: 2

Joined: Wed May 02, 2012 7:22 am

Post Wed May 02, 2012 8:48 am

Re: FFMPEG and RTMP

wae3iejohhohZae5 wrote:
zip wrote:It's looking for the string "--enable-rtmp" in the FFmpeg output. You can check for it by executing ffmpeg

ffmpeg does no longer output the configuration on Ubuntu 12.04 LTS.


zip wrote:It looks like the ffmpeg provided by your repo is the forked version (libav.org). Not sure if it'll still work, I haven't tested it and Serviio is built to work with the main FFmpeg code base. Give it a try, if all works you can ignore the message, it's just an info that something might be wrong.


Ubuntu's FFmpeg package maintainer chose to package the Libav fork--so technically, he is now the Libav maintainer. While the split took place in March, Libav releases included two command-line conversion tools (avconv and ffmpeg) from 09 August 2011 until 27 January 2012, when ffmpeg.exe was removed from the Libav fork. The short-lived Libav version of ffmpeg was, as you have discovered, unreliable and unmaintained.

Avconv includes many changes, including extensive syntactical deprecations and throroughly broken API (so simply changing your pointers is insufficient). The upside of pruned code and grammatical consistency is nominally quicker transcoding.

FFmpeg.exe is properly maintained at the FFmpeg.org fork, where a call for Ubuntu- and Debian package maintainers appeared on 23 December 2011.While repositories for Ubuntu and Debian FFmpeg are easy to find, no plans have been announced to package FFmpeg for the next official release.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed May 02, 2012 11:40 am

Re: FFMPEG and RTMP

thanks. AFAIK FFmpeg guys pull all the changes from AVLib repo, so the transcoding speed gain should be available in both - only guessing though.
<<

patronanejo

Serviio newbie

Posts: 2

Joined: Wed May 02, 2012 7:22 am

Post Wed May 02, 2012 3:36 pm

Re: FFMPEG and RTMP

zip wrote:thanks. AFAIK FFmpeg guys pull all the changes from AVLib repo, so the transcoding speed gain should be available in both - only guessing though.


That is eminently reasonable--even between bitter adversaries, FOSS is FOSS. Improvements to lavf and bugfixes to other shared code should quickly work their way from one fork to the other.

In the organic way of many successful open source projects, more code has come than gone as FFmpeg has accumulated features and capabilities. The Libav group shed legacy code with greater urgency, expecting a performance advantage to be intrinsic to structural discipline.

I (a bit too snarkily) wrote:Avconv includes many changes, including extensive syntactical deprecations and throroughly broken API (so simply changing your pointers is insufficient). The upside of pruned code and grammatical consistency is nominally quicker transcoding.

To be fair, it's only been a year.
<<

sagan

Serviio newbie

Posts: 3

Joined: Fri May 18, 2012 12:40 pm

Post Fri May 18, 2012 2:02 pm

Re: FFMPEG and RTMP

Hi, I am running Ubuntu 12.04, and here is the solution I went through to get all this to work after many hours:

My history:
-Had a successfully running version on MS Windows, so I knew how to configure it to make it work.

-Installed Ubuntu 12.04 (Server Dist). Added KDE and RDP so I could have a window environment.

-Installed Serviio on Ubuntu 12.04 based on "http://download.serviio.org/releases/serviio-0.6.2-linux.tar.gz".
+Installed it in /opt/serviio (this is up to you)
+Added plugins (Hulu, CBS, and YouTube) groovy files

-Followed the directions in the README, which said to install FFMPEG.
+So this would mean something like "sudo apt-get intall ffmpeg" for most of us.
+Setup Serviio to start on reboot.
+Reboot, its alive now, and feeling good.

-Went to configure it via the console, I think this post helped me get the console open (I think my issue was because I had a server dist, desktop install probably wont have any issue here)"http://forum.serviio.org/viewtopic.php?f=5&t=2719".
+Manually run "./serviio-console.sh", it will open up
+I saw my TV in the list of profiles, set it to "Sony BD Player / SMP".
+Used my working MS WIndows config to config this new install, here are some examples that work.
+http://www.hulu.com/feed/show/902/episodes (add as Online RSS/Atom Feed)
+http://www.cbs.com/shows/60_minutes/video/ (add aWeb Resource)
+http://gdata.youtube.com/feeds/api/users/YOUR_ID_HERE/favorites (add as Online RSS/Atom Feed)
+For YouTube, you must have a YouTube account, and then add a couple favorites in the "Video Manager > Favorites".
+Also Enabled Transcoding, and set a location file.

-Was ready to go and start watching, did a reboot, went to the TV, saw the shows, and pressed play.
-Sadly, I got the errors that let me to this posting!!!
-Here is where the countless hours started, and you are probably at too if you are reading this.

-I followed the directions of someone above who amazingly knew the issues of what was left out of the FFMPEG package.
+apt-get install libavcodec-extra-53 libavformat-extra-53

-So now my YouTube worked fully, but not my Hulu/CBS (video=ok audio=FAIL).
+The audio sounded like a high pitch hissing.
+FYI, The "profiles.xml" never needed to be changed for my Sony TV.
+FYI, The plugins never needed to be changed for me (downloaded in year 2012 sometime off the Serviio Support Site).

-These input streams are different encodings, so some type work and some dont, made me think the issue was still the FFMPEG install. Because I saw in DEBUG logging Serviio is trying to transcode them both to the same output type, which I know my TV can handle since it works for YouTube.
+TIP: Learn to use the "DEBUG" logging in config/log4j.xml.
+Look for the lines "Found Format profile for transcoded file ..." and "Starting ffmpeg -i ..."

-Basically, I knew that the FFMPEG default package for Ubuntu 12.04 was not right.
+It was time to compile from the FFMPEG source.
+You could get it from "http://ffmpeg.org/", but I went with "http://download.serviio.org/opensource/ffmpeg-0.9.tar.gz".

-You have to first configure the Makefile (I combined several postings to derive this):
./configure --enable-static --disable-shared --bindir=/tmp/ffmpeg
--disable-ffplay --disable-ffserver --enable-pthreads --disable-mmx
--enable-gpl --enable-libfaac --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libtheora --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-nonfree --enable-version3 --enable-librtmp
--pkg-config=pkg-config

-As you run this you will probably get numerous errors saying "lib<XYZ>" not found.
+To solve these you will need to do "sudo apt-get install libXYZ-dev".
-I also had to do "apt-get install pkg-config".
-Its really hard to remember how many extra packages I installed, but it was a lot of trial and error :(

-So the default binary you probably had looks like:
sagan@host:/usr/bin$ ls -l ffmpeg
-rwxr-xr-x 1 root root 100816 Mar 21 22:31 ffmpeg

-When you compile this it should look like:
sagan@host:/usr/local/bin$ ls -l
-rwxr-xr-x 1 root root 8474392 May 17 01:40 ffmpeg

-Notice that the compiled one is much larger, thus the "static" linking (I think). This way it is using exaclty what you put into it. You should also run it manually (./ffmpeg) and verify the output:
----------------
ffmpeg version 0.9, Copyright (c) 2000-2011 the FFmpeg developers
built on May 17 2012 01:37:57 with gcc 4.6.3
configuration: --enable-static --disable-shared --bindir=/tmp/ffmpeg --disable-ffplay --disable-ffserver --enable-pthreads

--disable-mmx --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb

--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-librtmp

--pkg-config=pkg-config
libavutil 51. 32. 0 / 51. 32. 0
libavcodec 53. 42. 0 / 53. 42. 0
libavformat 53. 24. 0 / 53. 24. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 53. 0 / 2. 53. 0
libswscale 2. 1. 0 / 2. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'
----------------


-Also run "./ffmpeg -protocols" and search for things like (these match what is seen in the serviio.log during DEBUG):
----------------
...
IO. rtmp
IO. rtmpt
IO. rtmpe
IO. rtmpte
IO. rtmps
...
----------------

-I didnt remove my old ffmpeg install (probably should, but something works dont screw with it).
-But I added my newly compiled one into "/usr/local/bin", you just need to add it somewhere in the $PATH before the other installs. But again, probably remove the old if you can.

-Reboot, and it all worked.
<<

pete

Serviio newbie

Posts: 6

Joined: Tue Jun 05, 2012 7:11 am

Post Tue Jun 05, 2012 8:40 am

Re: FFMPEG and RTMP

Thanks for the last post sagan, I was in the same situation and that helped out.
<<

callmeDarwin

Serviio newbie

Posts: 1

Joined: Tue Jun 26, 2012 12:13 pm

Post Sun Jul 01, 2012 9:01 pm

Re: [SOLVED] FFMPEG and RTMP

That worked for me. Thanks sagan!! The Media Browser now works on my Linux box. Using Chrome was audio only but Firefox worked very good. The flash in Chrome doesn't seem to be all there yet.

Now off to test the Android Phone and Tablet.

Thanks again
<<

Syncopated

Serviio newbie

Posts: 1

Joined: Sun Jul 08, 2012 9:29 pm

Post Sun Jul 08, 2012 9:33 pm

Re: FFMPEG and RTMP

sagan wrote:Hi, I am running Ubuntu 12.04, and here is the solution I went through to get all this to work after many hours:
...
-As you run this you will probably get numerous errors saying "lib<XYZ>" not found.
+To solve these you will need to do "sudo apt-get install libXYZ-dev".
-I also had to do "apt-get install pkg-config".
-Its really hard to remember how many extra packages I installed, but it was a lot of trial and error :(

...
-Reboot, and it all worked.


Here's the list of development packages I had to install for the configure to work, in one single command:
sudo apt-get install libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev librtmp-dev libtheora-dev libvorbis-dev libvpx-dev libx264-dev
<<

ttguy

Serviio lover

Posts: 63

Joined: Sun May 27, 2012 10:52 am

Post Tue Aug 21, 2012 1:38 pm

Re: [SOLVED] FFMPEG and RTMP

Earlier on in this thread there was some doubt about whether the "FFmpeg is not compiled with librtmp support, RTMP streaming will not work." was actually an error that Ubuntu users with the forked FFmpeg/avconv need to worry about.

But am I correct in understanding that this definitely is a problem?

And would I also be correct in assuming that the following error from my serviio.log would be a related issue that might be solved by building real ffmpeg?

2012-08-21 23:28:50,083 WARN [ProcessExecutor] Process ffmpeg has a return code of 1! This is a possible error
ERROR [ResourceTransportRequestHandler] Error while processing resource, sending back 500 error. Message: Transcoded file '/tmp/Serviio/transcoding-temp-1000000000020006-3-ORIGINAL.stf' cannot be found, FFmpeg execution probably failed
java.io.IOException: Transcoded file '/tmp/Serviio/transcoding-temp-1000000000020006-3-ORIGINAL.stf' cannot be found, FFmpeg execution probably failed

What do reckon replacing avconv fake ffmpeg with real ffmpeg will break?
--
linux/Humax HDR-3000T
<<

ttguy

Serviio lover

Posts: 63

Joined: Sun May 27, 2012 10:52 am

Post Tue Aug 21, 2012 2:18 pm

Re: FFMPEG and RTMP

zip wrote:It's looking for the string "--enable-rtmp" in the FFmpeg output. You can check for it by executing ffmpeg


Hmm. I built ffmpeg following sagans advice

But mine reports --enable-librtmp rather than --enable-rtmp . Ie I have the "lib" in front.

Is this what you meant zip or is --enable-librtmp wrong?
--
linux/Humax HDR-3000T
<<

ttguy

Serviio lover

Posts: 63

Joined: Sun May 27, 2012 10:52 am

Post Wed Aug 22, 2012 10:27 am

Re: [SOLVED] FFMPEG and RTMP

So I ploughed ahead and did the "suck it an see approach" and built fmpeg following the instructions from sagan and the sudo apt-get install command from Syncopated.
And that worked like a charm. The missing instruction for those not used to compiling code is: type "make" in the command prompt in the folder where you extracted the source code (after you have done the sudo apt-get and the ./configure command.

I can report that this did indeed get rid of the error below

  Code:
2012-08-21 23:27:51,368 WARN  [ProcessExecutor] Process ffmpeg has a return code of 1! This is a possible error.
2012-08-21 23:28:15,957 ERROR [ResourceTransportRequestHandler] Error while processing resource, sending back 500 error. Message: Transcoded file '/tmp/Serviio/transcoding-temp-1000000000020006-3-ORIGINAL.stf' cannot be found, FFmpeg execution probably failed
java.io.IOException: Transcoded file '/tmp/Serviio/transcoding-temp-1000000000020006-3-ORIGINAL.stf' cannot be found, FFmpeg execution probably failed


It also got rid of the

  Code:
 [FFMPEGWrapper] FFmpeg is not compiled with librtmp support, RTMP streaming will not work.


error. So I conclude that zip was just going from memory when he said serviio was looking for --enable-rtmp . He meant --enable-librtmp

So I now have the Arte.groovy plugin working. Not my ultimate aim but it least it demos how to serviio up rtmp streams.

And as far as I can see having the real ffmpeg has not broken anything I can see. My kdenlive video editor still works. Which is what I was really worried about.

But man the ffmpeg/avconv fork thing really sucks.
--
linux/Humax HDR-3000T

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 77 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.