- 59
- 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=alwaysfilter is used to select the video and audio streams, ensuring that the progress is displayed for all audio and video streams. The-r 30option specifies the frame rate of the video (30 frames per second),-ac 2specifies 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 libx264option specifies the codec (libx264) to use for the output. Thelibx264codec 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. TheshowProgress=onoption sets the value of theshowProgressoption in the output file'sFFmpeg Infossection.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.
- 扫一扫访问手机版
回答动态

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器更新之后。服务器里面有部分玩家要重新创建角色是怎么回事啊?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题函数计算不同地域的是不能用内网吧?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题ARMS可以创建多个应用嘛?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题在ARMS如何申请加入公测呀?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题前端小程序接入这个arms具体是如何接入监控的,这个init方法在哪里进行添加?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器刚到期,是不是就不能再导出存档了呢?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器的游戏版本不兼容 尝试更新怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器服务器升级以后 就链接不上了,怎么办?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器转移以后服务器进不去了,怎么解决?预计能赚取 0积分收益

- 神奇的四哥:发布了悬赏问题阿里云幻兽帕鲁服务器修改参数后游戏进入不了,是什么情况?预计能赚取 0积分收益
- 回到顶部
- 回到顶部

