Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Very Carefully Rebuild a Video

# H264

    $ ffmpeg -i input.avi -c copy -c:v libx264 -crf 18 -preset slow output.mkv
# H265

    -c:v libx265 -crf 22
Append Subtitles

    $ ffmpeg -i input.mkv -i input.srt -map 0 -map 1 -c copy output.mkv
Concat Videos

    $ ls *.mkv > mylist.txt
    $ vim mylist.txt # append each line with "file "
    $ ffmpeg -f concat -i mylist.txt -c copy merged-pre-subbed.mkv
Probe size issues?

     $ ffmpeg -analyzeduration 2147483647 -probesize 2147483647 ...
Deinterlace

    -vf yadif
Metadata Examples

    ffmpeg -i foo.avi -i commentary.mp3 -map 0 -map 1 -c:a copy -c:v libx264 -crf 18 -preset fast  -metadata:s:a:1 title="Commentary" -metadata:s:a:0 language=eng  funk.mkv
Autocrop

    $ ffplay -i foo.mkv -vf "cropdetect=24:16:0"

    <let it run for a minute>

    [Parsed_cropdetect_0 @ 0x7ff093c65c00] x1:0 x2:1919 y1:132 y2:947 w:1920 h:816 x:0 y:132 pts:30155 t:30.155000 crop=1920:816:0:132

    -filter:v:0 "crop=1920:816:0:132"


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: