码迷,mamicode.com
首页 > 其他好文 > 详细

常用命令

时间:2021-07-28 21:17:46      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:tar   相关   device   wan   files   current   out   comm   wing   

ffmpeg相关操作参考点这儿

  1. 视频截取gif 参考这儿
    ffmpeg -ss 00:00:20 -i sample.mp4 -to 10 -r 10 -vf scale=200:-1 cutekid_cry.gif

    • ss : indicates the starting point of GIF
    • i : input file sample.mp4 : My video file name
    • to : End position of the GIF file
    • r : frame rate. You can increase the value to get more quality GIF file
    • vf : filter graph. To scale the GIF image in the desired size.
  2. 播放视频
    ffplay audio.mp3

  3. PDF转视频 参考这儿

    • PDF转图片
      convert -density 400 input.pdf picture.png

    Here, -density 400 specifies the horizontal resolution of the output image file(s).

    The above command will convert all pages in the given PDF file to PNG format. Each page in the PDF file will be converted into a PNG file and they will be saved in the current directory with file name picture-1.png, picture-2.png ... and so on. Please be patient. It will take a while depending on the number of pages in the input PDF file.

    Once all pages in the PDF converted into PNG format, run the following command to create a video file from the PNG files.

    • 图片转视频
      fmpeg -r 1/10 -i picture-%01d.png -c:v libx264 -r 30 -pix_fmt yuv420p video.mp4

    Here,

    -r 1/10 : Display each image for 10 seconds.
    -i picture-%01d.png : Reads all pictures that starts with name "picture-", following with 1 digit (%01d) and ending with .png. If the images name comes with 2 digits (I.e picture-10.png, picture11.png etc), use (%02d) in the above command.
    -c:v libx264 : Output video codec (i.e h264).
    -r 30 : framerate of output video
    -pix_fmt yuv420p : Output video resolution
    video.mp4 : Output video file with .mp4 format.
    After the video is created, you can watch it from any devices that supports .mp4 format. After the video is created, you can watch it from any devices that supports .mp4 format. Next, I need to find a way to insert a cool music to my video. I hope it won‘t be difficult either.

    If you wanted it in higher pixel resolution, you don‘t have to start all over again. Just convert the output video file to any other higher/lower resolution of your choice, say 720p, as shown below.

    • 视频加入音乐
      ffmpeg -i video.mp4 -vf scale=-1:720 video_720p.mp4
  4. 视频转mp3
    ffmpeg -i .\a.flv -vn b.mp3

常用命令

标签:tar   相关   device   wan   files   current   out   comm   wing   

原文地址:https://www.cnblogs.com/tszwh/p/15067597.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!