2013-03-13 6 views
0

ffmpeg 라이브러리에는 MP3 인코더가 있습니까?FFMPEG 라이브러리 MP3 인코더

이 :

AVCodec *pCodec = avcodec_find_encoder(AV_CODEC_ID_MP3); 

는 항상 null를 돌려줍니다. 나는 또한 AV_CODEC_ID_MP3ADU와 AV_CODEC_ID_MP3ON4를 시도했다. 그것들 역시 null을 리턴한다. 내가 찾은 유일한 인코딩 코덱은 AV_CODEC_ID_MP2입니다.

는 어떤 도움을

+0

누군가가 관심이있는 경우,이 문제를 해결하는 방법은 libmp3lame을 사용하여 ffmpeg를 작성하기 위해 d33pika가 아래에 응답 한 것과 같습니다. 우선 시스템에 libmp3lame을 컴파일해야했습니다. 그런 다음 libmp3lame 라이브러리를 ffmpeg에 연결하고 ffmpeg를 빌드합니다. 그렇다면 xcode에 ffmpeg 라이브러리를 추가하고 편의상 libmp3lame.c에있는 함수를 사용했습니다. ffmpeg 자체는 mp3 인코더와 함께 제공되지 않습니다. –

답변

2

libmp3lame이는 FFmpeg의 mp3 인코더입니다 감사합니다. 빌드의 구성 단계에서 활성화해야합니다. --enable-libmp3lame으로 설정해야합니다. 또한 libmp3lame-dev을 설치해야합니다. 당신이 이미있는 경우 https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide

빠르게 확인하려면 :

$ ffmpeg -codecs | grep mp3 
ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers 
    built on Jan 25 2013 15:16:27 with llvm_gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) 
    configuration: --prefix=/usr/local/Cellar/ffmpeg/0.11.1 --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --cc=/usr/bin/llvm-gcc --host-cflags='-Os -w -pipe -march=core2 -msse4 -mmacosx-version-min=10.7' --host-ldflags=-L/usr/local/lib --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid 
    libavutil  51. 54.100/51. 54.100 
    libavcodec  54. 23.100/54. 23.100 
    libavformat 54. 6.100/54. 6.100 
    libavdevice 54. 0.100/54. 0.100 
    libavfilter  2. 77.100/2. 77.100 
    libswscale  2. 1.100/2. 1.100 
    libswresample 0. 15.100/0. 15.100 
    libpostproc 52. 0.100/52. 0.100 
    EA libmp3lame  libmp3lame MP3 (MPEG audio layer 3) 
D A D mp3    MP3 (MPEG audio layer 3) 
D A D mp3adu   ADU (Application Data Unit) MP3 (MPEG audio layer 3) 
D A D mp3adufloat  ADU (Application Data Unit) MP3 (MPEG audio layer 3) 
D A D mp3float  MP3 (MPEG audio layer 3) 
D A D mp3on4   MP3onMP4 
D A D mp3on4float  MP3onMP4 

당신은 그 E (인코더)를 볼 수 있습니다 libmp3lame 함께 사용할 수 있습니다 내가는 FFmpeg을 설치하려면이 가이드를 따르십시오.

관련 문제