Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
FFmpeg not correcting container via php #5592
Comments
|
Post the full output you get when running with |
|
That's the full output: I also always delete the old m4a file before running a new test. |
|
This is not the full output. Do not remove the debug info at the beginning:
|
|
I actually did not delete anything, that was all I got from php. This is what I receive running the same code in terminal: However, when I run it from the terminal, the containers ARE corrected. |
|
On PHP you also need to capture stderr (I don't know how) |
|
@lordwilmore have you put |
|
@dstftw yes, --verbose is turned on, i made this request: and got that output: @jaimeMF I googled and it seems like one can get the stderr by appending 2>&1 to the call, so now it lookes like this: That's the output: |
|
@lordwilmore as you can see from log
ffmpeg that is running from script is very old. Update it. |
|
Are you running from the server and the command line on the same computer and user? |
|
That is weird indeed, because I have contacted my web hoster and he updated it. Also running "ffmpeg -v" from the console outputs: "ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers" also the weird thing is that as mentioned above, ffmpeg actually works with youtube-dl when I call it from the command line. and yes, I do run the php and the command on the same server, i also save the files in the same directory. |
|
You should compare the output of |
|
calling "which ffmpeg" from terminal outputs: ~/.toast/armed/bin/ffmpeg calling "which ffmpeg" from php outputs: /usr/bin/ffmpeg /usr/bin/ffmpeg So you might actually have a point here. However running the code and giving the correct ffmpeg path still does not correct the audio header: [echo system('~/bin/youtube-dl --ffmpeg-location |
|
We can't help without the output with the --verbose option. |
|
this call: echo system('~/bin/youtube-dl --verbose --ffmpeg-location this output: is that sufficient or do you need anything else? and is that "--ffmpeg-location ~/.toast/armed/bin/ffmpeg" correct? Or do i have to set the location differently? |
|
There's something in your copy on ffmpeg:
Does |
|
from the terminal it outputs: from php: |
|
Maybe it's an issue with |
I am calling this command from my php site:
Everything works fine and the file is being saved as well with this output:
[youtube] RF0HhrwIwp0: Downloading webpage [youtube] RF0HhrwIwp0: Extracting video information [youtube] RF0HhrwIwp0: Downloading DASH manifest [download] Destination: /home/inventor/html/YouTubeDownloader/RF0HhrwIwp0.m4a [download] 0.0% of 6.30MiB at 146.11KiB/s ETA 00:44 [download] 0.0% of 6.30MiB at 416.83KiB/s ETA 00:15 [download] 0.1% of 6.30MiB at 947.87KiB/s ETA 00:06 [download] 0.2% of 6.30MiB at 1.93MiB/s ETA 00:03 [download] 0.5% of 6.30MiB at 1.63MiB/s ETA 00:03 [download] 1.0% of 6.30MiB at 1.38MiB/s ETA 00:04 [download] 2.0% of 6.30MiB at 1.15MiB/s ETA 00:05 [download] 4.0% of 6.30MiB at 442.06KiB/s ETA 00:14 [download] 7.9% of 6.30MiB at 254.34KiB/s ETA 00:23 [download] 10.7% of 6.30MiB at 259.85KiB/s ETA 00:22 [download] 15.0% of 6.30MiB at 291.74KiB/s ETA 00:18 [download] 21.5% of 6.30MiB at 373.71KiB/s ETA 00:13 [download] 34.5% of 6.30MiB at 489.44KiB/s ETA 00:08 [download] 50.1% of 6.30MiB at 568.80KiB/s ETA 00:05 [download] 63.9% of 6.30MiB at 664.06KiB/s ETA 00:03 [download] 90.1% of 6.30MiB at 795.23KiB/s ETA 00:00 [download] 100.0% of 6.30MiB at 832.05KiB/s ETA 00:00 [download] 100% of 6.30MiB in 00:07 [ffmpeg] Correcting container in "/home/inventor/html/YouTubeDownloader/RF0HhrwIwp0.m4a" [ffmpeg] Correcting container in "/home/inventor/html/YouTubeDownloader/RF0HhrwIwp0.m4a"
BUT: although it states that ffmpeg corrected the container for the audio file, they are still corrupted and can't be played from iTunes. The same command from the terminal works as requested and corrects the container correctly.
I have tested if php can access ffmpeg [system("ffmpeg -h")] and also have tried to give a location for ffmpeg [echo system('~/bin/youtube-dl --ffmpeg-location
/.toast/armed/bin/ffmpeg --extract-audio -o "/html/YouTubeDownloader/%(id)s.%(ext)s" RF0HhrwIwp0')]. Still without success. My current ffmpeg version is 2.6.2 and my youtube-dl version is from 2015.04.28Have you ever encountered such a problem and know how to solve this, or is it a new issue?