Page 1 of 2

FFMPEG in Linux

PostPosted: Tue Jan 01, 2013 6:45 pm
by Spadge
In case you've suddenly found errors in your logs since upgrading to Serviio 1.1, complaining that ffmpeg cannot be found (even though "dkpg -l | grep ffmpeg" clearly shows it's installed), it's probably worth looking at this PPA and installing the ffmpeg in there: https://launchpad.net/~jon-severinsson/+archive/ffmpeg

It's a lot easier than having to compile your own from source.

Re: FFMPEG in Linux

PostPosted: Thu Jan 03, 2013 8:37 pm
by khurram23
Have you had success streaming from online sources using this?

I've had a problem in Ubuntu where if I compiled ffmpeg from ffmpeg.org (with librtmp), i would get errors in my serviio log stating rtmp protocol not found (or something similar) and would not stream online sources to my Xbox 360. But if I compiled the one from serviio download page, no errors showed up and everything worked fine.

Re: FFMPEG in Linux

PostPosted: Thu Jan 03, 2013 8:57 pm
by Xmantium
csholmq has made a wrapper for the latest ffmpeg v1.0 that now includes RTMPT protocol support without librtmp

May not work with all plugins but needs to be tested. From my tests it works with pre-compiled ffmpeg from here using the wrapper
  Code:
#!/usr/bin/env bash
PATH_TO_FFMPEG=/path/to/ffmpeg

PRE_SWITCHES=""
POST_SWITCHES=""
INPUT_FOUND=false

COUNT=$#
for ((INDEX=0; INDEX<COUNT; ++INDEX)) ; do
   # Input found
   if [[ $1 == "-i" ]] ; then
      # Raw input
      INPUT="$2"

      INPUT_FOUND=true
      shift
   # Post switch found
   elif $INPUT_FOUND ; then
      POST_SWITCHES="$POST_SWITCHES $1"
   # Pre switch found
   else
      PRE_SWITCHES="$PRE_SWITCHES $1"
   fi

   shift
done

# RTMP stream
if [[ $INPUT =~ 'rtmp' ]] ; then
   # Convert syntax to -rtmp_***
   INPUT=`echo "$INPUT" | sed -E \
   -e 's; ([a-zA-Z]+)=; -rtmp_\L\1 ;g'`
   
   # Extract RTMP URL
   FILENAME=`echo "$INPUT" | sed -E \
   -e 's;(rtmp[^ ]+).+;\1;'`

   # Extract RTMP switches
   STREAM_SWITCHES=`echo "$INPUT" | sed -E \
   -e 's;rtmp[^ ]+(.+);\1;'`
else
   STREAM_SWITCHES=""
   FILENAME="$INPUT"
fi

echo $PATH_TO_FFMPEG $PRE_SWITCHES $STREAM_SWITCHES -i \"$FILENAME\" $POST_SWITCHES
$PATH_TO_FFMPEG $PRE_SWITCHES $STREAM_SWITCHES -i "$FILENAME" $POST_SWITCHES

Re: FFMPEG in Linux

PostPosted: Thu Jan 03, 2013 9:28 pm
by Spadge
khurram23 wrote:Have you had success streaming from online sources using this?

I've had a problem in Ubuntu where if I compiled ffmpeg from ffmpeg.org (with librtmp), i would get errors in my serviio log stating rtmp protocol not found (or something similar) and would not stream online sources to my Xbox 360. But if I compiled the one from serviio download page, no errors showed up and everything worked fine.


I don't know, I don't use it for online streaming. I just wanted the "no ffmpeg" error to go away from the logs.

Re: FFMPEG in Linux

PostPosted: Thu Jan 03, 2013 9:35 pm
by khurram23
the "no ffmpeg" error is because the ffmpeg pkg in main Ubuntu repo is deprecated. When you compiled ffmpeg based on instructions in the WIKI, your ffmpeg was given a release/pkgnumber which turned out to be lower than what was in repo. Anytime you updated your system, ffmpeg depreciated version was installed.

I've updated the instructions in WIKI to account for this. If you follow the instructions now, it should not happen.

I use Ubuntu 12.10 64bit myself and everything seems to work fine. Only, i would suggest using ffmpeg source from serviio download page instead of ffmpeg.org.

Re: FFMPEG in Linux

PostPosted: Thu Jan 03, 2013 9:44 pm
by Spadge
khurram23 wrote:the "no ffmpeg" error is because the ffmpeg pkg in main Ubuntu repo is deprecated. When you compiled ffmpeg based on instructions in the WIKI, your ffmpeg was given a release/pkgnumber which turned out to be lower than what was in repo. Anytime you updated your system, ffmpeg depreciated version was installed.

I've updated the instructions in WIKI to account for this. If you follow the instructions now, it should not happen.

I use Ubuntu 12.10 64bit myself and everything seems to work fine. Only, i would suggest using ffmpeg source from serviio download page instead of ffmpeg.org.


I'm using ffmpeg from the PPA I linked to above. I'm not compiling software from source, I gave all that up when I stopped using FreeBSD as my server.

I run 12.10 on my desktop, but the server is 12.04 still.

Serviio should put up a PPA for their own serviio-friendly ffmpeg, or at least package up a .DEB.

Re: FFMPEG in Linux

PostPosted: Thu Jan 03, 2013 10:27 pm
by khurram23
I suppose that is not a bad idea. I could provide my pkg files for those who are interested and don't feel like compiling. Could setup a repo too...

Re: FFMPEG in Linux

PostPosted: Thu Jan 03, 2013 10:33 pm
by Spadge
I think it's worth it. Make once, use many.

I'm sure that if Zip wanted to set up something official-like over at launchpad then there's plenty of us who would happily help maintain it, for free, as a payback gift to the community.

That way we could keep on top of updates to Serviio and ffmpeg and ubuntu support would be just that bit better for everyone.

So that's two volunteers so far ...

Re: FFMPEG in Linux

PostPosted: Fri Jan 04, 2013 11:05 am
by zip
Great, if you tell me what i have to do.

Re: FFMPEG in Linux

PostPosted: Fri Jan 04, 2013 3:06 pm
by abubin
Spadge wrote:In case you've suddenly found errors in your logs since upgrading to Serviio 1.1, complaining that ffmpeg cannot be found (even though "dkpg -l | grep ffmpeg" clearly shows it's installed), it's probably worth looking at this PPA and installing the ffmpeg in there: https://launchpad.net/~jon-severinsson/+archive/ffmpeg

It's a lot easier than having to compile your own from source.


I am using this package as well. I too would rather use packages instead of self compilation. Compiling packages will have lots of potential side effects such as causing incompatibility with other software that uses it. One such problem that I had previously is the compiled ffmpeg have problem running zoneminder (some camera capture software).

So far this package has been running fine and I am using ubuntu 12.04.

Re: FFMPEG in Linux

PostPosted: Fri Jan 04, 2013 7:29 pm
by khurram23
abubin wrote:I am using this package as well. I too would rather use packages instead of self compilation. Compiling packages will have lots of potential side effects such as causing incompatibility with other software that uses it. One such problem that I had previously is the compiled ffmpeg have problem running zoneminder (some camera capture software).

So far this package has been running fine and I am using ubuntu 12.04.


You do realize, all packages are compiled by someone then uploaded to repo right?

I have always found the reverse to be true, but I suppose to each his own. That's not saying I compile every single thing, only when I need to.

Re: FFMPEG in Linux

PostPosted: Fri Jan 04, 2013 9:23 pm
by Spadge
zip wrote:Great, if you tell me what i have to do.


I will look into it this weekend. I've never set up a PPA before :)

Re: FFMPEG in Linux

PostPosted: Sat Jan 05, 2013 4:42 pm
by Spadge
zip wrote:Great, if you tell me what i have to do.


I tried to PM you some instructions, but it won't let me send.

If you want a PPA for Ubuntu ffmpeg Serviio-style, go here: https://help.launchpad.net and create a login. Set up a team called something like Serviio-Extras or whatever. Add me to the team and I will pick it up from there.

That way you retain ownership of the whole thing and can add/remove your helpers as and when needs must.

Cheers

Re: FFMPEG in Linux

PostPosted: Sat Jan 05, 2013 7:28 pm
by zip
Done, hopefully I picked the right Spadge :-)

Re: FFMPEG in Linux

PostPosted: Sat Jan 05, 2013 9:31 pm
by Spadge
I think I'm sfromley on there ;)

https://launchpad.net/~sfromley

Re: FFMPEG in Linux

PostPosted: Sun Jan 06, 2013 12:26 am
by zip
done

Re: FFMPEG in Linux

PostPosted: Mon Jan 07, 2013 3:45 am
by khurram23
I can help as well, add me if you like.

Re: FFMPEG in Linux

PostPosted: Mon Jan 07, 2013 3:56 am
by moltra
Look at this link it had a script that installs and updated ffmpeg.

viewtopic.php?t=8671
ubuntu FFMPEG X264 install / upgrade script

You might be able to use this as a base.

Sent from my DROID RAZR using Tapatalk 2

Re: FFMPEG in Linux

PostPosted: Mon Jan 07, 2013 1:07 pm
by zip
khurram23 wrote:I can help as well, add me if you like.

Thaks, added

Re: FFMPEG in Linux

PostPosted: Thu Jan 10, 2013 6:14 pm
by thenamelessthing
hi! I'm really interested by an ubuntu repo. At least for the LTS version. If I can help, I will be glad to give an helping hand.