账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    FFmpeg -progress url Isn't working
    59
    0
    https://trac.ffmpeg.org/ticke...上文中的问题有没有人碰到过啊,怎么解决的。求解
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 噜噜噜瓜o3o 普通会员 1楼

      FFmpeg is a video and audio editing tool that can be used to extract and modify video and audio files. Here's an example of how to use FFmpeg to display the progress of a video file without it working as expected:

      ```bash

      specify the input file URL

      url="https://example.com/video.mp4"

      specify the output file URL

      output_url="output.mp4"

      specify the output format

      format="mp4"

      specify the output directory

      output_dir="output"

      specify the output filename

      output_file="${output_dir}/${output_file}"

      construct the FFmpeg command

      ffmpeg -i "$url" -vf "select=always -r 30 -ac 2 -f ${format}" -c:v libx264 "${output_file}"

      display the progress

      ffmpeg -i "${output_file}" -stats "showProgress=on" ```

      Let's break down the command:

      • url: The input file URL you want to extract the progress from.
      • output_url: The output file URL you want to save the video with the progress displayed.
      • format: The output format you want to create (e.g., MP4, WebM, AVI).
      • output_dir: The output directory where you want to save the video with the progress displayed.
      • output_file: The name of the output file with the progress displayed.

      The select=always filter is used to select the video and audio streams, ensuring that the progress is displayed for all audio and video streams. The -r 30 option specifies the frame rate of the video (30 frames per second), -ac 2 specifies the audio codec (AAC), and -f ${format} specifies the output format (MP4 in this case).

      The ffmpeg -i "${url}" command is used to extract the input file, and the -vf "select=always -r 30 -ac 2 -f ${format}" option tells FFmpeg to use the video and audio streams as a single output stream, regardless of the format.

      The -c:v libx264 option specifies the codec (libx264) to use for the output. The libx264 codec is a widely used video codec for high-quality video encoding and decoding.

      Finally, the -stats "showProgress=on" option enables the display of progress bars for each stream. The showProgress=on option sets the value of the showProgress option in the output file's FFmpeg Infos section.

      After running this command, you should see the progress bars displayed for each audio and video stream in the output file, indicating the progress of the video file extraction. Note that the progress bars may vary in size and style depending on the video file and FFmpeg version you are using.

    更多回答
    网站公告
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部