User Tools

Site Tools


it:nastroje:ffmpeg

This is an old revision of the document!


ffmpeg

Vypsaní informací o video souboru

ffprobe -v error -show_format -show_streams input.mp4
ffmpeg -hide_banner -i input.mkv

Konverze na h.265

#!/bin/bash

fromBR=`ffprobe -v error -show_entries format=bit_rate -of default=noprint_wrappers=1:nokey=1 $1`
toBR=`awk "BEGIN {print $fromBR*0.50}"`
maxBR=`awk "BEGIN {print $fromBR*1.0}"`
toFILE=`echo ${1%.*}`
CRF=23


echo FROM:$fromBR
echo TO:  $toBR
echo MAX: $maxBR


# TWO WAY METHOD
ffmpeg -y -i $1 -c:v libx265 -preset slow -b:v $toBR -maxrate $maxBR -x265-params pass=1 -an -f mp4 /dev/null 
   ffmpeg -i $1 -c:v libx265 -preset slow -b:v $toBR -maxrate $maxBR -x265-params pass=2 -c:a copy -c:s copy $toFILE.BR$toBR.h265.MIML.mp4


#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.mp4

Konverze na h.264

ffmpeg -i ./input.mkv -map 0 -c:a copy -c:s copy -c:v libx264 output.mkv

Spojení

MPEG-2
ffmpeg -i "concat:input1.ts|input2.ts|input3.ts" -c copy output.ts
MP4
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
it/nastroje/ffmpeg.1548601264.txt.gz · Last modified: 2019/08/02 11:18 (external edit)