Video Can';t使用ffmpeg从视频中提取mp3音频
我的输入是一个.mp4视频文件 试试看 错误:Video Can';t使用ffmpeg从视频中提取mp3音频,video,ffmpeg,fluent-ffmpeg,Video,Ffmpeg,Fluent Ffmpeg,我的输入是一个.mp4视频文件 试试看 错误: ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.1.0 (clang-802.0.42) configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.42)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f977d800000] stream 1, offset 0xa8: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f977d800000] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(smpte170m/smpte170m/bt709), 320x176, 300 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2012-03-13T08:58:06.000000Z
encoder : HandBrake 0.9.6 2012022800
Duration: 00:00:10.03, bitrate: N/A
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none(smpte170m/smpte170m/bt709), 320x176, 300 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2012-03-13T08:58:06.000000Z
encoder : JVT/AVC Coding
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
Metadata:
creation_time : 2012-03-13T08:58:06.000000Z
Stream #0:2(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s
Metadata:
creation_time : 2012-03-13T08:58:06.000000Z
Stream #0:3(und): Subtitle: mov_text (text / 0x74786574), 0 kb/s
Metadata:
creation_time : 2012-03-13T08:58:06.000000Z
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> mp3 (libmp3lame))
Stream #0:2 -> #0:1 (aac (native) -> mp3 (libmp3lame))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f977d800000] stream 1, offset 0xa8: partial file
pipe:0: Invalid data found when processing input
Finishing stream 0:0 without any data written to it.
Finishing stream 0:1 without any data written to it.
[mp3 @ 0x7f977b846800] Invalid audio stream. Exactly one MP3 audio stream is required.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
Conversion failed!
[...]
[mp3 @ 0x7febed835200] Invalid audio stream. Exactly one MP3 audio stream is required.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
试试看 错误:
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 8.1.0 (clang-802.0.42)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f977d800000] stream 1, offset 0xa8: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f977d800000] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(smpte170m/smpte170m/bt709), 320x176, 300 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2012-03-13T08:58:06.000000Z
encoder : HandBrake 0.9.6 2012022800
Duration: 00:00:10.03, bitrate: N/A
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none(smpte170m/smpte170m/bt709), 320x176, 300 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2012-03-13T08:58:06.000000Z
encoder : JVT/AVC Coding
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
Metadata:
creation_time : 2012-03-13T08:58:06.000000Z
Stream #0:2(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s
Metadata:
creation_time : 2012-03-13T08:58:06.000000Z
Stream #0:3(und): Subtitle: mov_text (text / 0x74786574), 0 kb/s
Metadata:
creation_time : 2012-03-13T08:58:06.000000Z
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> mp3 (libmp3lame))
Stream #0:2 -> #0:1 (aac (native) -> mp3 (libmp3lame))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f977d800000] stream 1, offset 0xa8: partial file
pipe:0: Invalid data found when processing input
Finishing stream 0:0 without any data written to it.
Finishing stream 0:1 without any data written to it.
[mp3 @ 0x7f977b846800] Invalid audio stream. Exactly one MP3 audio stream is required.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
Conversion failed!
[...]
[mp3 @ 0x7febed835200] Invalid audio stream. Exactly one MP3 audio stream is required.
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
试试看
ffmpeg
没有错误,但文件无效(大小为334字节)
试试看
ffmpeg
没有错误,但文件无效(大小为334字节)
试试看
ffmpeg
没有错误,但文件无效(大小为334字节)
我做错了什么?这似乎是一件相当容易的事情…请尝试此提取
.mp3
:
ffmpeg -i video.mp4 -map 0:a -acodec libmp3lame out.mp3
这可能对摘录.m4a
有用:
ffmpeg -i video.mp4 -map 0:a -c copy out.m4a
请尝试以下内容以提取
.mp3
:
ffmpeg -i video.mp4 -map 0:a -acodec libmp3lame out.mp3
这可能对摘录.m4a
有用:
ffmpeg -i video.mp4 -map 0:a -c copy out.m4a
所有这些都是通过中的
backendscript
来说明的
aac音频流需要专用的aac容器!作为mp3音频
流需要一个专用的mp3容器!当我们
正在尝试将AAC流存储在MP3容器中。要解决这个问题,
将输出文件的扩展名从.mp3更改为.aac
生成错误无效的音频流。只需要一个MP3音频流
ffmpeg -i input.mp4 -vn -acodec copy output.mp3
工作正常
ffmpeg -i input.mp4 -vn -acodec copy output.aac
所有这些都是通过中的
backendscript
来说明的
aac音频流需要专用的aac容器!作为mp3音频
流需要一个专用的mp3容器!当我们
正在尝试将AAC流存储在MP3容器中。要解决这个问题,
将输出文件的扩展名从.mp3更改为.aac
生成错误无效的音频流。只需要一个MP3音频流
ffmpeg -i input.mp4 -vn -acodec copy output.mp3
工作正常
ffmpeg -i input.mp4 -vn -acodec copy output.aac
当输出通过不可查找的协议(如管道)写入时,FFmpeg无法更新WAVE文件中的元数据。Quicktime似乎依赖元数据来确定文件的有效性。您必须写入文件或其他可查找的协议
请参阅
当输出通过不可查找的协议(如管道)写入时,FFmpeg无法更新WAVE文件中的元数据。Quicktime似乎依赖元数据来确定文件的有效性。您必须写入文件或其他可查找的协议
请参阅。为什么要尝试通过管道传输MP4文件,而不是像普通输入一样使用它
ffmpeg-i input.mp4 output.mp3
我正在使用node fluent ffmpeg
,我认为这需要一个ReadStream
。您说得对,直接指向输入文件路径的操作与预期的一样。我想知道为什么管道视频不工作,我没有问题转换音频文件(如wav到mp3)时,管道。此外,我们可以看到视频是我发布的第一条错误消息中的有效输入。无论如何,谢谢你的帮助。典型的MP4文件不是管道友好的。为什么会这样?为什么你要尝试管道MP4文件,而不是像普通输入一样使用它ffmpeg-i input.mp4 output.mp3
我正在使用node fluent ffmpeg
,我认为这需要一个ReadStream
。您说得对,直接指向输入文件路径的操作与预期的一样。我想知道为什么管道视频不工作,我没有问题转换音频文件(如wav到mp3)时,管道。此外,我们可以看到视频是我发布的第一条错误消息中的有效输入。无论如何,谢谢你的帮助。典型的MP4文件对管道不友好。为什么会这样?