Closed johnhoangn closed 8 years ago
After changing the permissions on ffmpeg
are you able to properly execute ffmpeg -version
?
No, trying to execute ffmpeg at all returns bash: /usr/bin/ffmpeg: cannot execute binary file
.
There must still be something wrong with your permissions then, I don't think this is related to MumbleDJ. How did you install ffmpeg?
You're probably right. Much like the user in the issue I linked, I believe I messed up the installation because when I try sudo apt-get remove ffmpeg
to delete and re-install it, it says the ffmpeg package was not installed to begin with.(Except for when I'm removing the outdated version of ffmpeg). I used Michael's instructions to the letter and I got the executable files into /usr/bin but I feel as if there's more to installing it than placing a couple of binaries into bin. I'm reading a compilation guide as I'm typing this.
Cool, let me know how it goes! On May 24, 2016 9:07 AM, "John" notifications@github.com wrote:
You're probably right. Much like the user in the issue I linked, I believe I messed up the installation because when I try sudo apt-get remove ffmpeg to delete and re-install it, it says the ffmpeg package was not installed to begin with. I used Michael's instructions to the letter and I got the executable files into /usr/bin but I feel as if there's more to installing it than placing a couple of binaries into bin. I'm reading a compilation guide as I'm typing this.
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/matthieugrieger/mumbledj/issues/140#issuecomment-221321184
I followed this guide to download libraries and stuff but when I !add a song it still returns exec format error
, and when I try ffmpeg it also still says cannot execute binary file
. I checked permissions on the files and their read and execute permissions are, in fact, checked. I should have the rights to them... Your thoughts?
Also, when I sudo
the server join command, it says I do not have a Youtube API key defined in my environment variables but when I double checked config.gcfg, both of my Youtube and Soundcloud keys are at the bottom in the quotes, weird.
If you run the bot with sudo
it changes the directory that it looks in for configuration files, so that's why you get that error. Running the bot with sudo
isn't recommended.
Do you have avconv
installed? It's a fork of ffmpeg
that should be easier for you to install. If you're able to install that/already have it installed, just change the PlayerCommand
configuration value in the config file from "ffmpeg" to "avconv" and it should work.
I swapped the PlayerCommand to avconv like you suggested. Now Soundcloud links work but with youtube links it displays video information and then nothing happens. With some videos (unsure of why only some) it dumps:
youtube-dl --verbose --no-mtime --output /home/pi/.mumbledj/songs/hBZC4cEk7Hw.bestaudio --format bestaudio --prefer-ffmpeg https://youtu.be/hBZC4cEk7Hw
[debug] System config: [u'--extract-audio']
[debug] User config: [u'--force-ipv4']
[debug] Command-line args: [u'--verbose', u'--no-mtime', u'--output', u'/home/pi/.mumbledj/songs/hBZC4cEk7Hw.bestaudio', u'--format', u'bestaudio', u'--prefer-ffmpeg', u'https://youtu.be/hBZC4cEk7Hw']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2016.05.21.2
[debug] Python version 2.7.3 - Linux-4.1.7-v7+-armv7l-with-debian-7.10
[debug] exe versions: avconv 9.14-6, avprobe 9.14-6, ffmpeg 0.8.17-6, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] hBZC4cEk7Hw: Downloading webpage
[youtube] hBZC4cEk7Hw: Downloading video info webpage
[youtube] hBZC4cEk7Hw: Extracting video information
[youtube] hBZC4cEk7Hw: Downloading MPD manifest
[debug] Invoking downloader on u'https://r1---sn-vgqs7nls.googlevideo.com/videoplayback?id=841642e1c124ec7c&itag=251&source=youtube&requiressl=yes&ms=au&mv=m&pl=16&mm=31&mn=sn-vgqs7nls&initcwndbps=10525
00&nh=IgpwcjAyLmlhZDI2KgkxMjcuMC4wLjE&ratebypass=yes&mime=audio/webm&gir=yes&clen=265182&lmt=1440401284066708&dur=14.821&sver=3&signature=597C2AF34534C5D53EE54A131738D64263D26C8D.19B3B99B7B57937BE5329E58EB31567A91A3DAC5&mt=1464113062&upn=AcdR5SUMqME&fexp=9406983,9416126,9416891,9422596,9428398,9431012,9432364,9433096,9433223,9433946,9435527,9435876&key=dg_yt0&ip=69.140.120.12&ipbits=0&expire=1464134888&sparams=ip,ipbits,expire,id,itag,source,requiressl,ms,mv,pl,mm,mn,initcwndbps,nh,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: /home/pi/.mumbledj/songs/hBZC4cEk7Hw.bestaudio
[download] 100%!o(MISSING)f 258.97KiB in 00:0079MiB/s ETA 00:000
[debug] ffmpeg command line: avprobe -show_streams file:/home/pi/.mumbledj/songs/hBZC4cEk7Hw.bestaudio
[ffmpeg] Destination: /home/pi/.mumbledj/songs/hBZC4cEk7Hw.mp3
WARNING: Your copy of ffmpeg is outdated, update ffmpeg to version 1.0 or newer if you encounter any errors.
[debug] ffmpeg command line: ffmpeg -y -i file:/home/pi/.mumbledj/songs/hBZC4cEk7Hw.bestaudio -vn -acodec libmp3lame -q:a 5 file:/home/pi/.mumbledj/songs/hBZC4cEk7Hw.mp3
ERROR: audio conversion failed: file:/home/pi/.mumbledj/songs/hBZC4cEk7Hw.bestaudio: could not find codec parameters
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1782, in post_process
files_to_delete, info = pp.run(info)
File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 294, in run
'audio conversion failed: ' + e.msg)
PostProcessingError
youtube-dl: exit status 1
I also noticed the execution line has --prefer-ffmpeg
on it even though I changed the PlayerCommand to "avconv". Is this a problem?
In case you check out the URL... it was one of my users who posted that video as a test...
Yes, that is the issue actually. Good catch.
I'll release an update in a bit that should fix that.
Alright, try the newest release. It should fix the problem you were having.
The error I posted doesn't show up anymore so at least something was fixed, but the audio still doesn't play after the video information is posted. I'm compiling libav 11 right now to update avconv, it's taking a while so I'll post back later if that works or not.
Updated avconv to 11.6, youtube links still fail to play audio after the information post with no errors in the terminal. My Pi's directory tree is a mess and the SD card has less than 100 MB of free space so I'm thinking about resetting the thing. Do you have any ideas before I start from scratch again?
I'm assuming it's still an issue with either the ffmpeg
installation or the avconv
installation.
What distro are you using on your Pi? Raspbian?
Yep, I'm running Raspbian. Last night I downloaded ffmpeg (using their git pull) and an avconv package (file ended in .gz if I remember correctly) and I compiled them using ./configure
, make
, and make install
. Afterwards, I checked their read and execute permissions and sudo
copied them to /usr/bin.
Now if I type ffmpeg
or avconv
I get:
ffmpeg version N-80082-g49640ae Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.6 (Debian 4.6.3-14+rpi1)
configuration:
libavutil 55.25.100 / 55.25.100
libavcodec 57.43.100 / 57.43.100
libavformat 57.37.100 / 57.37.100
libavdevice 57.0.101 / 57.0.101
libavfilter 6.46.100 / 6.47.100
libswscale 4.1.100 / 4.1.100
libswresample 2.0.101 / 2.0.101
and:
avconv version 11.6, Copyright (c) 2000-2014 the Libav developers built on May 24 2016 19:45:05 with gcc 4.6 (Debian 4.6.3-14+rpi1)
Hyper fast Audio and Video encoder
usage: avconv [options] [[infile options] -i infile]... {outfile options] outfile}...
Did I miss any steps or do something wrong? Perhaps I downloaded an incompatible package? Would they fail to compile if that were the case?
It looks like you have them installed properly, I can't think of anything wrong with your installation process.
Does it still not work?
Yeah, still no luck. This project was actually in the works and handed to me half-way through so I think some paths or directories were improperly set. I'm going to factory restore and start from scratch. Thanks for the speedy update release and help up to this point.
No problem, let me know if you need any more help.
I got it to work! ...But I can't find the config file. For some reason ~/.mumbledj
isn't in $HOME
. The first edit was made to the config within the extracted directory. So I think the installation took a copy of it so I have admin rights and the keys were inputted, but I have no idea where ~/.mumbledj/config/mumbledj.gcfg is. I assume I could re-run the make commands, but I would like to avoid doing that every edit.
EDIT: I remember I had to use sudo make install
instead of make install
because it was saying I didn't have permissions and you mentioned sudo
changes where it looks for files; where would that be?
So the bot successfully finds the configuration file? If so, the file exists in ~/.mumbledj
as that is where it looks.
One thing to note is that directories that start with a period do not show up by default in file managers or with ls
. Try using ls -a
to locate the directory if you haven't already.
If it really doesn't exist in your current user's home directory, then you could check /root/.mumbledj
, although I doubt that it would be located there.
Yeah you're right it was hidden. I just about to say I found it when you posted. Thanks though!
Awesome, glad everything is working now!
I'm running your mumbledj on a Raspberry Pi 2. Whenever someone adds to the queue, mumbledj kind of just "thinks" about it for a second and then disconnects while dumping an error log to the terminal.
It used to just chat to the channel:
The audio download has failed.
So I updated youtube-dl, added the ipv4 argument in the config, and updated ffmpeg using MichaelOutram's suggestion in this issue. When I go to check ffmpeg's version withffmpeg -version
I get:bash: /usr/bin/ffmpeg: cannot execute binary file
I then tried
sudo chmod a=rx ffmpeg ffprobe
before moving the files to /usr/bin yet it still doesn't execute.arch
returnsarm7l
(I think it's an L) if that could potentially help.Here's the error log: