User Tools

Site Tools


ffmpeg:downloading_media

ffmpeg - Downloading Media

Obtain information of a media file

ffmpeg -i "https://videofile.mp4"

NOTE: This will return all kinds of information about the media file, such as bitrate, fps, encoded type, subtitles info, audio info, channels and more.


Download a media file

ffmpeg -i "https://videofile.mp4" -c copy downloadedfile.mp4

NOTE: Downloads the videolink.mp4 file and saves (copies) it as downloadedfile.mp4


Download a media file

ffmpeg -i "https://videofile.mp4" -c:v libx264 -preset fast -crf 18 downloadedfile.mp4

NOTE: Downloads the videolink.mp4 file and uses a fast encoding to compression speed, so the file will be quiet large but it will encode quickly.

  • The -preset values are:
    • ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow.
  • A slow -preset will take longer but compress the file better.
  • The -crf is constant rate factor or quality control on the video.
    • 0 is lossless meaning it wont encode it or change its quality, FFmpeg say an output that is roughly visually lossless but not technically lossless is -crf 17 or -crf 18.
    • The range of the CRF scale is 0–51, 0 is lossless, 23 is the default, and 51 is the worst quality possible.
    • A -crf of around 18-21 is the sweet spot.
  • A good solid combination is to make the file slightly smaller, keep quality and do it quickly is the values used here:
    ffmpeg -i "https://videofile.mp4" -c:v libx264 -preset fast -crf 19 downloadedfile.mp4

ffmpeg -i "https://inputurlstream.m3u8" -map 0:10 -map 0:11 -c copy small_output.mp4

NOTE:

ffmpeg/downloading_media.txt · Last modified: 2023/11/02 23:17 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki