At least one output file must be specified - php

I am using this command in ffmpeg
ffmpeg -i test.flv -i /var/www/phpvibe/logo.gif -filter_complex "scale=1200:-1,overlay=0:0" -s 1280x720 -vcodec libx264 -s 640x360 -movflags test.mp4 2>&1
But i am getting this
string(42) "At least one output file must be specified"
updated:-
php code:-
$output ='{ffmpeg-cmd} -i {input} -i /var/www/phpvibe/logo.gif -filter_complex "scale=1200:-1,overlay=0:0" -s 1280x720 -vcodec libx264 -s {ffmpeg-vsize} -threads 4 -movflags {output}.mp4 2>&1';
Complete output:-
array(33) {
[0]=>
string(83) "ffmpeg version git-2015-05-11-94c20de Copyright (c) 2000-2015 the FFmpeg developers"
[1]=>
string(51) " built with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)"
[2]=>
string(243) " configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3"
[3]=>
string(40) " libavutil 54. 23.101 / 54. 23.101"
[4]=>
string(40) " libavcodec 56. 38.100 / 56. 38.100"
[5]=>
string(40) " libavformat 56. 32.100 / 56. 32.100"
[6]=>
string(40) " libavdevice 56. 4.100 / 56. 4.100"
[7]=>
string(40) " libavfilter 5. 16.101 / 5. 16.101"
[8]=>
string(40) " libswscale 3. 1.101 / 3. 1.101"
[9]=>
string(40) " libswresample 1. 1.100 / 1. 1.100"
[10]=>
string(40) " libpostproc 53. 3.100 / 53. 3.100"
[11]=>
string(47) "Trailing options were found on the commandline."
[12]=>
string(31) "Input #0, flv, from 'test.flv':"
[13]=>
string(11) " Metadata:"
[14]=>
string(28) " audiosize : 150117"
[15]=>
string(26) " canSeekToEnd : true"
[16]=>
string(29) " datasize : 1015662"
[17]=>
string(26) " hasAudio : true"
[18]=>
string(27) " hasCuePoints : false"
[19]=>
string(26) " hasKeyframes : true"
[20]=>
string(26) " hasMetadata : true"
[21]=>
string(26) " hasVideo : true"
[22]=>
string(24) " lasttimestamp : 42"
[23]=>
string(72) " metadatacreator : flvtool++ (Facebook, Motion project, dweatherford)"
[24]=>
string(25) " totalframes : 229"
[25]=>
string(28) " videosize : 856032"
[26]=>
string(59) " Duration: 00:00:42.27, start: 0.066000, bitrate: 192 kb/s"
[27]=>
string(124) " Stream #0:0: Video: h264 (High), yuv420p, 176x144 [SAR 12:11 DAR 4:3], 165 kb/s, 30.30 fps, 29.97 tbr, 1k tbn, 59.94 tbc"
[28]=>
string(64) " Stream #0:1: Audio: aac (LC), 8000 Hz, stereo, fltp, 29 kb/s"
[29]=>
string(48) "Input #1, gif, from '/var/www/phpvibe/logo.gif':"
[30]=>
string(29) " Duration: N/A, bitrate: N/A"
[31]=>
string(67) " Stream #1:0: Video: gif, bgra, 90x55, 100 tbr, 100 tbn, 100 tbc"
[32]=>
string(42) "At least one output file must be specified"
}
int(1)

You put a -movflags without specifying a value before your output file. It thinks test.mp4 is the flag value hence your problem.

Related

PHP exec ping doesn't properly work on Unix server

I want to ping a range of ips on the server that runs Unix
exec('ping -c 4 '.$ip, $output, $return_var);
Problem is that, it doesn't properly ping the ips that actually gets pinged but can't be found on ns_lookup in cmd. what I mean is that some of these ips gets pinged and some not. On localhost, that runs windows, it works fine.
this is the $output array I get when I ping that ip on server (runs Unix):
array(5) {
[0]=>
string(54) "PING 91.208.144.2 (91.208.144.2) 56(84) bytes of data."
[1]=>
string(0) ""
[2]=>
string(36) "--- 91.208.144.2 ping statistics ---"
[3]=>
string(64) "4 packets transmitted, 0 received, 100% packet loss, time 2999ms"
[4]=>
string(0) ""
}
that's the $output array I get when I ping it on localhost (on Windows):
array(11) {
[0]=>
string(0) ""
[1]=>
string(43) "Pinging 91.208.144.2 with 32 bytes of data:"
[2]=>
string(50) "Reply from 91.208.144.2: bytes=32 time=9ms TTL=248"
[3]=>
string(51) "Reply from 91.208.144.2: bytes=32 time=10ms TTL=248"
[4]=>
string(51) "Reply from 91.208.144.2: bytes=32 time=11ms TTL=248"
[5]=>
string(50) "Reply from 91.208.144.2: bytes=32 time=8ms TTL=248"
[6]=>
string(0) ""
[7]=>
string(33) "Ping statistics for 91.208.144.2:"
[8]=>
string(56) " Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),"
[9]=>
string(46) "Approximate round trip times in milli-seconds:"
[10]=>
string(48) " Minimum = 8ms, Maximum = 11ms, Average = 9ms"
}
exec and ping is available on server cuz it works perfect with the ips that gets pinged and can be looked up in cmd.
Any ideas ?

Incorrect codec parameters for webm conversion

I am using a shared hosting server with ffmpeg installed. i have been told they cant upgrade the version I have. I am trying to convert video files to html5 formats. When I try to convert to webm, I get below error. Can anyone help with this problem?
exec("/usr/bin/ffmpeg -i eliza.mp4 -acodec copy -vcodec copy 2>&1 video.webm");
array(29) { [0]=> string(67) "FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers"
[1]=> string(74) " built on Jan 29 2012 23:55:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)" [2]=>
string(649) " configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
--mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64
-mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac
--enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc
--enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3
--enable-x11grab" [3]=> string(35) " libavutil 50.15. 1 / 50.15. 1" [4]=> string(35) "
libavcodec 52.72. 2 / 52.72. 2" [5]=> string(35) " libavformat 52.64. 2 / 52.64. 2"
[6]=> string(35) " libavdevice 52. 2. 0 / 52. 2. 0" [7]=> string(35) " libavfilter 1.19. 0 / 1.19. 0" [8]=>
string(35) " libswscale 0.11. 0 / 0.11. 0" [9]=> string(35) " libpostproc 51. 2. 0 / 51. 2. 0" [10]=>
string(52) "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'eliza.mp4':" [11]=> string(11) " Metadata:" [12]=>
string(26) " major_brand : mp42" [13]=> string(23) " minor_version : 0" [14]=> string(35) " compatible_brands:
mp42isomavc1" [15]=> string(48) " encoder : HandBrake 0.9.4 2009112300" [16]=> string(59) " Duration:
00:00:05.56, start: 0.000000, bitrate: 551 kb/s" [17]=> string(94) " Stream #0.0(und): Video: h264,
yuv420p, 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc" [18]=> string(62) " Stream #0.1(eng):
Audio: aac, 48000 Hz, mono, s16, 83 kb/s" [19]=> string(72) "[webm # 0x7200a0]Only VP8 video and
Vorbis audio are supported for WebM." [20]=> string(33) "Output #0, webm, to 'video.webm':"
[21]=> string(11) " Metadata:" [22]=> string(33) " encoder : Lavf52.64.2" [23]=> string(89) "
Stream #0.0(und): Video: libx264, yuv420p, 560x320, q=2-31, 465 kb/s, 90k tbn, 30 tbc" [24]=>
string(61) " Stream #0.1(eng): Audio: libfaac, 48000 Hz, mono, 83 kb/s" [25]=> string(15)
"Stream mapping:" [26]=> string(21) " Stream #0.0 -> #0.0" [27]=> string(21) " Stream #0.1 ->
#0.1" [28]=> string(72) "Could not write header for output file #0 (incorrect codec parameters ?)" }
According to your own error log:
[webm # 0x7200a0] Only VP8 video and Vorbis audio are supported for WebM
Your input file is H.264/AAC and you're trying to copy the source codecs using -acodec copy -vcodec copy instead of converting them to VP8/Vorbis.
You can try to re-encode the file. Unfortunately the FFmpeg version is really outdated. The latest release is 2.6.2 (vs. 0.6.5).

php getopt within bash script

I wrote a bash script to use a php script. The bash script creates an arguments list for the php script (as oppposed to plain passing the bash script's arguments to the php script.
My problem is that if I call the php script directly with the argument line generated by the bash script, (php) getopt works fine. Howhever, when the bash script attempts to execute the same line from within the script, (php) getopt fails!
here is the bash script:
#!/bin/sh
export PROFILE=$1
export TS_FILE=$2
if [ ! -z $PROFILE ] && [ -e $PROFILE ]; then
source $PROFILE
else
source default_profile
fi
if [ ! -z $TS_FILE ] && [ -e $TS_FILE ]; then
source $TS_FILE
else
source default_ts
fi
# create args for php script
ARGS_PHP="--agent \"$AGENT\" --sig \"$SIG_FILE\" --cie \"$CMPGY\" --super \"$SUPERVISOR\" --type \"$WRK_TYPE\" -d $DATES"
for nb_days in $(seq 0 $((DATES-1))); do
ARGS_PHP="$ARGS_PHP --date ${DATE_DATE[$nb_days]} --label \"${DATE_LABEL[$nb_days]}\" --as ${DATE_START[$i]} --pe ${DATE_END[$i]} --dt ${DATE_TOTAL[$i]}"
done
#echo ./script.php "$ARGS_PHP"
./script.php $ARGS_PHP
and here is the php script:
#!/usr/bin/php
<?php
$shortopts = "";
$shortopts .= "d:"; // Required value
$longopts = array(
"agent:", // Required value
"sig:", // Required value
"cie:", // Required value
"super:", // Required value
"type:", // Required value
"date:", // Required value
"label:", // Required value
"as:", // Required value
"pe:", // Required value
"dt:", // Required value
);
$options = getopt($shortopts, $longopts);
var_dump($options);
//var_dump($argv);
?>
If I execute the bash script as intended, I get:
array(1) {
["agent"]=>
string(5) ""Name"
}
If I uncomment the "echo" line and comment the php script call, I get:
./script.php --agent "Name Surname" --sig "../../path/sig.png" --cie "Cie Name" --super "Name Surname" --type "String" -d 5 --date 2014-03-31 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30 --date 2014-04-01 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30 --date 2014-04-02 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30 --date 2014-04-03 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30 --date 2014-04-04 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30
If I execute that line, I get:
array(11) {
["agent"]=>
string(12) "Name Surname"
["sig"]=>
string(18) "../../path/sig.png"
["cie"]=>
string(8) "Cie Name"
["super"]=>
string(12) "Name Surname"
["type"]=>
string(6) "String"
["d"]=>
string(1) "5"
["date"]=>
array(5) {
[0]=>
string(10) "2014-03-31"
[1]=>
string(10) "2014-04-01"
[2]=>
string(10) "2014-04-02"
[3]=>
string(10) "2014-04-03"
[4]=>
string(10) "2014-04-04"
}
["label"]=>
array(5) {
[0]=>
string(16) "Some label Value"
[1]=>
string(16) "Some label Value"
[2]=>
string(16) "Some label Value"
[3]=>
string(16) "Some label Value"
[4]=>
string(16) "Some label Value"
}
["as"]=>
array(5) {
[0]=>
string(4) "9:00"
[1]=>
string(4) "9:00"
[2]=>
string(4) "9:00"
[3]=>
string(4) "9:00"
[4]=>
string(4) "9:00"
}
["pe"]=>
array(5) {
[0]=>
string(5) "17:00"
[1]=>
string(5) "17:00"
[2]=>
string(5) "17:00"
[3]=>
string(5) "17:00"
[4]=>
string(5) "17:00"
}
["dt"]=>
array(5) {
[0]=>
string(4) "7:30"
[1]=>
string(4) "7:30"
[2]=>
string(4) "7:30"
[3]=>
string(4) "7:30"
[4]=>
string(4) "7:30"
}
}
If I comment the var_dump($options) and uncomment the var_dump($argv) I get the same behavior from the php script from the command line as from the bash script. Which is an array of all the (sub-)words from the $ARGS_PHP bash variable.
if I quote "$ARGS_PHP", I get:
array(0) {
}
with $options and
array(2) {
[0]=>
string(16) "./script.php"
[1]=>
string(490) "--agent "Name Surname" --sig "../../path/sig.png" --cie "Cie Name" --super "Name Surname" --type "String" -d 5 --date 2014-03-31 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30 --date 2014-04-01 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30 --date 2014-04-02 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30 --date 2014-04-03 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30 --date 2014-04-04 --label "Some label Value" --as 9:00 --pe 17:00 --dt 7:30"
}
form $argv. How can I get the php script to use getopt properly when I launch from a bash script?!?!?!
PS:
default_profile:
export AGENT="Name Surname"
export SIG_FILE="../../path/sig.png"
default_ts:
#!/bin/sh
# default dummy values for TS (testing purposes)
# date solver. Default fills current week TS starting monday to friday
CURRENT=$(date +%u)
DOW=( "monday" "tuesday" "wednesday" "thursday" "friday")
function solve_date(){
THIS_DOW=$1
if [ $CURRENT -eq $THIS_DOW ];then
date +%F
elif [ $CURRENT -gt $1 ];then
date --date "last ${DOW[$((THIS_DOW-1))]}" +%F
else
date --date "next ${DOW[$((THIS_DOW-1))]}" +%F
fi
}
export DATES=$((5))
export CMPGY="Cie Name"
export SUPERVISOR="Name Surname"
export WRK_TYPE="String"
DATE_DATE[0]=$(solve_date 1)
DATE_LABEL[0]="Some label Value"
DATE_START[0]="9:00"
DATE_END[0]="17:00"
DATE_TOTAL[0]="7:30"
DATE_DATE[1]=$(solve_date 2)
DATE_LABEL[1]="Some label Value"
DATE_START[1]="9:00"
DATE_END[1]="17:00"
DATE_TOTAL[1]="7:30"
DATE_DATE[2]=$(solve_date 3)
DATE_LABEL[2]="Some label Value"
DATE_START[2]="9:00"
DATE_END[2]="17:00"
DATE_TOTAL[2]="7:30"
DATE_DATE[3]=$(solve_date 4)
DATE_LABEL[3]="Some label Value"
DATE_START[3]="9:00"
DATE_END[3]="17:00"
DATE_TOTAL[3]="7:30"
DATE_DATE[4]=$(solve_date 5)
DATE_LABEL[4]="Some label Value"
DATE_START[4]="9:00"
DATE_END[4]="17:00"
DATE_TOTAL[4]="7:30"
export DATE_DATE
export DATE_LABEL
export DATE_START
export DATE_END
export DATE_TOTAL
Because your list of arguments is all contained in a single string, bash is passing the whole string to php as a single argument, then PHP splits it on a space. The easiest way to fix is to call like this:
bash -c "php script.php $ARGS_PHP"
PHP can then evaluate the string of arguments as intended.

ffmpeg: converting to mp4 with error: unsupported codec

i am converting a videofile with the latest version of ffmpeg in php:
exec("ffmpeg -y -i capture.wmv capture.mp4 2>&1", $output);
var_dump($output);
This is the result:
array(21) {
[0]=>
string(99) "FFmpeg version SVN-r0.5.9-4:0.5.9-0ubuntu0.10.04.3, Copyright (c) 2000-2009 Fabrice Bellard, et al."
[1]=>
string(451) " configuration: --extra-version=4:0.5.9-0ubuntu0.10.04.3 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static"
[2]=>
string(35) " libavutil 49.15. 0 / 49.15. 0"
[3]=>
string(35) " libavcodec 52.20. 1 / 52.20. 1"
[4]=>
string(35) " libavformat 52.31. 0 / 52.31. 0"
[5]=>
string(35) " libavdevice 52. 1. 0 / 52. 1. 0"
[6]=>
string(35) " libavfilter 0. 4. 0 / 0. 4. 0"
[7]=>
string(35) " libswscale 0. 7. 1 / 0. 7. 1"
[8]=>
string(35) " libpostproc 51. 2. 0 / 51. 2. 0"
[9]=>
string(43) " built on Jan 24 2013 19:42:59, gcc: 4.4.3"
[10]=>
string(34) "Input #0, asf, from 'capture.wmv':"
[11]=>
string(60) " Duration: 00:04:11.45, start: 3.000000, bitrate: 1755 kb/s"
[12]=>
string(62) " Stream #0.0: Audio: wmav2, 44100 Hz, stereo, s16, 128 kb/s"
[13]=>
string(82) " Stream #0.1: Video: wmv2, yuv420p, 1280x720, 1600 kb/s, 1k tbr, 1k tbn, 1k tbc"
[14]=>
string(33) "Output #0, mp4, to 'capture.mp4':"
[15]=>
string(83) " Stream #0.0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 200 kb/s, 90k tbn, 1k tbc"
[16]=>
string(62) " Stream #0.1: Audio: 0x0000, 44100 Hz, stereo, s16, 64 kb/s"
[17]=>
string(15) "Stream mapping:"
[18]=>
string(21) " Stream #0.1 -> #0.0"
[19]=>
string(21) " Stream #0.0 -> #0.1"
[20]=>
string(40) "Unsupported codec for output stream #0.1"
}
I need a standard mp4-file for playing in web with html5. Where could be the problem? Is the codex not installed? Or is something wrong with the console command?
EDIT:
After using a static build i try to convert a wmv to mp4 with
exec("/www/htdocs/xxxx/video/ffmpeg -y -i capture.wmv capture.mp4 2>&1", $output);
The result file has a size of only some bytes - this is the output:
array(40) {
[0]=>
string(77) "ffmpeg version N-49805-gfd6a021 Copyright (c) 2000-2013 the FFmpeg developers"
[1]=>
string(61) " built on Feb 11 2013 05:23:18 with gcc 4.6 (Debian 4.6.3-1)"
[2]=>
string(609) " configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx"
[3]=>
string(40) " libavutil 52. 17.101 / 52. 17.101"
[4]=>
string(40) " libavcodec 54. 91.102 / 54. 91.102"
[5]=>
string(40) " libavformat 54. 62.100 / 54. 62.100"
[6]=>
string(40) " libavdevice 54. 3.103 / 54. 3.103"
[7]=>
string(40) " libavfilter 3. 37.101 / 3. 37.101"
[8]=>
string(40) " libswscale 2. 2.100 / 2. 2.100"
[9]=>
string(40) " libswresample 0. 17.102 / 0. 17.102"
[10]=>
string(40) " libpostproc 52. 2.100 / 52. 2.100"
[11]=>
string(54) "Guessed Channel Layout for Input Stream #0.0 : stereo"
[12]=>
string(34) "Input #0, asf, from 'capture.wmv':"
[13]=>
string(11) " Metadata:"
[14]=>
string(32) " WMFSDKNeeded : 0.0.0.0000"
[15]=>
string(32) " DeviceConformanceTemplate: #"
[16]=>
string(37) " WMFSDKVersion : 12.0.7601.17514"
[17]=>
string(23) " IsVBR : 0"
[18]=>
string(60) " Duration: 00:04:13.40, start: 0.000000, bitrate: 1742 kb/s"
[19]=>
string(90) " Stream #0:0(ger): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 128 kb/s"
[20]=>
string(125) " Stream #0:1(ger): Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 1280x720, 1600 kb/s, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 1k tbc"
[21]=>
string(35) "[libx264 # 0x2f082e0] using SAR=1/1"
[22]=>
string(63) "[libx264 # 0x2f082e0] MB rate (3600000) > level limit (2073600)"
[23]=>
string(88) "[libx264 # 0x2f082e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX"
[24]=>
string(45) "[libx264 # 0x2f082e0] profile High, level 5.2"
[25]=>
string(684) "[libx264 # 0x2f082e0] 264 - core 129 r2230 1cffe9f - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00"
[26]=>
string(33) "Output #0, mp4, to 'capture.mp4':"
[27]=>
string(11) " Metadata:"
[28]=>
string(32) " WMFSDKNeeded : 0.0.0.0000"
[29]=>
string(32) " DeviceConformanceTemplate: #"
[30]=>
string(37) " WMFSDKVersion : 12.0.7601.17514"
[31]=>
string(23) " IsVBR : 0"
[32]=>
string(35) " encoder : Lavf54.62.100"
[33]=>
string(122) " Stream #0:0(ger): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 16k tbn, 1k tbc"
[34]=>
string(90) " Stream #0:1(ger): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, s16, 128 kb/s"
[35]=>
string(15) "Stream mapping:"
[36]=>
string(39) " Stream #0:1 -> #0:0 (wmv2 -> libx264)"
[37]=>
string(45) " Stream #0:0 -> #0:1 (wmav2 -> libvo_aacenc)"
[38]=>
string(31) "Press [q] to stop, [?] for help"
[39]=>
string(96) "frame= 158 fps=0.0 q=33.0 size= 0kB time=00:00:00.10 bitrate= 3.6kbits/s dup=155 drop=0"
}
slhck - thanks for your tipps - do you see the problem?
Your FFmpeg version is 0.5.9, which is from a branch that was cut in 2009 (!). Chances are the problem is due to the ancient release and there's no point trying to troubleshoot something which is entirely unsupported. As far as I can tell FFmpeg can't find a proper audio codec to encode the video with. You don't have any external AAC or MP3 encoder as well.
In any case: Install a newer version. Do this by either compiling it yourself, or downloading a static build.
To produce a HTML5-ready MP4 video, you'd probably explicitly choose an H.264-encoded video with the Baseline profile (to suit mobile devices) and AAC audio:
ffmpeg -i capture.wmv -c:v libx264 -profile:v baseline -c:a aac -strict experimental -b:a 192k out.mp4
To change the video quality, add the -crf option, with a value between 18–28 (23 is default). Lower means better quality. See the x264 Encoding Guide on the FFmpeg Wiki for more info.
Your video should contain the MOOV atom at the beginning of the file, which would allow your users to start streaming the contents immediately (otherwise they'd have to download the entire file). You can set this while encoding:
ffmpeg -i [stuff from above…] -movflags faststart out.mp4
If you have FFmpeg with FAAC support (check with ffmpeg -codecs | grep libfaac), you can also use the following, similar to above:
ffmpeg -i -c:v libx264 -profile:v baseline -c:a libfaac -q:a 100 out.mp4
Here, you'd get VBR AAC audio of better quality instead of the fixed bitrate stream above. The quality is in percent, and 100 is the default.

-vf unrecognized with php exec() function

I am using php to create a video with fade effects. But exec() function gives following output:
array(19) {
[0]=>
string(67) "FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers"
[1]=>
string(74) " built on Dec 4 2010 15:35:31 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)"
[2]=>
string(649) " configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab"
[3]=>
string(35) " libavutil 50.15. 1 / 50.15. 1"
[4]=>
string(35) " libavcodec 52.72. 2 / 52.72. 2"
[5]=>
string(35) " libavformat 52.64. 2 / 52.64. 2"
[6]=>
string(35) " libavdevice 52. 2. 0 / 52. 2. 0"
[7]=>
string(35) " libavfilter 1.19. 0 / 1.19. 0"
[8]=>
string(35) " libswscale 0.11. 0 / 0.11. 0"
[9]=>
string(35) " libpostproc 51. 2. 0 / 51. 2. 0"
[10]=>
string(122) "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/usr/slideshow/frame1.mp4':"
[11]=>
string(11) " Metadata:"
[12]=>
string(26) " major_brand : isom"
[13]=>
string(25) " minor_version : 512"
[14]=>
string(35) " compatible_brands: isomiso2mp41"
[15]=>
string(33) " encoder : Lavf52.64.2"
[16]=>
string(58) " Duration: 00:00:05.00, start: 0.000000, bitrate: 31 kb/s"
[17]=>
string(107) " Stream #0.0(und): Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 29
kb/s, 1 fps, 1 tbr, 1 tbn, 1 tbc"
[18]=>
string(24) "Unrecognized option 'vf'"
}
Why it is giving unrecognized option 'vf' while it works fine when run directly on server.My command is : "ffmpeg -i /usr/slideshow/frame1.mp4 -vf 'fade=out:0:5' /usr/slideshow/fade1.mp4"
I am executing it with exec() function. Why the error is coming and what should i use to apply filter to my input video. I am working on CentOS server.
Please guide me...
I found the answer i just tried the full path of ffmpeg directory where ffmpeg was installed and it worked...

Categories