ffmpeg常用转换命令

  1. 1. mp4 to h264 raw
  2. 2. mp4 to ts
  3. 3. rtsp to rtmp
  4. 4. filt to rtmp
  5. 5. rtmp to file
  6. 6. rtmp to rtmp
  7. 7. jpg to file

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

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 wind.kaisa@gmail.com

×

喜欢就点赞,疼爱就打赏