Closed shanmugam023 closed 7 years ago
Can you please copy here the complete content of your config.yml
file?
Also you need to make sure that the avconv
option points to your ffmpeg binary. How did you install ffmpeg?
Yes everything i did, i used centos server ,manually ffmpeg command work but i execute in my website it doesn't work , kindly help me thank you , this is my configuration file youtubedl: vendor/rg3/youtube-dl/youtube_dl/main.py python: /usr/bin/python params:
Can you please run these commands (from inside Alltube's folder) and copy the result:
which ffmpeg
which /usr/bin/ffmpeg
ffmpeg -version
php -r "require_once __DIR__.'/vendor/autoload.php'; var_dump(\Alltube\Config::getInstance());"
(Also please quote the output to make it more readable.)
Hi, /usr/bin/ffmpeg
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
["youtubedl"]=> string(44) "vendor/rg3/youtube-dl/youtube_dl/main.py" ["python"]=> string(15) "/usr/bin/python" ["params"]=> array(4) { [0]=> string(13) "--no-playlist" [1]=> string(13) "--no-warnings" [2]=> string(14) "--playlist-end" [3]=> int(1) } ["convert"]=> bool(true) ["avconv"]=> string(15) "/usr/bin/ffmpeg" ["rtmpdump"]=> string(19) "vendor/bin/rtmpdump" ["uglyUrls"]=> bool(true) ["stream"]=> bool(true) ["remux"]=> bool(false) ["file":"Alltube\Config":private]=> string(10) "config.yml" }
hi , I reconfigured setting please see below result
object(Alltube\Config)#3 (10) { ["youtubedl"]=> string(44) "vendor/rg3/youtube-dl/youtube_dl/main.py" ["python"]=> string(15) "/usr/bin/python" ["params"]=> array(4) { [0]=> string(13) "--no-playlist" [1]=> string(13) "--no-warnings" [2]=> string(14) "--playlist-end" [3]=> int(1) } ["convert"]=> bool(true) ["avconv"]=> string(17) "vendor/bin/ffmpeg" ["rtmpdump"]=> string(19) "vendor/bin/rtmpdump" ["uglyUrls"]=> bool(true) ["stream"]=> bool(true) ["remux"]=> bool(false) ["file":"Alltube\Config":private]=> string(10) "config.yml" }
Well, if your ffmpeg is in /usr/bin, you should put that in your config file, not vendor/bin.
Please separate the different outputs (and quote them) so we can see which command returns what.
Did you run the two which command
or did the second one return nothing? (This could be the issue here.)
Hi , i run it please see the result
object(Alltube\Config)#3 (10) { ["youtubedl"]=> string(44) "vendor/rg3/youtube-dl/youtube_dl/main.py" ["python"]=> string(15) "/usr/bin/python" ["params"]=> array(4) { [0]=> string(13) "--no-playlist" [1]=> string(13) "--no-warnings" [2]=> string(14) "--playlist-end" [3]=> int(1) } ["convert"]=> bool(true) ["avconv"]=> string(15) "/usr/bin/ffmpeg" ["rtmpdump"]=> string(19) "vendor/bin/rtmpdump" ["uglyUrls"]=> bool(true) ["stream"]=> bool(true) ["remux"]=> bool(false) ["file":"Alltube\Config":private]=> string(10) "config.yml" }
hi , I changed configuration file video/classes/Config.php and classes/Config.php everything i did but it doesn't work anything idea ?
You should not modify the classes/Config.php
file, only the config.yml
file.
Also I don't know what that video/
folder you are talking about is.
Can you please run this and copy the output:
php -r "var_dump(exec('which /usr/bin/ffmpeg'));"
sorry dude i did but now working
string(15) "/usr/bin/ffmpeg"
I'm running out of ideas here.
Can you please add this in classes/VideoDownload.php
:
diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php
index 0d42a97..82eda1b 100644
--- a/classes/VideoDownload.php
+++ b/classes/VideoDownload.php
@@ -249,6 +249,7 @@ class VideoDownload
*/
private function getAvconvMp3Process($url)
{
+ var_dump($this->config->avconv, shell_exec('which '.$this->config->avconv)); die;
if (!shell_exec('which '.$this->config->avconv)) {
throw(new \Exception('Can\'t find avconv or ffmpeg'));
}
Then try to convert a file in your browser and copy here what is displayed in the browser.
"PHP message: PHP Parse error: syntax error, unexpected 'diff' (T_STRING), expecting function (T_FUNCTION) in /var/www/html/Alltube/classes/VideoDownload.php on line 22" while reading response header from upstream,
Don't copy the entire patch, just insert the green var_dump...
line (without the starting +
) at the correct line in the file.
can you share your VideoDownload.php ?? i couldn't find correct location
If that's easier for you, you can create a test.php
file at the root of your alltube folder with the following content:
<?php
require_once __DIR__.'/vendor/autoload.php';
$config = \Alltube\Config::getInstance();
var_dump($config->avconv, shell_exec('which '.$config->avconv));
Then run this file in your browser.
hi i got message
string(15) "/usr/bin/ffmpeg" NULL
I didn't find the problem, but a solution.
I commented out the exception in classes/VideoDownload.php
private function getAvconvMp3Process($url)
{
//if (!shell_exec('which '.$this->config->avconv)) {
// throw(new \Exception('Can\'t find avconv or ffmpeg'));
//}
return ProcessBuilder::create(
[
$this->config->avconv,
'-v', 'quiet',
//Vimeo needs a correct user-agent
'-user-agent', $this->getProp(null, null, 'dump-user-agent'),
'-i', $url,
'-f', 'mp3',
'-vn',
'pipe:1',
]
);
}
This may has something to do with security settings of php.
That's great news if you can use it like this! It's strange that the test fails but converting works. I'll try to improve the test.
sorry it doesn't work i got some problem if i click download mp3 i got error message
FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected 'public' (T_PUBLIC) , expecting ';' or '{' in /var/www/html/Alltube/classes/VideoDownload.php on line 279" while reading response header from upstream
You probably have some typo left from your changes. Try restoring the file from Git or the release package.
k thanks
Call to undefined method Alltube\VideoDownlo ad::getAvconvMp3Process() in /var/www/html/Alltube/classes/VideoDownload.php on line 294" while reading response header from upstream,
I'm pretty sure you didn't restore the file correctly if this function is missing…
I improved the test on the develop branch (a89b3380603625a59b94a7659b7a6b7c12efc94c) if someone wants to try it.
It works now as expected. I see, ffmpeg returns as exit status 1 if you call it without parameters and 0 if "--help" is supplied. Thanks for you effort!
Hi , Finally It works Thank you so much
Hi,
I'm getting the same error as OP but weird thing is that it worked 2 days ago. I tried also the develop branch but no luck. All I did yesterday and the day before was installing some essential modules for PHP to make it work with a script for DNS lookups but nothing about conversion / ffmpeg or avconv.
@veeg4z What is the content of your config/config.yml
file. How did you install ffmpeg/avconv?
(If it stopped working without any Alltube update it is probably a problem with your server config though.)
Config same as default, only changed convertAdvanced: true
.
I installed ffmpeg with sudo apt-get install ffmpeg
.
But now I noticed that the conversion works on the backup folder where I originally installed AllTube. I made another folder this morning and copied all the content from the backup to this new folder and the AllTube inside the new folder doesn't work on conversions.
Maybe it's a problem related to paths that I should update? Or everytime I change folder I have to install everything from scratch?
If you didn't change the config, it looks at vendor/bin/ffmpeg
by default (which is where Composer installs ffmpeg) but apt-get installs it in /usr/bin/ffmpeg
.
So you need to add this to your config file:
avconv: /usr/bin/ffmpeg
Thanks, it works!
I did change the path earlier as in avconv: usr/bin/ffmpeg
but forgot the slash, the slash means from root folder then I see..
And I also noticed there's another ffmpeg in vendor/bin/ffmpeg
but then why it doesn't work? Just asking out of curiosity :D
The ffmpeg binary in vendor is provided for people that can't install it globally (on shared hosting for example) but it only works on x86_64 Linux (I don't know what you are using).
I do have x86_64 Ubuntu but as I wrote you earlier it just worked before with default config.
How my site is now:
http://mysite.com/youtube-dl <- (works with default config and avconv pointing to vendor/bin/ffmpeg
)
http://mysite.com/youtube-dl_dev <- (doesn't work, have to change to avconv: /usr/bin/ffmpeg
)
http://mysite.com <- (same as ^)
They all have same files, same folders, same everything. It's odd that it works in the folder where I originally installed the script but not in the other 2 copies. Never mind, I'm just writing this in case you want to improve the tests or something in the check but I'm happy it just works now.
Hi ,
This is shanmugam i installed ffmpeg and also configure like ffmpeg: vendor/bin/ffmpeg and vconv: vendor/bin/ffmpeg in config.yml but i got error like Can't find avconv or ffmpeg kindly give some solution