Welcome Guest, Not a member yet? Register   Sign In
Running FFmpeg in Code Igniter
#11

[eluser]TheFuzzy0ne[/eluser]
I think your problem is there. You need to set a filesystem path, not a remote path. Also, you might want to try supplying the absolute path to the ffmpeg executable, too.
#12

[eluser]Sky Warden[/eluser]
[quote author="TheFuzzy0ne" date="1364173683"]I think your problem is there. You need to set a filesystem path, not a remote path. Also, you might want to try supplying the absolute path to the ffmpeg executable, too.[/quote]
Well, how can I do that? This is really my first time in doing this kind of things. I think it's like loading a kind of library then execute it. I've searched the internet and found nothing. I really have no idea. Why is my ffmpeg no in /usr/local/bin anyway?

Random question : You don't sleep or what? :lol:
#13

[eluser]TheFuzzy0ne[/eluser]
[quote author="Sky Warden" date="1364175590"]
Well, how can I do that? This is really my first time in doing this kind of things. I think it's like loading a kind of library then execute it. I've searched the internet and found nothing. I really have no idea. Why is my ffmpeg no in /usr/local/bin anyway?[/quote]

Different distros store files in different places.

I was thinking something like this, but I'm just guessing:
Code:
$command = '/usr/bin/ffmpeg -itsoffset -7 -i '.FCPATH.'celestial_stream/video/test.mp4 -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 '.FCPATH.'celestial_stream/thumbnails/test.jpg';

echo $command; // Check that this contains the correct paths.
echo shell_exec($command);

[quote author="Sky Warden" date="1364175590"]
Random question : You don't sleep or what? :lol:[/quote]

Yes, I sleep. I just don't sleep very much since I suffer from severe pain.
#14

[eluser]Sky Warden[/eluser]
[quote author="TheFuzzy0ne" date="1364177432"]
Different distros store files in different places.

I was thinking something like this, but I'm just guessing:
Code:
$command = '/usr/bin/ffmpeg -itsoffset -7 -i '.FCPATH.'celestial_stream/video/test.mp4 -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 '.FCPATH.'celestial_stream/thumbnails/test.jpg';

echo $command; // Check that this contains the correct paths.
echo shell_exec($command);

[quote author="Sky Warden" date="1364175590"]
Random question : You don't sleep or what? :lol:[/quote]

Yes, I sleep. I just don't sleep very much since I suffer from severe pain.[/quote]
It doesn't work. You deleted the celestial_stream from the command string because it returns the wrong path (double celestial_stream) and I'm sure the path is correct now. This is what it prints :

/usr/bin/ffmpeg -itsoffset -7 -i /opt/lampp/htdocs/celestial_stream/video/test.mp4 -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 /opt/lampp/htdocs/celestial_stream/thumbnails/test.jpg

I've checked it. There's test.mp4 in the video directory indeed, and I've given full permission to both video and thumbnails directory.

Maybe I need to give permission to execute in /usr/bin?

I also put shell_exec($command) without echo, just to make sure, but still doesn't work.
#15

[eluser]TheFuzzy0ne[/eluser]
Sorry. I'm fresh out of ideas...

I don't think it's a permissions issue. If something is in /usr/bin or /bin, you should have access regardless. That is unless you're chrooted, which you're not.

Please try executing the string generated from your PHP script from the command line to make sure it still works.
#16

[eluser]Sky Warden[/eluser]
[quote author="TheFuzzy0ne" date="1364208600"]Sorry. I'm fresh out of ideas...

I don't think it's a permissions issue. If something is in /usr/bin or /bin, you should have access regardless. That is unless you're chrooted, which you're not.

Please try executing the string generated from your PHP script from the command line to make sure it still works.[/quote]Recently I tried the syntax again in terminal, both the original syntax I posted and the output from PHP script. Both work fine, and I didn't use root to execute it. I used my normal user, so I agree with you that it maybe not a permission issue.

Are you sure that FFmpeg can be used instantly just by installing the software? I didn't install FFmpeg-php extension. Just FFmpeg. Do I need to...a kind of integrate FFmpeg to PHP or similar like that?
#17

[eluser]TheFuzzy0ne[/eluser]
You shouldn't need to install any extension, since you're making a system call.

However, there is an PHP extension which provides you with an API. It might be worth looking into: http://ffmpeg-php.sourceforge.net/
#18

[eluser]Sky Warden[/eluser]
[quote author="TheFuzzy0ne" date="1364213798"]You shouldn't need to install any extension, since you're making a system call.

However, there is an PHP extension which provides you with an API. It might be worth looking into: http://ffmpeg-php.sourceforge.net/[/quote]
Yes. I know that extension. I read about it yesterday. By the way, do you have another idea? It's weird since in every tutorial I found, it should have been working.
#19

[eluser]TheFuzzy0ne[/eluser]
I'm all out of ideas. Sorry. I have no idea why it works when you run it from the command prompt, but doesn't work when you run it from PHP. I'm baffled...
#20

[eluser]Sky Warden[/eluser]
That's a bad luck. Well, thanks for trying anyway. Smile




Theme © iAndrew 2016 - Forum software by © MyBB