Skip to content

Instantly share code, notes, and snippets.

@audomsak
Forked from protrolium/ffmpeg.md
Created August 7, 2018 08:04
Show Gist options
  • Select an option

  • Save audomsak/ef8252ec363c721c8845a9991f864d52 to your computer and use it in GitHub Desktop.

Select an option

Save audomsak/ef8252ec363c721c8845a9991f864d52 to your computer and use it in GitHub Desktop.

Revisions

  1. Gavin Gamboa revised this gist Jul 20, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -162,7 +162,7 @@ Example:<br>
    <br>
    It reduced a 100mb video to 9mb.. Very little change in video quality.

    Example:<>
    Example:<br>
    `ffmpeg -i video.mov -vf eq=saturation=0 -s 640x480 -c:v libx264 -crf 24 output.mp4`<br>
    <br>
    make a grayscale version and scale to 640x480
  2. Gavin Gamboa revised this gist Jul 19, 2018. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -159,8 +159,14 @@ If you want to cut off section from the beginning, simply drop -t 00:00:10 from

    Example:<br>
    `ffmpeg -i input.avi -vcodec libx264 -crf 24 output.avi`<br>
    <br>
    It reduced a 100mb video to 9mb.. Very little change in video quality.

    Example:<>
    `ffmpeg -i video.mov -vf eq=saturation=0 -s 640x480 -c:v libx264 -crf 24 output.mp4`<br>
    <br>
    make a grayscale version and scale to 640x480

    - - -
    more commands<br>
    http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
  3. Gavin Gamboa revised this gist Jul 19, 2018. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -143,18 +143,24 @@ Here's a command line that will slice to 30 seconds without transcoding:
    Do you need to cut video with re-encoding or without re-encoding mode? You can try to following below command.<br>
    Synopsis: ffmpeg -i [input_file] -ss [start_seconds] -t [duration_seconds] [output_file]

    #### use FFmpeg cut mp4 video without re-encoding
    #### use ffmpeg cut mp4 video without re-encoding

    Example:<br>
    `ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -c copy cut_video.mp4`<br>

    #### use FFmpeg cut mp4 video with re-encoding
    #### use ffmpeg cut mp4 video with re-encoding

    Example:<br>
    `ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -async 1 -strict -2 cut_video.mp4`<br>

    If you want to cut off section from the beginning, simply drop -t 00:00:10 from the command

    #### reduce filesize

    Example:<br>
    `ffmpeg -i input.avi -vcodec libx264 -crf 24 output.avi`<br>
    It reduced a 100mb video to 9mb.. Very little change in video quality.

    - - -
    more commands<br>
    http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
  4. Gavin Gamboa revised this gist Jul 12, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -97,7 +97,7 @@ A batch file version of the same command would be:<br>
    ## Extract Single Image from a Video at Specified Frame
    `$ vf [ss][filename][outputFileName]`<br>
    where `vf` is a custom bash script as follows:<br>
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`<br?
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`<br>
    <br>
    ss offset = frame number divided by FPS of video = the decimal (in milliseconds) ffmpeg needs i.e. 130.5<br>

  5. Gavin Gamboa revised this gist Jul 12, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -97,9 +97,9 @@ A batch file version of the same command would be:<br>
    ## Extract Single Image from a Video at Specified Frame
    `$ vf [ss][filename][outputFileName]`<br>
    where `vf` is a custom bash script as follows:<br>
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`<br?
    <br>
    ss offset = frame number divided by FPS of video = the decimal (in milliseconds) ffmpeg needs i.e. 130.5)<br>
    ss offset = frame number divided by FPS of video = the decimal (in milliseconds) ffmpeg needs i.e. 130.5<br>

    ## Merge Multiple Videos

  6. Gavin Gamboa revised this gist Jul 12, 2018. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -96,9 +96,10 @@ A batch file version of the same command would be:<br>

    ## Extract Single Image from a Video at Specified Frame
    `$ vf [ss][filename][outputFileName]`<br>
    (ss offset = get the exact frame number, then divide it by FPS of the video to get the decimal (in milliseconds) ffmpeg is looking for i.e. 130.5)<br>
    where vf is my custom script as follows:<br>
    where `vf` is a custom bash script as follows:<br>
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`
    <br>
    ss offset = frame number divided by FPS of video = the decimal (in milliseconds) ffmpeg needs i.e. 130.5)<br>

    ## Merge Multiple Videos

  7. Gavin Gamboa revised this gist Jul 12, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -96,7 +96,7 @@ A batch file version of the same command would be:<br>

    ## Extract Single Image from a Video at Specified Frame
    `$ vf [ss][filename][outputFileName]`<br>
    (ss offset=exact frame number divided by FPS of video to get decimal ms ffmpeg is looking for)<br>
    (ss offset = get the exact frame number, then divide it by FPS of the video to get the decimal (in milliseconds) ffmpeg is looking for i.e. 130.5)<br>
    where vf is my custom script as follows:<br>
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`

  8. Gavin Gamboa revised this gist Jul 12, 2018. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -92,6 +92,13 @@ m4a to mp3 conversion with ffmpeg and lame
    A batch file version of the same command would be:<br>
    `for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 256k "${f%.m4a}.mp3"; done`

    - - -

    ## Extract Single Image from a Video at Specified Frame
    `$ vf [ss][filename][outputFileName]`<br>
    (ss offset=exact frame number divided by FPS of video to get decimal ms ffmpeg is looking for)<br>
    where vf is my custom script as follows:<br>
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`

    ## Merge Multiple Videos

    @@ -101,11 +108,6 @@ file names in folder, if they contain spaces, must be properly escaped <br>
    ## Split a Video into Images
    `$ ffmpeg -i video.flv image%d.jpg`

    ## Extract Single Image from a Video at Specified Frame
    `$ vf [ss][filename][outputFileName]` (ss offset=exact frame number divided by FPS of video to get decimal ms ffmpeg is looking for)<br>
    where vf is my custom script as follows:<br>
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`

    ## Convert Images into a Video
    `$ ffmpeg -f image2 -i image%d.jpg imagestovideo.mpg`

  9. Gavin Gamboa revised this gist Jul 12, 2018. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -101,6 +101,11 @@ file names in folder, if they contain spaces, must be properly escaped <br>
    ## Split a Video into Images
    `$ ffmpeg -i video.flv image%d.jpg`

    ## Extract Single Image from a Video at Specified Frame
    `$ vf [ss][filename][outputFileName]` (ss offset=exact frame number divided by FPS of video to get decimal ms ffmpeg is looking for)<br>
    where vf is my custom script as follows:<br>
    `$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg`

    ## Convert Images into a Video
    `$ ffmpeg -f image2 -i image%d.jpg imagestovideo.mpg`

  10. Gavin Gamboa revised this gist Jun 22, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -29,7 +29,7 @@ In HH:MM:SS format<br>

    `ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac `

    `vn` is no video.
    `vn` is no video.<br>
    `acodec` copy says use the same audio stream that's already in there.


  11. Gavin Gamboa revised this gist Jun 22, 2018. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,12 @@ In HH:MM:SS format<br>

    ## Extract Audio

    `ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac `

    `vn` is no video.
    `acodec` copy says use the same audio stream that's already in there.


    `ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3`

    The -i option in the above command is simple: it is the path to the input file. The second option -f mp3 tells ffmpeg that the ouput is in mp3 format. The third option i.e -ab 192000 tells ffmpeg that we want the output to be encoded at 192Kbps and -vn tells ffmpeg that we dont want video. The last param is the name of the output file.
  12. Gavin Gamboa revised this gist Feb 23, 2018. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -31,6 +31,14 @@ In HH:MM:SS format<br>

    The -i option in the above command is simple: it is the path to the input file. The second option -f mp3 tells ffmpeg that the ouput is in mp3 format. The third option i.e -ab 192000 tells ffmpeg that we want the output to be encoded at 192Kbps and -vn tells ffmpeg that we dont want video. The last param is the name of the output file.

    ## Replace Audio on a Video without re-encoding.

    strip audio stream away from video<br>
    `ffmpeg -i INPUT.mp4 -codec copy -an OUTPUT.mp4`

    combine the two streams together (new audio with originally exisiting video)<br>
    `ffmpeg -i INPUT.mp4 -i AUDIO.wav -shortest -c:v copy -c:a aac -b:a 256k OUTPUT.mp4`

    - - -

    You say you want to "extract audio from them (mp3 or ogg)". But what if the audio in the mp4 file is not one of those? you'd have to transcode anyway. So why not leave the audio format detection up to ffmpeg?
  13. Gavin Gamboa revised this gist Dec 12, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -108,7 +108,7 @@ Left channel to stereo:<br>
    <br>
    If you want to use the right channel, write `0.1.1` instead of `0.1.0.`

    # Trim End of file (mp3)
    ## Trim End of file (mp3)
    Here's a command line that will slice to 30 seconds without transcoding:
    <br>
    `ffmpeg -t 30 -i inputfile.mp3 -acodec copy outputfile.mp3`
  14. Gavin Gamboa revised this gist Dec 12, 2017. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -108,6 +108,11 @@ Left channel to stereo:<br>
    <br>
    If you want to use the right channel, write `0.1.1` instead of `0.1.0.`

    # Trim End of file (mp3)
    Here's a command line that will slice to 30 seconds without transcoding:
    <br>
    `ffmpeg -t 30 -i inputfile.mp3 -acodec copy outputfile.mp3`
    <br>

    - - -

  15. Gavin Gamboa revised this gist Jun 25, 2017. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -97,6 +97,18 @@ file names in folder, if they contain spaces, must be properly escaped <br>
    ## Simple FLAC convert
    `ffmpeg -i audio.xxx -c:a flac audio.flac`

    ## Mix Stereo to Mono
    You can modify a video file directly without having to re-encode the video stream. However the audio stream will have to be re-encoded.
    <br>
    Left channel to mono:
    `ffmpeg -i video.mp4 -map_channel 0.1.0 -c:v copy mono.mp4`<br>
    <br>
    Left channel to stereo:<br>
    `ffmpeg -i video.mp4 -map_channel 0.1.0 -map_channel 0.1.0 -c:v copy stereo.mp4`<br>
    <br>
    If you want to use the right channel, write `0.1.1` instead of `0.1.0.`


    - - -

    ## To Encode or Re-encode ?
  16. Gavin Gamboa revised this gist Jan 26, 2017. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -97,6 +97,25 @@ file names in folder, if they contain spaces, must be properly escaped <br>
    ## Simple FLAC convert
    `ffmpeg -i audio.xxx -c:a flac audio.flac`

    - - -

    ## To Encode or Re-encode ?

    Do you need to cut video with re-encoding or without re-encoding mode? You can try to following below command.<br>
    Synopsis: ffmpeg -i [input_file] -ss [start_seconds] -t [duration_seconds] [output_file]

    #### use FFmpeg cut mp4 video without re-encoding

    Example:<br>
    `ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -c copy cut_video.mp4`<br>

    #### use FFmpeg cut mp4 video with re-encoding

    Example:<br>
    `ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -async 1 -strict -2 cut_video.mp4`<br>

    If you want to cut off section from the beginning, simply drop -t 00:00:10 from the command

    - - -
    more commands<br>
    http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
  17. Gavin Gamboa revised this gist Jan 6, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -94,6 +94,9 @@ file names in folder, if they contain spaces, must be properly escaped <br>
    `$ ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner`<br>
    [more info](http://www.bugcodemaster.com/article/convert-videos-webm-format-using-ffmpeg)

    ## Simple FLAC convert
    `ffmpeg -i audio.xxx -c:a flac audio.flac`

    - - -
    more commands<br>
    http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
  18. Gavin Gamboa revised this gist Dec 21, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -91,7 +91,7 @@ file names in folder, if they contain spaces, must be properly escaped <br>
    `$ ffmpeg -f image2 -i image%d.jpg imagestovideo.mpg`

    ## Convert mp4 to webm
    `ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner`<br>
    `$ ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner`<br>
    [more info](http://www.bugcodemaster.com/article/convert-videos-webm-format-using-ffmpeg)

    - - -
  19. Gavin Gamboa revised this gist Dec 21, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -91,7 +91,7 @@ file names in folder, if they contain spaces, must be properly escaped <br>
    `$ ffmpeg -f image2 -i image%d.jpg imagestovideo.mpg`

    ## Convert mp4 to webm
    `ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner`
    `ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner`<br>
    [more info](http://www.bugcodemaster.com/article/convert-videos-webm-format-using-ffmpeg)

    - - -
  20. Gavin Gamboa revised this gist Dec 21, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -90,6 +90,10 @@ file names in folder, if they contain spaces, must be properly escaped <br>
    ## Convert Images into a Video
    `$ ffmpeg -f image2 -i image%d.jpg imagestovideo.mpg`

    ## Convert mp4 to webm
    `ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner`
    [more info](http://www.bugcodemaster.com/article/convert-videos-webm-format-using-ffmpeg)

    - - -
    more commands<br>
    http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
  21. Gavin Gamboa revised this gist Oct 15, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,8 @@ Convert any MP3 file to WAV 16khz mono 16bit:<br>

    Convert any MP3 file to WAV 20khz mono 16bit for ADDAC WAV Player:<br>
    `ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 22050 out.wav`<br>
    cd into dir for batch process:<br>
    `for i in *.mp3; do ffmpeg -i "$i" -acodec pcm_s16le -ac 1 -ar 22050 "${i%.mp3}-encoded.wav"; done`

    Picking the 30 seconds fragment at an offset of 1 minute:<br>
    In seconds<br>
  22. Gavin Gamboa revised this gist Oct 14, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,9 @@ Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 k
    Convert any MP3 file to WAV 16khz mono 16bit:<br>
    `ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav`<br>

    Convert any MP3 file to WAV 20khz mono 16bit for ADDAC WAV Player:<br>
    `ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 22050 out.wav`<br>

    Picking the 30 seconds fragment at an offset of 1 minute:<br>
    In seconds<br>
    `ffmpeg -i input.mp3 -ss 60 -t 30 output.wav`<br>
  23. Gavin Gamboa revised this gist Oct 9, 2016. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -13,8 +13,6 @@ Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 k
    Convert any MP3 file to WAV 16khz mono 16bit:<br>
    `ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav`<br>

    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg<br>

    Picking the 30 seconds fragment at an offset of 1 minute:<br>
    In seconds<br>
    `ffmpeg -i input.mp3 -ss 60 -t 30 output.wav`<br>
  24. Gavin Gamboa revised this gist Oct 9, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ You can get the list of supported formats with:<br>
    Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:<br>
    `ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3`<br>

    Convert any mp3 file to .wav 16khz mono 16bit:<br>
    Convert any MP3 file to WAV 16khz mono 16bit:<br>
    `ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav`<br>

    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg<br>
  25. Gavin Gamboa revised this gist Oct 9, 2016. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,18 @@
    # ffmpeg

    ## Converting Audio into Different Formats / Sample Rates
    Minimal example: transcode from MP3 to WMA<br>
    Minimal example: transcode from MP3 to WMA:<br>
    `ffmpeg -i input.mp3 output.wma`

    You can get the list of supported formats with:<br>
    `ffmpeg -formats`

    Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz<br>
    Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:<br>
    `ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3`<br>

    Convert any mp3 file to .wav 16khz mono 16bit:<br>
    `ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav`<br>

    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg<br>

    Picking the 30 seconds fragment at an offset of 1 minute:<br>
  26. Gavin Gamboa revised this gist Oct 9, 2016. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -2,26 +2,21 @@

    ## Converting Audio into Different Formats / Sample Rates
    Minimal example: transcode from MP3 to WMA<br>

    `ffmpeg -i input.mp3 output.wma`

    You can get the list of supported formats with:<br>

    `ffmpeg -formats`

    Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz<br>

    `ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3`<br>

    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg<br>

    Picking the 30 seconds fragment at an offset of 1 minute:<br>
    In seconds<br>

    `ffmpeg -i input.mp3 -ss 60 -t 30 output.wav`<br>

    In HH:MM:SS format<br>

    `ffmpeg -i input.mp3 -ss 0:01:00 -t 0:00:30 output.wav`

    ## Extract Audio
    @@ -83,6 +78,12 @@ A batch file version of the same command would be:<br>
    file names in folder, if they contain spaces, must be properly escaped <br>
    `ls * | perl -ne 'print "file $_"' | ffmpeg -f concat -i - -c copy merged.mp4`

    ## Split a Video into Images
    `$ ffmpeg -i video.flv image%d.jpg`

    ## Convert Images into a Video
    `$ ffmpeg -f image2 -i image%d.jpg imagestovideo.mpg`

    - - -
    more commands<br>
    http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs
  27. Gavin Gamboa revised this gist Oct 9, 2016. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -2,21 +2,26 @@

    ## Converting Audio into Different Formats / Sample Rates
    Minimal example: transcode from MP3 to WMA<br>

    `ffmpeg -i input.mp3 output.wma`

    You can get the list of supported formats with:<br>

    `ffmpeg -formats`

    Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz<br>

    `ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3`<br>

    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg<br>

    Picking the 30 seconds fragment at an offset of 1 minute:<br>

    In seconds<br>

    `ffmpeg -i input.mp3 -ss 60 -t 30 output.wav`<br>

    In HH:MM:SS format<br>

    `ffmpeg -i input.mp3 -ss 0:01:00 -t 0:00:30 output.wav`

    ## Extract Audio
  28. Gavin Gamboa revised this gist Oct 9, 2016. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -9,11 +9,13 @@ You can get the list of supported formats with:<br>

    Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz<br>
    `ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3`<br>
    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg
    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg<br>

    Picking the 30 seconds fragment at an offset of 1 minute:<br>

    In seconds<br>
    `ffmpeg -i input.mp3 -ss 60 -t 30 output.wav`<br>

    In HH:MM:SS format<br>
    `ffmpeg -i input.mp3 -ss 0:01:00 -t 0:00:30 output.wav`

  29. Gavin Gamboa revised this gist Oct 9, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 k
    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg

    Picking the 30 seconds fragment at an offset of 1 minute:<br>
    In seconds
    In seconds<br>
    `ffmpeg -i input.mp3 -ss 60 -t 30 output.wav`<br>
    In HH:MM:SS format<br>
    `ffmpeg -i input.mp3 -ss 0:01:00 -t 0:00:30 output.wav`
  30. Gavin Gamboa revised this gist Oct 9, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions ffmpeg.md
    Original file line number Diff line number Diff line change
    @@ -8,13 +8,13 @@ You can get the list of supported formats with:<br>
    `ffmpeg -formats`

    Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz<br>
    `ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3`
    `ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3`<br>
    Note: you can also use '-ab 64k', but I'm not sure how well this is supported in different version of FFmpeg

    Picking the 30 seconds fragment at an offset of 1 minute:<br>
    In seconds
    `ffmpeg -i input.mp3 -ss 60 -t 30 output.wav`
    In HH:MM:SS format
    `ffmpeg -i input.mp3 -ss 60 -t 30 output.wav`<br>
    In HH:MM:SS format<br>
    `ffmpeg -i input.mp3 -ss 0:01:00 -t 0:00:30 output.wav`

    ## Extract Audio