2019年6月3日 星期一

FFmpeg 處理影片

FFmpeg 處理影片

FFmpeg 的全名是 Fast Forward MPEG(Moving Picture Experts Group)

====================
ffmpeg laravel

https://www.google.com.tw/search?newwindow=1&ei=SVPzXKKiM_CTr7wPt-yByAY&q=ffmpeg+laravel&oq=ffmpeg+lar&gs_l=psy-ab.1.0.0j0i203l5j0j0i30l3.291463.298240..300591...0.0..0.109.493.5j1......0....1..gws-wiz.......35i39j0i67.OvVZv1XDemU


====================
取得影音檔的時間長度
https://sites.google.com/site/ageechen/work_notes/notes-about-media-server/get-duration-of-media-file


由命令列

$ ffmpeg -i 0304.mp4 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,//

或是

$ ffmpeg -i 0304.mp4 2>&1 | grep Duration | awk '{print $2}' | tr -d ,

====================
ffmpeg

https://lnpcd.blogspot.com/2012/09/ffmpeg.html

https://ffmpeg.zeranoe.com/builds/

https://ffmpeg.org/

====================
ffmpeg php


====================
PHP-FFMpeg


Laravel 下使用 FFMpeg 处理多媒体文件
https://learnku.com/laravel/t/327/using-ffmpeg-to-deal-with-multimedia-files-under-laravel


====================
PHP system()、exec()、shell_exec() 的 差異

https://blog.longwin.com.tw/2013/06/php-system-exec-shell_exec-diff-2013/

<?php
echo "\nsystem";
$last_line = system('ls', $return_var);
echo "\nreturn_var:";
print_r($return_var);
echo "\nlast_line:";
print_r($last_line);

echo "\n\nexec";
exec('ls', $output, $return_var);
echo "\nreturn_var:";
print_r($return_var);
echo "\noutput:";
print_r($output);

echo "\n\nshell_exec";
$output = shell_exec('ls');
echo "\noutput:";
print_r($output);
?>

====================
PHP 執行 shell cmd 的方法 ; system()、exec()、shell_exec()

https://shazi.info/php-%E5%9F%B7%E8%A1%8C-shell-cmd-%E7%9A%84%E6%96%B9%E6%B3%95-system%E3%80%81exec%E3%80%81shell_exec/

-------
system()

<?php
system('ls -al', $out);
var_dump($out);
header('Content-type: application/json');
?>

#output
total 20
drwxr-xr-x   3 nginx nginx 4096 Jun 30 10:37 .
drwxr-xr-x. 11 root  root  4096 Jun 26 00:42 ..
-rw-r--r--   1 nginx nginx  816 Jun 30 10:36 cmd.php
-rw-r--r--   1 nginx nginx  246 May  4 12:15 index.php
drwxr-xr-x   6 nginx nginx 4096 May 19 17:32 share
int(0)

-------
exec()

<?php
exec('ls -al', $out);
var_dump($out);
header('Content-type: application/json');
?>

#output
array(6) {
  [0]=>
  string(8) "total 20"
  [1]=>
  string(46) "drwxr-xr-x   3 nginx nginx 4096 Jun 30 10:45 ."
  [2]=>
  string(47) "drwxr-xr-x. 11 root  root  4096 Jun 26 00:42 .."
  [3]=>
  string(52) "-rw-r--r--   1 nginx nginx  811 Jun 30 10:45 cmd.php"
  [4]=>
  string(54) "-rw-r--r--   1 nginx nginx  246 May  4 12:15 index.php"
  [5]=>
  string(50) "drwxr-xr-x   6 nginx nginx 4096 May 19 17:32 share"
}

-------
shell_exec()

<?php
$out = shell_exec('ls -al');
var_dump($out);
header('Content-type: application/json');
?>

#output
string(263) "total 20
drwxr-xr-x   3 nginx nginx 4096 Jun 30 10:49 .
drwxr-xr-x. 11 root  root  4096 Jun 26 00:42 ..
-rw-r--r--   1 nginx nginx  817 Jun 30 10:49 cmd.php
-rw-r--r--   1 nginx nginx  246 May  4 12:15 index.php
drwxr-xr-x   6 nginx nginx 4096 May 19 17:32 share
"

====================
FFMPEG & PHP: Get Thumbnails (Screenshots) From Video

https://www.youtube.com/watch?v=qT4hN5o57hI


====================
下載:

https://ffmpeg.zeranoe.com/builds/


====================
如何在Windows上安裝FFmpeg程序
https://zh.wikihow.com/%E5%9C%A8Windows%E4%B8%8A%E5%AE%89%E8%A3%85FFmpeg%E7%A8%8B%E5%BA%8F

https://www.youtube.com/watch?v=b-8rZr9rkjU

====================
====================
====================

沒有留言:

張貼留言