2017-09-14 4 views
0

Meine Eingabe ist eine MP4-Videodatei.MP3-Audio aus Video mit ffmpeg kann nicht extrahiert werden

Versuch # 1

ffmpeg -i pipe:0 -y -map a media/73.mp3 

Fehler:

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! 

Versuch # 2

ffmpeg -i pipe:0 -y -vn -acodec copy media/72.mp3 

Fehler:

[...] 
[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 

Versuch # 3

ffmpeg -i pipe:0 -y -codec:a libmp3lame -qscale:a 2 media/74.mp3 

kein Fehler mit ffmpeg, aber die Datei ist ungültig (seine Größe beträgt 334 Bytes)


Versuchen # 4

ffmpeg -i pipe:0 -y -vn -acodec mp3 media/78.mp3 

Kein Fehler mit ffmpeg, aber die Datei ist invali d (seine Größe beträgt 334 Bytes)


Try # 5

ffmpeg -f mp4 -i pipe:0 -y media/80.mp3 

kein Fehler mit ffmpeg, aber die Datei ist ungültig (seine Größe beträgt 334 Bytes)


Was mache ich falsch? Dies scheint eine ziemlich einfache Sache zu tun ...

+1

Warum sind Sie Rohr versuchen die MP4-Datei anstatt es wie eine normale Eingabe zu verwenden? 'ffmpeg -i input.mp4 output.mp3' – LordNeckbeard

+0

Ich benutze' node-fluent-ffmpeg' und dachte, dass es einen 'ReadStream' benötigt. Sie haben recht, wenn Sie direkt auf den Pfad der Eingabedatei zeigen, funktioniert das wie erwartet. Ich frage mich, warum das Video nicht funktioniert, ich habe kein Problem beim Konvertieren von Audiodateien (z. B. WAV in MP3). Außerdem können wir sehen, dass das Video eine gültige Eingabe in der ersten Fehlermeldung ist, die ich gepostet habe. Wie auch immer, danke für die Hilfe. – maximedupre

+0

Typische MP4-Dateien sind nicht rohrfreundlich. – LordNeckbeard

Antwort

1

diese .mp3 für Extrakt Versuchen:

ffmpeg -i video.mp4 -map 0:a -acodec libmp3lame out.mp3 

Und vielleicht dies nützlich für Extrakt .m4a:

ffmpeg -i video.mp4 -map 0:a -c copy out.m4a 
Verwandte Themen