FFMPEG usefull codes

Started on the old forum in June 2010 · view the original in the archive · old links redirect here

5 replies · 1,229 views · started 16 years ago · 1 min read

5 participants
phpcoder Newbie · 2 posts #1

You Can Send This commands in PHP with exec() or shell_exec()

Getting infos from a video file

ffmpeg -i video.avi

Turn X images to a video sequence

ffmpeg -f image2 -i image%d.jpg video.mpg

Turn a video to X images

ffmpeg -i video.mpg image%d.jpg

Extracting sound from a video, and save it as Mp3

ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3

Convert a wav file to Mp3

ffmpeg -i son_origine.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 son_final.mp3

Convert .avi video to .mpg

ffmpeg -i video_origine.avi video_finale.mpg

Convert .avi to animated gif(uncompressed)

ffmpeg -i video_origine.avi gif_anime.gif

Mix a video with a sound file

ffmpeg -i son.wav -i video_origine.avi video_finale.mpg

Convert .avi to .flv

ffmpeg -i video_origine.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_finale.flv

bite rate convertor

ffmpeg -i $file -b 128 -y output.mp3

Anshul Senior · 296 posts #2

its nt a gud idea to unable exec or shell commands bt they can perform grt things 😮

GumSlone Administrator Principal · 1,690 posts #3

Anshul wrote: its nt a gud idea to unable exec or shell commands bt they can perform grt things 😮

if you dont have php-ffmpeg there is no way around exec if you want to use ffmpeg on your server, and i think with exec you can use more advanced commands than with php-ffmpeg

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

phpcoder Newbie · 2 posts #4

right man bcoz vhook water mark command only work with exec()

amore Junior · 31 posts #5

dude your server should support to php-ffmpeg .

ksg91 Developer · 162 posts #6

Anshul wrote: its nt a gud idea to unable exec or shell commands bt they can perform grt things 😮

there is no risk to use exec if you are not careless.. and sometime it becomes necessary to execute shell command

Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close