Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2014-09-20 18:02:36

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

video resolution

Hey

How i can get video resolution with ffmpeg and php?

i try this

$ffmpeg=/my/path

cmd="$ffmpeg -i /path/to/video.mp4";

echo cmd;

what is wrong? i cant make it work sad

Offline

#2 2014-09-21 08:07:15

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: video resolution

exec('/usr/bin/ffmpeg -i /path/to/video.mp4', $output);
echo var_dump($output);

Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2014-09-21 12:44:52

thiva7
Member
Registered: 2011-04-30
Posts: 1,022

Re: video resolution

symtab wrote:
exec('/usr/bin/ffmpeg -i /path/to/video.mp4', $output);
echo var_dump($output);

This didnt work

need this on end of path

2>&1

so code have to be like that

exec('/usr/bin/ffmpeg -i /path/to/video.mp4'  2>&1 , $output);
echo var_dump($output);

Thank you Adrian smile


The output is

array(36) {
  [0]=>
  string(77) "ffmpeg version N-60572-gccc48b3 Copyright (c) 2000-2014 the FFmpeg developers"
  [1]=>
  string(79) "  built on Feb 19 2014 19:05:59 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)"
  [2]=>
  string(259) "  configuration: --prefix=/usr/local --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libx264 --enable-libxvid"
  [3]=>
  string(40) "  libavutil      52. 63.101 / 52. 63.101"
  [4]=>
  string(40) "  libavcodec     55. 52.101 / 55. 52.101"
  [5]=>
  string(40) "  libavformat    55. 32.100 / 55. 32.100"
  [6]=>
  string(40) "  libavdevice    55.  9.100 / 55.  9.100"
  [7]=>
  string(40) "  libavfilter     4.  1.102 /  4.  1.102"
  [8]=>
  string(40) "  libswscale      2.  5.101 /  2.  5.101"
  [9]=>
  string(40) "  libswresample   0. 17.104 /  0. 17.104"
  [10]=>
  string(40) "  libpostproc    52.  3.100 / 52.  3.100"
  [11]=>
  string(95) "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'my-path-to-video/18087.mp4':"
  [12]=>
  string(11) "  Metadata:"
  [13]=>
  string(26) "    major_brand     : isom"
  [14]=>
  string(25) "    minor_version   : 512"
  [15]=>
  string(39) "    compatible_brands: isomiso2avc1mp41"
  [16]=>
  string(41) "    creation_time   : 1970-01-01 00:00:00"
  [17]=>
  string(32) "    encoder         : Lavf53.5.0"
  [18]=>
  string(59) "  Duration: 00:18:50.86, start: 0.000000, bitrate: 601 kb/s"
  [19]=>
  string(162) "    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 422x238 [SAR 1:1 DAR 211:119], 512 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)"
  [20]=>
  string(13) "    Metadata:"
  [21]=>
  string(43) "      creation_time   : 1970-01-01 00:00:00"
  [22]=>
  string(36) "      handler_name    : VideoHandler"
  [23]=>
  string(95) "    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 55 kb/s (default)"
  [24]=>
  string(13) "    Metadata:"
  [25]=>
  string(43) "      creation_time   : 1970-01-01 00:00:00"
  [26]=>
  string(36) "      handler_name    : SoundHandler"
  [27]=>
  string(71) "    Stream #0:2(und): Data: none (rtp  / 0x20707472), 24 kb/s (default)"
  [28]=>
  string(13) "    Metadata:"
  [29]=>
  string(43) "      creation_time   : 2014-01-23 21:43:36"
  [30]=>
  string(45) "      handler_name    : GPAC ISO Hint Handler"
  [31]=>
  string(70) "    Stream #0:3(und): Data: none (rtp  / 0x20707472), 4 kb/s (default)"
  [32]=>
  string(13) "    Metadata:"
  [33]=>
  string(43) "      creation_time   : 2014-01-23 21:43:36"
  [34]=>
  string(45) "      handler_name    : GPAC ISO Hint Handler"
  [35]=>
  string(42) "At least one output file must be specified"

i need only this

[19]=>   string(162) "    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 422x238 [SAR 1:1 DAR 211:119], 512 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)"

how i can call only this string?

Last edited by thiva7 (2014-09-21 13:03:44)

Offline

#4 2014-09-21 14:40:47

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: video resolution

see libraries/framework/video.php


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

Board footer

Powered by FluxBB