Re: Convert video to FLV like youtube
| From: | Nitsan Bin-Nun | Date: | Sat, 18 Oct 2008 21:23:33 +0000 |
| Subject: | Re: Convert video to FLV like youtube | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282085@lists.php.net to get a copy of this message | ||
Straightforward and useful, I have added it to the "videos conversion"
snippets directory ;)
Sokot Sameh,
Nitsan Bin-Nun
On Sat, Oct 18, 2008 at 10:45 PM, Dotan Cohen <dotancohen@gmail.com> wrote:
> 2008/10/18 Ryan S <genphp@yahoo.com>:
> > Hey!
> >
> > Been googleing for a way to convert video to flv just like youtube and
> came accross the flv SDK kit, unfortunately it seems to only support C++,
> Delphi and C#
> >
> >
> > Have any of you guys come accross a php script that does this? any links,
> pointers and code would be appreciated.
> >
>
> Here is the script that I use to convert videos to flash for use on
> http://dotancohen.com my personal website:
>
> hardy2@hardy2-laptop:~$ cat .bin/video-flv_png
> #!/bin/bash
> filename="$@"
> filename=${filename%.*}
> ffmpeg -sameq -i "$@" -s 640x480 -ar 44100 -r 25 $filename.flv -pass 2
> ffmpeg -itsoffset -0 -i "$@" -vcodec png -vframes 1 -an -f rawvideo
> -s 640x480 $filename.1.png
> ffmpeg -itsoffset -0.5 -i "$@" -vcodec png -vframes 1 -an -f
> rawvideo -s 640x480 $filename.2.png
> ffmpeg -itsoffset -1 -i "$@" -vcodec png -vframes 1 -an -f rawvideo
> -s 640x480 $filename.3.png
>
>
>
> In addition to the video it creates three png files, from the first
> few frames of the video. I choose one of these pngs (rm the other two)
> and use it as the thumbnail for the video in the flash-based player.
> Feel free to check out my site for example code.
>
> --
> Dotan Cohen
>
> http://what-is-what.com
> http://gibberish.co.il
> א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת
>
> ä-ö-ü-ß-Ä-Ö-Ü
>