
Recherche avancée
Autres articles (50)
-
Les images
15 mai 2013 -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (8532)
-
ffmpeg not converting via PHP script
16 mars 2014, par user3331834Essentially, I have this code :
if(in_array($ext,$audio)&&($ext!=="flac")){
exec("ffmpeg -i -loglevel 'verbose' ".$fileName.".".$ext." ".$fileName.".flac null >/dev/null 2>/var/www/resources/ffmpegAudio.log &",$ffmpegOutput);
print_r($ffmpegOutput);
$editApproveStatus="Audio entry approved. File converted.";
}Ultimately, my goal is to convert files and show a live progress of the conversion (or at least something that updates every few seconds), and running in the background, so that the same page can be used to convert further files.
Now I'm already stuck, because the conversion just isn't working. I know that the preceding code should be fine, since it makes it all the way to this if statement above, and no errors are being throw up by the PHP. However, my log output shows :
ffmpeg version 0.8.10-6:0.8.10-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
built on Feb 6 2014 20:59:46 with gcc 4.8.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
-loglevel: No such file or directoryWhich also leads me to another question : If ffmpeg is deprecated, and avconv is the way to do, can I still use the exec code in my PHP as is (replacing the ffmpeg bit with avconv) ? From what I've seen so far on the avconv page, it looks similar, but I can't be certain that it's exactly the same.
So my two questions : Why isn't the file being converted, and is there any change in the syntax between avconv and ffmpeg ?
-
Why does PowerShell closes ff-prompt.bat before executing my commands
9 mars 2014, par sebastianOkay guys looks like I have another question to ask, which is kind of related to my last question, which can be found on here : How to start ffprobe with Windows PowerShell. There I was asking how to start ffprobe with Windows PowerShell and after trying out a few things I got it, well lets say, started for a second before it closes again.
I tried it with following commands in PowerShell :$env:Path = ';C:\Users\Administrator\bin\'
$title = "A_Day_for_Cake_and_Accidents"
Start-Process ff-prompt.bat -ArgumentList "ffprobe -show_streams -select_streams v -print_format xml -count_frames C:\Users\Administrator\Desktop\dcp_bearbeitet\$title\$title.mov > C:\Users\Administrator\Desktop\dcp_bearbeitet\$title\totalframes.xml"The result, and that is the strange thing, is the xml file with only the standard text from the
ff-prompt.bat
, which looks like this :C :\Users\Administrator>ECHO OFF
ffmpeg version N-60959-g669043d
built on Feb 27 2014 22:01:58 with gcc 4.8.2 (GCC)
configuration : —enable-gpl —enable-version3 —disable-w32threads —enable-avisynth —enable-bzlib —enable-fontconfig —enable-frei0r —enable-gnutls —enable-iconv —enable-libass —enable-libbluray —enable-libcaca —enable-libfreetype —enable-libgsm —enable-libilbc —enable-libmodplug —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libopus —enable-librtmp —enable-libschroedinger —enable-libsoxr —enable-libspeex —enable-libtheora —enable-libtwolame —enable-libvidstab —enable-libvo-aacenc —enable-libvo-amrwbenc —enable-libvorbis —enable-libvpx —enable-libwavpack —enable-libx264 —enable-libx265 —enable-libxavs —enable-libxvid —enable-zlib
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
For help run : ffmpeg -h
For formats run : ffmpeg -formats | more
For codecs run : ffmpeg -codecs | more
Current directory is now : "C :\Users\Administrator\bin"
The bin directory has been added to PATHMy first thought was, that it did not work at all, but then I was wondering why I get an XML file when it is not working at all. PowerShell executes the
ff-prompt.bat
for maybe a second, before PowerShell shuts down theff-prompt.bat
again without doing half of my commands. Does anybody know why ff-prompt gets closed before executing all of my commands ?EDIT : So what I tried is something that should execute it directly, but in fact I get a shitload of errors :
$title = "A_Day_for_Cake_and_Accidents"
$Cmd = ‘C:\Users\Administrator\ffmpeg\bin\ffprobe.exe’
$Arg1 = ’ffprobe '
$Arg2 = ‘-show_streams ’
$Arg3 = ‘-select_streams v '
$Arg4 = ‘-print_format xml '
$Arg5 = ‘-count_frames '
$Arg6 = "C:\Users\Administrator\Desktop\dcp_bearbeitet\$title\$title.mov >"
$Arg7 = " C:\Users\Administrator\Desktop\dcp_bearbeitet\$title\totalframes.xml"
& $Cmd $Arg1 $Arg2 $Arg3 $Arg4 $Arg5 $Arg6 $Arg7Error message(s) I get :
"ffprobe.exe
Failed to set value '-select_streams v ' for option 'show_streams ' : Option not found"The problem I am facing now is that
-show_streams
does not get a value, so maybe that is the reason why he uses the next parameter as a value, is there anything I can do ? -
ffmpeg not work with PHP exec()
14 mars 2014, par user27133I need to convert video and create image using ffmpeg. I downloaded this package from zeranoe for windows 8 64x and put in
c:/ffmpeg
folder.I check for ffmpeg installed in windows using cmd :
ffmpeg -version
ffmpeg version N-60959-g669043d
built on Feb 27 2014 22:07:15 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avis
ynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable
-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype
--enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enabl
e-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-lib
opus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspee
x --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aace
nc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpac
k --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-z
lib
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100Now I test convert video using php :
$raw_video_path = 'C:\xampp\htdocs\video\ff\examples\5.flv';
$new_flv = DIRNAME(DIRNAME(__FILE__)).'/ff/examples/video/2654.flv';
$new_png = DIRNAME(DIRNAME(__FILE__)).'/ff/examples/video/2647-resampled.jpg';
@exec("ffmpeg -i ".$raw_video_path." -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv ".$new_flv."");
@exec("ffmpeg -itsoffset -4 -i ".$new_flv." -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 ".$new_png." ");Now, This not work for me !! How do I can fix this ?
For ffmpeg, I need to install/active php ffmpeg extension ?