Commands matching ffmpeg (189)


  • 0
    ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq /home/ken/Desktop/moviemade1.mpg
    Kennymac · 2013-08-10 21:34:00 7
  • Strips the audio track from a webm video. Use this in combination with clive or youtube-dl.


    0
    for file in "$@"; do name=$(basename "$file" .webm) echo ffmpeg -i $file -vn -c:a copy $name.ogg ffmpeg -i "$file" -vn -c:a copy "$name.ogg" done
    hoodie · 2013-10-05 14:49:07 9
  • This *does not change the video encoding*, so it's fast (almost purely I/O-bound) and results in a file of nearly the same size. However, OSX (and possibly other programs) will more easily play/seek the file when wrapped as MOV. For example, you can QuickLook the resulting file. This basically does the same as the commercial ClipWrap program, except using the free program ffmpeg. Show Sample Output


    0
    ffmpeg -i "input.mts" -vcodec copy -acodec pcm_s16le "output.mov"
    lgarron · 2014-01-24 13:00:07 6
  • This command is used to stream a video file as live to some streaming server like Wowza, Red5 . etc


    0
    ffmpeg -re -i localFile.mp4 -c copy -f flv rtmp://server/live/streamName
    unni9946 · 2014-03-07 05:52:11 7
  • After updating to the latest ffmpeg with homebrew


    0
    ffmpeg -i $video -c:v prores -profile:v 2 -c:a copy ${video}.mov
    brainstorm · 2014-03-10 16:24:34 18
  • This encodes it in ogg format. Does on-the-fly encoding of the incoming stream. Great for radio streams as they're often flv format.


    0
    curl 'AudioStream' | ffmpeg -i - -acodec libvorbis file.ogg
    snipertyler · 2014-03-31 02:07:20 7
  • I needed to convert a screen capture when using Gnome's "recordmydesktop" and convert it to a .wmv for playback in Windows.


    0
    ffmpeg -i input.ogv -qscale 0 output.wmv # convert .ogv to .wmv
    mpb · 2014-06-24 16:23:18 7

  • 0
    ffmpeg -i input.mpg -deinterlace -pix_fmt yuv420p -vcodec libx264 -preset slow -vprofile high -trellis 2 -crf 20 -ac 2 -ab 192k -f mp4 -ss 5:00.000 -to 25:00.000 output.avi
    xplora1a · 2014-08-23 10:29:15 9

  • 0
    find -type f -exec ffmpeg -i "{}" "{}".mp3 \;
    aarntesla · 2014-10-30 19:43:58 8

  • 0
    ffmpeg -i filename -vn -acodec libvorbis out.ogg
    longqi · 2014-12-31 12:46:55 10
  • Full command: for f in input/*; do BN=$(basename "$f"); ffmpeg -i "$f" -vn "temp/$BN.flac"; sox "temp/$BN.flac" "temp/$BN-cleaned.flac" noisered profile 0.3; ffmpeg -i "$f" -vcodec copy -an "temp/$BN-na.mp4"; ffmpeg -i "temp/$BN-na.mp4" -i "temp/$BN-cleaned.flac" "output/$BN"; done This was over the 255 character limit and I didn't feel like deliberately obfuscating it. 1. Create 'input', 'output' and 'temp' directories. 2. Place the files that you want to remove the hiss/static/general noise from in the input directory. 3. Generate a noise reduction profile with sox using 'sox an_input_file.mp4 -n trim x y noiseprof profile', where x and y indicates a range in seconds that only the sound you want to eliminate is present in. 4. Run the command.


    0
    for f in input/*; do BN=$(basename "$f"); ffmpeg -i "$f" -vn "temp/$BN.flac"...
    samcamwilliams · 2015-03-01 02:48:19 8
  • Change bitrate with option '-b'


    0
    ssh user@host ffmpeg -b 200 -an -f video4linux2 \ -s 960x720 -r 10 -i /dev/video0 -b 200 -f ogg - \ | mplayer - -idle -demuxer ogg
    dkaliberda · 2015-02-27 19:05:26 8
  • -ss start time -t duration -i file name -vf scale=320:-1 scale 320 X auto -r fps


    0
    ffmpeg -ss 00:00:00.000 -t 10 -i filename.avi -vf scale=320:-1 -r 10 /tmp/output.gif
    maxwux · 2015-04-22 06:52:03 9
  • disharmonics between 44100 and others cleaned


    0
    ffmpeg -loglevel 0 -y -i audio.mp3 -f sox - | sox -p -V -S -b32 -t alsa hw:CA0106 gain -3 rate -va 1411200 rate -v 96k
    george23 · 2016-01-26 14:41:05 13
  • This will dump a raw BGRA pixel stream and WAV which must then be converted to video: ffmpeg -f rawvideo -c:v rawvideo -s 1280x720 -r 12 -pix_fmt bgra -i "${i%.*}".bgra -c:v libx264 -preset veryslow -qp 0 -movflags +faststart -i "${i%.*}".wav -c:a libfdk_aac -b:a 384k "${i%.*}".mp4 ; rm "${i%.*}".bgra "${i%.*}".wav Our example generates an x264/720p/12fps/AAC best-quality MP4. To get dump-gnash, first install the build-dependencies for gnash (this step is OS-specific). Then: git clone http://git.savannah.gnu.org/r/gnash.git ; cd gnash ; ./autogen.sh ; ./configure --enable-renderer=agg --enable-gui=dump --disable-menus --enable-media=ffmpeg --disable-jemalloc ; make


    0
    i=in.swf; dump-gnash -1 -j 1280 -k 720 -D "${i%.*}".bgra@12 -A "${i%.*}".wav "${i}"
    mhs · 2015-05-06 23:52:39 27
  • sox's interpolator creating bitperfect big soundfiles for audiofil ears, two passes computing takes long time and creating big archives


    0
    ffmpeg -loglevel 0 -y -i audio.mp3 -f sox - | sox -p -V -S -b24 -t audio.flac gain -3 rate -va 14112000 rate -v 96000
    george23 · 2016-09-20 13:25:13 14
  • Converts an OGG file to MP3 at desired quality, preserving the id3v2 tags.


    0
    ffmpeg -i input.ogg -ab 256k -map_metadata 0:s:0 output.mp3
    woohoo · 2018-08-11 21:44:27 290

  • 0
    ffmpeg -i orig_video.wmv audio_out.wav
    lolssl · 2015-10-02 12:55:39 10
  • The "map" may be different depending on the .wmv file. run `ffprobe` to see which is the video-track in the .wmv file usually this is "0.0". Stream #0.0: Video:... Stream #0.1: Audio: .. and "1.0" corresponds to the 2nd input file - your new audio. You may want to add "-acodec wmav2" and "-ar 128k" options for 128kbit/s Windows Media Audio 2 or whatever audio-codec/quality your want. `ffmpeg -codecs | grep "EA"` gives you a list of available codecs for Encoding Audio. Try using '-sameq' instead of '-vcodec copy' (re-encode the video with same quality rather than a bit-exact copy - this often solves muxing issues but will cause a small loss of either video quality or increased bandwidth). and also try a different output format eg. 'new_video.avi' or '..mov' instead of 'new_video.wmv'. you may need both, this should work: ffmpeg -i vid.wmv -i aud.wav -sameq -map 0.0 -map 1.0 output.avi


    0
    ffmpeg -i orig_video.wmv -i new_audio.wav -vcodec copy -map 0.0 -map 1.0 new_video.wmv
    lolssl · 2015-10-02 12:56:27 13
  • Works on *.mp4 as well. Show Sample Output


    0
    avconv -i vid.avi
    lowrez · 2015-10-16 22:49:52 10
  • Music Library Convert Usage lc Old_Directory New_DIrectory Old_Format New_Format lc ~/Music ~/Music_ogg mp3 ogg This will convert all audio files in the old directory to the new directory from the old format to the new format. It will leave the original library alone. The converted library will retain folder structure.


    0
    lc() { od="$1"; nd="$2"; of=$3; nf=$4; cp -rl "$od" "$nd"; find $nd -type f -iname \*$of -print -execdir ffmpeg -i {} -loglevel error -q:a 6 {}.$nf \; -execdir rm {} +; find $nd -type f -iname \*.$of.$nf -execdir rename "s/$of.$nf/$nf/" {} +; }
    snipertyler · 2015-12-16 20:16:01 18
  • to view on another box: nc <server address> <port> | ffplay - use -r to adjust FPS and -q to adjust compression. use on trusted network only as nc is unencrypted.


    0
    ffmpeg -f x11grab -s $(xrandr | awk '/*/ {print $1}') -r 10 -i :0 -an -q 10 -f mjpeg - | nc -lp <port>
    misterhat · 2015-12-21 17:15:30 11

  • 0
    ffmpeg -loop 1 -i image.jpg -i audio.m4a -c:v libx264 -c:a aac -strict experimental -b:a 192k -vf scale=720:-1 -shortest video-output.mp4
    andresaquino · 2016-01-02 18:01:17 11
  • Requires ffmpeg with image2pipe filter and imagemagick Show Sample Output


    0
    ffmpeg -i input.mp4 -vf scale=w=320:h=-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - output.gif
    TheMadScientist · 2016-01-08 17:21:37 11
  • Uses ffmpeg to convert all that annoying .FLAC files to MP3 files keeping all the Artist's information in them. There's not much more to it. Show Sample Output


    0
    find . -name "*.flac" -exec ffmpeg -i {} -ab 160k -map_metadata 0 -id3v2_version 3 {}.mp3 \;
    gustavohmsilva · 2016-06-28 19:35:06 10
  • ‹ First  < 4 5 6 7 8 > 

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

HTTP GET request on wireshark remotly

cycle through everything sox knows how to read, playing only the first three seconds
I wasted two hours reading the sox documentation and searching on the web for the format of some obscure fscking sound sample, and then finally came up with this. This plays only the first three seconds of your unknown formatted sound file using every one of sox's built-in filetypes. If you don't get an exact match, you may get close. . I could not fit every single type in and keep it under 127 characters, so you will have to replace "..." with the full list obtainable by `$ sox --help` (or try `Show sample output`) . note: /usr/bin/play should be linked to sox on most systems.

kill all foo process
Kill all processes with foo in them. Similar to pkill but more complete and also works when there is no pkill command. Works on almost every Linux/Unix platform I have tried.

List out classes in of all htmls in directory
Lists out all classes used in all *.html files in the currect directory. usefull for checking if you have left out any style definitions, or accidentally given a different name than you intended. ( I have an ugly habit of accidentally substituting camelCase instead of using under_scores: i would name soemthing counterBox instead of counter_box) WARNING: assumes you give classnames in between double quotes, and that you apply only one class per element.

Remove the first character of each line in a file

Hide or show Desktop Icons on MacOS
Hides all Files and Folders on the MacOS Desktop. To show files and folders, type "true" instead of "false". "Finder" at the end is case sensitive, "finder" doesn’t work

generate random tone

Show crontabs for all users
This is flatcaps tweaked command to make it work on SLES 11.2

print crontab entries for all the users that actually have a crontab
This is how I list the crontab for all the users on a given system that actually have a crontab. You could wrap it with a function block and place it in your .profile or .bashrc for quick access. There's prolly a simpler way to do this. Discuss.


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: