ffprobe -v error -show_format -show_streams input.mp4
ffmpeg -hide_banner -i input.mkv
Informace o video kodeku
ffprobe -v error -select_streams v -show_entries stream=codec_name,codec_type,codec_long_name,codec_tag_string -of default=noprint_wrappers=1 file.avi
#!/bin/bash -x fromBR=`ffprobe -v error -show_entries format=bit_rate -of default=noprint_wrappers=1:nokey=1 "$1"` toBR=`awk "BEGIN {print $fromBR*0.60}"` maxBR=`awk "BEGIN {print $fromBR*1.0}"` toFILE=`echo ${1%.*}` CRF=23 echo FROM:$fromBR echo TO: $toBR echo MAX: $maxBR echo $CRF # TWO WAY METHOD ffmpeg -y -i "$1" -c:v libx265 -preset medium -b:v $toBR -maxrate $maxBR -x265-params pass=1 -an -f mp4 /dev/null ffmpeg -i "$1" -c:v libx265 -preset medium -b:v $toBR -maxrate $maxBR -x265-params pass=2 -c:a copy -c:s copy "$toFILE.BR$toBR.h265.MIML.mkv" #ONE WAY CRF METHOD #ffmpeg -i "$1" -c:v libx265 -preset slow -crf $CRF -c:a copy -c:s copy "$toFILE.CRF$CRF.h265.MIML.mkv"
ffmpeg -i ./input.mkv -map 0 -c:a copy -c:s copy -c:v libx264 output.mkv
ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy output.ts
ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4
ffmpeg -i video.mp4 -ss 00:01:00 -to 00:02:00 -c copy cut.mp4
Konverze kódování souboru s titulku z CP1250 do UTF-8
iconv -f CP1250 -t UTF-8//TRANSLIT input.file -o out.file
Vložení titulků do kontejneru videa MKV
ffmpeg -i IN.mkv -i IN.srt -map 0:v -map 0:a -map 1 -c:v copy -c:a copy -c:s srt -metadata:s:s:0 language=Czech output.mkv
Vložení titulků do kontejneru videa MP4
ffmpeg -i IN.mkv -i IN.srt -map 0:v -map 0:a -map 1 -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=Czech output.mkv
ffmpeg -i IN.mp4 -vf subtitles=SubIN.srt out.mp4
ffmpeg -i input.mp4 -vf "transpose=0" output_0.mp4