FFmpeg 1.0 < 오디오 재생 문제 유발 (FFmpeg 1.0 < causing audio playback issues)


문제 설명

FFmpeg 1.0 < 오디오 재생 문제 유발 (FFmpeg 1.0 < causing audio playback issues)

I have an audio streamer based on ffplay. It works great using ffmpeg 0.11 but when I use ffmpeg 1.0 or the latest 1.2 release the audio seems to be decoded or played weirdly. 

Essentially it sounds like chipmunks with mp3 streams and with aac streams I hear tons of static barely hearing the actual stream and the actual stream sounds slow.

Any ideas the possible changes in ffmpeg that could have caused these types of issues?

Similar issue was posted here but no actual answer about what is going on. Supposedly this code reproduces the same issue.

UPDATE 1: I have done a step by step copy from ffplay and still no luck! :/ The channel and sampling rate look correct so there must be something internally that is returning a weird decoded format?


참조 솔루션

방법 1:

Found a fix... So initially it sounded like something wasn't matching correctly with the decoded raw PCM data and my PCM player. I took a deeper look at what was being returned by the decoder and any potential differences. Turns out that the default decoded format has changed from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_S16P. The fix was to simply specify pCodecCtx‑>request_sample_fmt = AV_SAMPLE_FMT_S16; before opening the decoder. 

Any feedback if this is a bad idea? I'm concerned if there might be issues with other formats and potential performance issues...

방법 2:

pCodecCtx‑>request_sample_fmt = AV_SAMPLE_FMT_S16 doesn't change the behavior! I didn't find any better solution than using swr_convert to convert audio sample from AV_SAMPLE_FMT_FLT to AV_SAMPLE_FMT_S16.

(by JonaJonaSteven)

참조 문서

  1. FFmpeg 1.0 < causing audio playback issues (CC BY‑SA 3.0/4.0)

#C++ #android-ndk #FFmpeg #C






관련 질문

파일의 암호화/복호화? (Encryption/ Decryption of a file?)

이상한 범위 확인 연산자가 있는 C++ typedef (C++ typedef with strange scope resolution operator)

개체 배열 매개변수--오류: '문자' 필드에 불완전한 유형이 있습니다. (Object array parameter--error: field ‘letters’ has incomplete type)

C++에서 메모리 삭제 (Deleting memory in c++)

C++ 프로그램을 실행할 수 없습니다. No se ejecuta el programa (C++ i can't run a program. No se ejecuta el programa)

컴파일 시 변수의 이름과 수명 (Name and lifetime of variables at compile time)

control-c 후 Visual Studio 콘솔 프로그램 충돌 (visual studio console program crashes after control-c)

멤버 변수에 std::enable_if 또는 유사한 메서드 사용 (Using std::enable_if or similar method on member variable)

ifstream input_file(filename); (I am receiving an error "no matching function to call" in the line ifstream input_file(filename);)

ESP8266에서 잠시 실행하면 JsonData 크기가 0이 됩니다. (JsonData size becomes zero after awhile of running in ESP8266)

합에 대한 속도 문제(제수의 합) (Speed problem for summation (sum of divisors))

벡터 벡터에서 하위 벡터의 첫 번째 값을 찾기 위해 begin() 및 end() 반복기의 범위를 지정하는 방법은 무엇입니까? (How to specify a range for begin() and end() iterators to find first value of sub vector in a vector of vectors?)







코멘트