Skip to content

Instantly share code, notes, and snippets.

@Mr-Guilherme
Created September 7, 2021 16:01
Show Gist options
  • Select an option

  • Save Mr-Guilherme/81d3a52027b8e4498a9f02b2a0f8a423 to your computer and use it in GitHub Desktop.

Select an option

Save Mr-Guilherme/81d3a52027b8e4498a9f02b2a0f8a423 to your computer and use it in GitHub Desktop.

Revisions

  1. Mr-Guilherme created this gist Sep 7, 2021.
    19 changes: 19 additions & 0 deletions ffmpegBasics.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    ## Cut video with re-encoding
    1. Flag `-to HH:MM:SS.MILLISECONDS` is for determining the end time of the video to be cut.
    2. Flag `-i` is input video as path.
    3. The last path is output of video.
    ```shell
    foo@bar: ffmpeg -to 00:15:00 -i ./media/file.mp4 ./media/newFile.mp4
    ```
    4. Flag `-ss` is for determining the start time of the video to be cut.
    5. It is algo possible convert the video format.
    ```shell
    foo@bar: ffmpeg -ss 00:15:00 -i ./media/file.mkv ./media/newFile.mp4
    ```

    ## Cut video without re-encoding
    The arguments `-c:v copy` and `-c:a copy` is for duplicate video and audio track.
    Increases speed a lot, but can be inaccurate.
    ```shell
    foo@bar: ffmpeg -ss 00:15:00 -to 00:30:00 -i ./media/file.mp4 -c:v copy -c:a copy ./media/newFile.mp4
    ```