FFMPEG PHP Windows Errors

Any other question that don't fit into the other support categorizes.
Post Reply
C0nw0nk
Posts: 17
Joined: Tue Aug 26, 2014 3:32 pm

FFMPEG PHP Windows Errors

Post by C0nw0nk » Tue Aug 26, 2014 3:43 pm

So i use ffmpeg in a windows server 2008 enviorment executed by php and the following is my command line but i get some strange errors.

My command line :

Code: Select all

if(substr(PHP_OS, 0, 3) == "WIN")
{
$log->input = "\"".$config->get('path_ffmpeg', '/usr/bin/ffmpeg')."\" -y -i $pathSource -strict experimental -acodec aac -ac 2 -ab 192k -s $wxh -aspect 16:9 -r 24000/1001 -vcodec libx264 -b:v ".$vbit."k -minrate ".$min."k -maxrate ".$max."k -bufsize ".$buff."K -crf $crf -preset veryslow -f mp4 -threads 0 -movflags +faststart $pathDest 2>&1";

exec($log->input, $log->output);
}
Errors are as follows :
Generating a mp4 360p video file. Input's and output's are as follows.

Input :

Code: Select all

"C:/server/ffmpeg/bin/ffmpeg.exe" -i C:\server\websites\ps\public_www/media/com_hwdmediashare/files/3c/51/b9/65a64d5a892839b68b10abee903402dc.mp4 2>&1
Output :

Code: Select all

ffmpeg version N-65126-gdc315cd Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 30 2014 22:34:06 with gcc 4.8.3 (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-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --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-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 94.100 / 52. 94.100
  libavcodec     55. 71.100 / 55. 71.100
  libavformat    55. 50.100 / 55. 50.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000002b07ce0] moov atom not found
C:\server\websites\ps\public_www/media/com_hwdmediashare/files/3c/51/b9/65a64d5a892839b68b10abee903402dc.mp4: Invalid data found when processing input

C0nw0nk
Posts: 17
Joined: Tue Aug 26, 2014 3:32 pm

Re: FFMPEG PHP Windows Errors

Post by C0nw0nk » Wed Aug 27, 2014 5:47 am

Another error i get recently is with adding a logo to converted videos.

Input :

Code: Select all

"C:/server/ffmpeg/bin/ffmpeg.exe" -y -i C:\server\websites\ps\public_www/media/com_hwdmediashare/files/63/24/04/7262ccef6d0c48a5aabbc97a9ca413c4.mp4 -vf "movie=/server/websites/ps/public_www/images/video.png [logo];[in][logo] overlay=W-w-10:H-h-10 [out]" -vcodec libx264 -acodec copy -f mp4 C:\server\websites\ps\public_www/media/com_hwdmediashare/files/63/24/04/ed166a40a62be1227359d7197a439bc3.tmp 2>&1
Output :

Code: Select all

ffmpeg version N-65126-gdc315cd Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 30 2014 22:34:06 with gcc 4.8.3 (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-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --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-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      52. 94.100 / 52. 94.100
  libavcodec     55. 71.100 / 55. 71.100
  libavformat    55. 50.100 / 55. 50.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\server\websites\ps\public_www/media/com_hwdmediashare/files/63/24/04/7262ccef6d0c48a5aabbc97a9ca413c4.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.50.100
  Duration: 00:07:58.10, start: 0.000000, bitrate: 677 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 479 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      rotate          : 90
      handler_name    : VideoHandler
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[libx264 @ 000000000033f680] using SAR=1/1
[libx264 @ 000000000033f680] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 000000000033f680] profile High, level 3.0
[libx264 @ 000000000033f680] 264 - core 142 r2431 ac76440 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - 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=3 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=23 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
Output #0, mp4, to 'C:\server\websites\ps\public_www/media/com_hwdmediashare/files/63/24/04/ed166a40a62be1227359d7197a439bc3.tmp':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.50.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc (default)
    Metadata:
      rotate          : 90
      handler_name    : VideoHandler
      encoder         : Lavc55.71.100 libx264
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, 192 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   74 fps=0.0 q=28.0 size=      72kB time=00:00:03.15 bitrate= 187.3kbits/s    
frame=  149 fps=143 q=28.0 size=     247kB time=00:00:06.29 bitrate= 321.0kbits/s    
frame=  230 fps=147 q=28.0 size=     428kB time=00:00:09.65 bitrate= 363.3kbits/s    
frame=  311 fps=150 q=28.0 size=     620kB time=00:00:13.04 bitrate= 389.4kbits/s    
frame=  394 fps=152 q=28.0 size=     807kB time=00:00:16.50 bitrate= 400.5kbits/s    
frame=  483 fps=156 q=28.0 size=    1004kB time=00:00:20.22 bitrate= 406.7kbits/s    
frame=  574 fps=159 q=28.0 size=    1220kB time=00:00:24.00 bitrate= 416.4kbits/s    
frame=  662 fps=160 q=28.0 size=    1415kB time=00:00:27.67 bitrate= 418.8kbits/s    
frame=  746 fps=160 q=28.0 size=    1593kB time=00:00:31.18 bitrate= 418.4kbits/s    
frame=  826 fps=160 q=28.0 size=    1813kB time=00:00:34.52 bitrate= 430.2kbits/s    
frame=  904 fps=159 q=28.0 size=    1999kB time=00:00:37.77 bitrate= 433.4kbits/s    
frame=  988 fps=160 q=28.0 size=    2202kB time=00:00:41.28 bitrate= 436.9kbits/s    
frame= 1063 fps=158 q=28.0 size=    2407kB time=00:00:44.41 bitrate= 443.9kbits/s    
frame= 1139 fps=158 q=28.0 size=    2624kB time=00:00:47.57 bitrate= 451.7kbits/s    
frame= 1207 fps=156 q=28.0 size=    2876kB time=00:00:50.41 bitrate= 467.4kbits/s    
frame= 1273 fps=154 q=28.0 size=    3145kB time=00:00:53.17 bitrate= 48

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: FFMPEG PHP Windows Errors

Post by llogan » Wed Aug 27, 2014 6:58 pm

C0nw0nk wrote:Another error i get recently is with adding a logo to converted videos.
What is the actual error? I don't see it in your console output unless I missed something. Is it the rotate metadata? (iDevices may parse that).
C0nw0nk wrote:Input :

Code: Select all

"C:/server/ffmpeg/bin/ffmpeg.exe" -y -i C:\server\websites\ps\public_www/media/com_hwdmediashare/files/63/24/04/7262ccef6d0c48a5aabbc97a9ca413c4.mp4 -vf "movie=/server/websites/ps/public_www/images/video.png [logo];[in][logo] overlay=W-w-10:H-h-10 [out]" -vcodec libx264 -acodec copy -f mp4 C:\server\websites\ps\public_www/media/com_hwdmediashare/files/63/24/04/ed166a40a62be1227359d7197a439bc3.tmp 2>&1
You don't need the movie source filter (and you forgot to provide explicit mappings which is a good thing to do):

Code: Select all

ffmpeg -i video.mp4 -i logo.png -filter_complex "[0:v][1:v]overlay=W-w-10:H-h-10[out]" -map "[out]" -map 0:a -vcodec libx264 -acodec copy output.mp4

C0nw0nk
Posts: 17
Joined: Tue Aug 26, 2014 3:32 pm

Re: FFMPEG PHP Windows Errors

Post by C0nw0nk » Wed Aug 27, 2014 7:16 pm

Well the logo should be added to the video output but it can not add it. The guys who made the extension i am using is http://www.hwdmediashare.co.uk and for some reason it just wont add the logo to the generated video, But yet all other video conversions do it just fine i have only had a select few that refuse to do so.

So i am assuming it is something to do with their ffmpeg command line that i should alter/change, Since it seems to just close/stop when adding the logo to the media file.

Also why is adding "-map 0:a" a good thing to do please elaborate ?

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: FFMPEG PHP Windows Errors

Post by llogan » Wed Aug 27, 2014 7:42 pm

C0nw0nk wrote:Also why is adding "-map 0:a" a good thing to do please elaborate ?
You don't have to. It's up to you. I simply prefer not to rely on the default stream selection behavior, but you may benefit from using the defaults.

C0nw0nk
Posts: 17
Joined: Tue Aug 26, 2014 3:32 pm

Re: FFMPEG PHP Windows Errors

Post by C0nw0nk » Fri Aug 29, 2014 7:48 pm

Sorry if i have made a mistake but i can not see what i am missing or perhaps i am blind but changing the commnad line to this.

Code: Select all

$log->input = "\"".$config->get('path_ffmpeg', '/usr/bin/ffmpeg')."\" -y -i $pathSource \"C:".$logo."\" -filter_complex \"[0:v][1:v]overlay=".$overlay."[out]\" -map \"[out]\" -map 0:a -vcodec $vcodec -acodec copy -f $format $pathDest 2>&1";
Made this my input and my output error.

Input :

Code: Select all

"C:/server/ffmpeg/bin/ffmpeg.exe" -y -i C:\server\websites\ps\public_www/media/com_hwdmediashare/files/1b/74/36/758fa21e8c0caea3e3d807cc8cdeb617.mp4 "C:/server/websites/ps/public_www/images/video.png" -filter_complex "[0:v][1:v]overlay=W-w-10:H-h-10[out]" -map "[out]" -map 0:a -vcodec libx264 -acodec copy -f mp4 C:\server\websites\ps\public_www/media/com_hwdmediashare/files/1b/74/36/1bc3a9c638913d3d862a31dc1bed3abd.tmp 2>&1
Output :

Code: Select all

ffmpeg version N-65916-g9e8ab36 Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug 26 2014 22:10:59 with gcc 4.8.3 (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-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --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-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  0.101 / 56.  0.101
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\server\websites\ps\public_www/media/com_hwdmediashare/files/1b/74/36/758fa21e8c0caea3e3d807cc8cdeb617.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.3.100
  Duration: 00:01:58.66, start: 0.000000, bitrate: 614 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 540x360 [SAR 32:27 DAR 16:9], 606 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 2 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Invalid file index 1 in filtergraph description [0:v][1:v]overlay=W-w-10:H-h-10[out].
I can not see what has gone wrong ?

Post Reply
'