ffmpeg常用转换命令 - Sat, Feb 20, 2021
ffmpeg常用转换命令
1. mp4 to h264 raw
ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
2. mp4 to ts
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
3. rtsp to rtmp
ffmpeg -i "rtsp://192.168.0.99:8554/1" -vcodec copy -acodec copy -f flv "rtmp://127.0.0.1:1935/live/ffmpeg"
4. filt to rtmp
ffmpeg -re -i file.flv -c copy -f flv "rtmp://127.0.0.1:1935/live/ffmpeg"
5. rtmp to file
ffmpeg -i "rtmp://127.0.0.1:1935/live/ffmpeg" -c copy dump.flv
6. rtmp to rtmp
ffmpeg -i "rtmp://127.0.0.1:1935/live/ffmpeg" -c:a libfaac -ar 44100 -ab 48k -c:v libx264 -vpre slow -vpre baseline -f flv "rtmp://127.0.0.1:1935/live/other"
7. jpg to file
ffmpeg -i INPUT.jpg -an -vcodec libx264 -coder 1 -flags +loop -cmp +chroma -subq 10 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -flags2 +dct8x8 -trellis 2 -partitions +parti8x8+parti4x4 -crf 24 -threads 0 -r 25 -g 25 -y OUTPUT.mp4