- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将 MP4 文件转换为以 16,000 Hz 采样的单声道 WAV 文件。
当我运行以下代码时,持续时间从 开始00:09:59.99 (MP4) 至 00:09:57.64 (WAV)。它的原始较长版本从 00:48:37.46 (MP4) 到 00:48:23.38 (WAV)。
ffmpeg -i <FILE_NAME>.mp4 -ac 1 -ar 16000 <FILE_NAME>.wav
ffmpeg -I <FILE_NAME>.mp4 -vn -acodec copy <FILE_NAME>.aac
Report written to "ffmpeg-20200610-093115.log"
Command line:
ffmpeg -i short.mp4 -ac 1 -ar 16000 short.wav -report
ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'short.mp4'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '1'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '16000'.
Reading option 'short.wav' ... matched as output url.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url short.mp4.
Successfully parsed a group of options.
Opening an input file: short.mp4.
[NULL @ 0x7f98a3008200] Opening 'short.mp4' for reading
[file @ 0x7f98a2904440] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] ISO: File Type Major Brand: mp42
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Processing st: 0, edit list 0 - media time: 0, duration: 7679872
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Processing st: 1, edit list 0 - media time: 1024, duration: 26459559
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] drop a frame at curr_cts: 0 @ 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] Before avformat_find_stream_info() pos: 11213917 bytes read:318782 seeks:1 nb_streams:2
[h264 @ 0x7f98a3808800] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 0x7f98a3808800] nal_unit_type: 8(PPS), nal_ref_idc: 3
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] demuxer injecting skip 1024 / discard 0
[aac @ 0x7f98a1008c00] skip 1024 / discard 0 samples due to side data
[h264 @ 0x7f98a3808800] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x7f98a3808800] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 0x7f98a3808800] Format yuv420p chosen by get_format().
[h264 @ 0x7f98a3808800] Reinit context to 640x368, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f98a3008200] After avformat_find_stream_info() pos: 21961 bytes read:351550 seeks:2 frames:46
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'short.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: isommp41mp42
creation_time : 2020-06-10T16:12:17.000000Z
Duration: 00:09:59.99, start: 0.000000, bitrate: 149 kb/s
Stream #0:0(eng), 1, 1/12800: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 47 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
creation_time : 2020-06-10T16:12:17.000000Z
handler_name : Core Media Video
Stream #0:1(eng), 45, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 98 kb/s (default)
Metadata:
creation_time : 2020-06-10T16:12:17.000000Z
handler_name : Core Media Audio
Successfully opened the file.
Parsing a group of options: output url short.wav.
Applying option ac (set number of audio channels) with argument 1.
Applying option ar (set audio sampling rate (in Hz)) with argument 16000.
Successfully parsed a group of options.
Opening an output file: short.wav.
[file @ 0x7f98a0c1db40] Setting default whitelist 'file,crypto'
Successfully opened the file.
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[aac @ 0x7f98a100de00] skip 1024 / discard 0 samples due to side data
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
detected 12 logical cores
[graph_0_in_0_1 @ 0x7f98a0e2c4c0] Setting 'time_base' to value '1/44100'
[graph_0_in_0_1 @ 0x7f98a0e2c4c0] Setting 'sample_rate' to value '44100'
[graph_0_in_0_1 @ 0x7f98a0e2c4c0] Setting 'sample_fmt' to value 'fltp'
[graph_0_in_0_1 @ 0x7f98a0e2c4c0] Setting 'channel_layout' to value '0x4'
[graph_0_in_0_1 @ 0x7f98a0e2c4c0] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x4
[format_out_0_0 @ 0x7f98a0e2cb80] Setting 'sample_fmts' to value 's16'
[format_out_0_0 @ 0x7f98a0e2cb80] Setting 'sample_rates' to value '16000'
[format_out_0_0 @ 0x7f98a0e2cb80] Setting 'channel_layouts' to value '0x4'
[format_out_0_0 @ 0x7f98a0e2cb80] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_0'
[AVFilterGraph @ 0x7f98a0c16ac0] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_resampler_0 @ 0x7f98a0e2d540] [SWR @ 0x7f98a28e1000] Using fltp internally between filters
[auto_resampler_0 @ 0x7f98a0e2d540] ch:1 chl:mono fmt:fltp r:44100Hz -> ch:1 chl:mono fmt:s16 r:16000Hz
Output #0, wav, to 'short.wav':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: isommp41mp42
ISFT : Lavf58.20.100
Stream #0:0(eng), 0, 1/16000: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s (default)
Metadata:
creation_time : 2020-06-10T16:12:17.000000Z
handler_name : Core Media Audio
encoder : Lavc58.35.100 pcm_s16le
size= 17152kB time=00:09:16.63 bitrate= 252.4kbits/s speed=1.11e+03x
[out_0_0 @ 0x7f98a0e2c700] EOF on sink link out_0_0:default.
No more output streams to write to, finishing.
size= 18676kB time=00:09:59.99 bitrate= 255.0kbits/s speed=1.11e+03x
video:0kB audio:18676kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000408%
Input file #0 (short.mp4):
Input stream #0:0 (video): 1 packets read (3689 bytes);
Input stream #0:1 (audio): 25739 packets read (7375414 bytes); 25738 frames decoded (26355712 samples);
Total: 25740 packets (7379103 bytes) demuxed
Output file #0 (short.wav):
Output stream #0:0 (audio): 25739 frames encoded (9562163 samples); 25739 packets muxed (19124326 bytes);
Total: 25739 packets (19124326 bytes) muxed
25738 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7f98a0c1dc40] Statistics: 4 seeks, 76 writeouts
[AVIOContext @ 0x7f98a29045c0] Statistics: 10902846 bytes read, 29 seeks
最佳答案
MP4、MKV 等容器存储带有时间戳的数据包。其副产品之一是它允许通过简单地调整数据包的时间戳来表示音轨中的静音,这些数据包旨在在它们之间保持静音。像 WAV 或原始 AAC 比特流这样的容器没有时间戳,因此以这种方式编码的任何“静默”都会丢失。
您的输入音频为 44100 Hz。在日志末尾附近的这一行中,
Input stream #0:1 (audio): 25739 packets read (7375414 bytes); 25738 frames decoded (26355712 samples);
26355712 samples
.在 44100 Hz 时,即
~597.6351 seconds
.这就是你在 WAV 输出中得到的。
ffmpeg -i <FILE_NAME>.mp4 -af aresample=async=1 -ac 1 -ar 16000 <FILE_NAME>.wav
关于audio - FFMPEG 视频到音频的转换结果在不同的持续时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62308695/
我正在尝试使用 ldash 等选项和 http_opts ,正如 dash muxer 文档所描述的,但 FFmpeg 无法识别它们。我正在使用最新发布的 ffmpeg v4.2.2 版本。我在 ff
假设我们有许多想要与 -vcodec 副本(或等效语法)合并的视频记录。无需重新编码,不会损失质量。并且很少有记录(minor set),有另外的编解码器,参数等等。所以我们可以使用 ffprobe
有没有办法安装 ffmpeg 没有root访问权限?使用 ./configure 无法做到这一点来自 git 克隆 git://source.FFmpeg.org/fFFmpeg.git 最佳答案 是
在应用程序中直接使用 FFmpeg 与使用 Ffmpeg 命令行有什么区别? 最佳答案 没有:FFmpeg 命令行只是一个使用 FFmpeg API 的应用程序。当然,在使用该应用程序时,您仅限于已实
我正在使用以下命令对文件(下面的媒体信息)进行编码: ffmpeg -i AHomeMovie.mkv -map 0 -c copy -c:v libx264 -preset veryslow -cr
我正在制作一张圣诞贺卡,我需要将视频嵌入到右侧(边框内)的卡片中,并在左侧显示一些文本。 为简单起见,假设我有一个带有透明孔的盒子。我想在那个洞里显示视频。 我正在使用 ffmpeg-python很高
我正在使用 laravel ffmpeg 为视频创建缩略图,但是当我运行代码时,它返回给我 Call to undefined method FFMpeg\FFMpeg::fromDisk() 我不知
我为我的 nvidia 下载了 cuda 驱动程序 但它仍然不使用我的 GPU,它仍然使用 cpu。 我怎样才能让它使用GPU。 我也听说过硬件加速,但那不起作用。 它必须是 h.264 最佳答案 你
尝试剪切视频的多个部分时,我遵循此问题的解决方案 Cut multiple parts of a video with ffmpeg .但问题是,如果我剪切多次(比如大约 20 次或更多),视频和音频
所以我最近开始在我打算在商业上分发的应用程序中实现 ffmpeg。而且我很难理解整个许可过程。 我见过的最常回答的问题似乎是关于 x264,它需要 x264.org 的付费许可才能在商业上使用它(对吗
我使用 ffmpeg 更改视频文件的分辨率,转换到另一个位置后,视频持续 0 秒,但最初持续 2 分钟 我的ffmepg代码: ffmpeg -i input.mp4 -filter:v scale=
如上: FFMPEG 不支持在没有第三部分库的情况下加载外部过滤器是否有特定原因? (像弗莱0r) 我必须重新编译整个包来添加一个新的过滤器! 最佳答案 只有开发人员可以肯定地回答,但我会冒安全风险和
我收到了一个编码器,我需要用 FFMPEG 编译,我是新手,所以我不知道如何用 ffmpeg 添加/编译它。编码器是JSV,我的服务器是ubuntu 14.04。 我已经开始阅读这篇 https://
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为
我正在制作一个利用 ffmpeg 重新混合和转码视频文件的程序。我想使用 ffmpeg -codecs和 ffmpeg -formats (或通过 ffmpeg 可用的任何其他命令)来检查我可以在哪些
这个问题在这里已经有了答案: ffmpeg moving text drawtext (1 个回答) 3年前关闭。 我正在使用此命令使用 ffmpeg 将文本从一个地方移动到另一个地方 ffmpeg
为什么 ffmpeg/ffprobe 为流和整个文件提供不同的比特率值? 当我使用 ffprobe 分析 mp3 文件时,它会在第一行和第二行给出不同的比特率。 有谁知道,有什么区别? // File
如何在ffmpeg中使用drawtext在视频上绘制多色文本? 示例:我想突出句子中的专有名词, “XYZ公司股价上涨91%” 高亮 XYZ 白色 黄色 用绿色突出显示 91% 如果您有任何其他方法不
我想让我的不和谐机器人播放音乐,但我不断收到“找不到 FFMPEG”错误。 我的机器人主要是由 ping 制成的,所以我不会上传那部分。音乐代码应该是这个。 const Discord = requi
我需要帮助在 ffmpeg drawtext 过滤器中正确/(完全)显示德语变音符号“äüö”。我现在不能说我的无能是由于缺乏 ffmpeg 专业知识或机器配置,还是两者兼而有之。非常感谢您的意见。
我是一名优秀的程序员,十分优秀!