Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
You can get the list of installed codecs with:
| # Run the last command as root | |
| sudo !! | |
| # Serve current directory tree at http://$HOSTNAME:8000/ | |
| python -m SimpleHTTPServer | |
| # Save a file you edited in vim without the needed permissions | |
| :w !sudo tee % | |
| # change to the previous working directory | |
| cd - | |
| # Runs previous command but replacing | |
| ^foo^bar |
| <?php | |
| /** | |
| * Simple code for executing commands on a remote Linux server via SSH in PHP | |
| * | |
| * @author Phil Kershaw (In collaboration with Philip Mott) | |
| * | |
| * Note: ssh2_connect requires libssh2-php which is a non-standard PHP lib. | |
| * Debian: apt-get install libssh2-php | |
| * Redhat: yum install libssh2-php ???? I've no idea for redhat, sorry. | |
| */ |
Extract audio from a YouTube video file
ffmpeg -i INPUT.mp4 -ab 256k OUTPUT.mp3Cut 3s length
ffmpeg -y -ss 00:00:03 -i INPUT.mp4 -codec copy OUTPUT.mp4| <?php | |
| $timeout = 300; // 5 minutes | |
| $time = time(); | |
| $ip = $_SERVER["REMOTE_ADDR"]; | |
| $file = "users.txt"; | |
| $arr = file($file); | |
| $users = 0; | |
| for ($i = 0; $i < count($arr); $i++){ | |
| if ($time - intval(substr($arr[$i], strpos($arr[$i], " ") + 4)) > $timeout){ |
| # Don't use FFmpeg for metadata extraction. Use FFprobe. | |
| # Its output is geared toward parsabilty. | |
| # Container and stream information in JSON format: | |
| ffprobe -show_format -print_format json 'Serenity - HD Trailer.mp4' | |
| ffprobe -show_streams -print_format json 'Serenity - HD Trailer.mp4' | |
| # Human-readable values: | |
| ffprobe -show_format -pretty -print_format json 'Serenity - HD Trailer.mp4' | |
| # Trim video to first 30 seconds, without transcoding. |