ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

常用命令

2021-07-27 20:03:40  阅读:206  来源: 互联网

标签:picture mp4 video file 常用命令 PDF png


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

标签:picture,mp4,video,file,常用命令,PDF,png
来源: https://www.cnblogs.com/tszwh/p/15067597.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有