performous / composer

Song editor for Performous and other singing games
Other
39 stars 23 forks source link

FFMPEG error: Unsupported sample format #19

Closed iqqmuT closed 9 years ago

iqqmuT commented 9 years ago

Using master branch I inserted an MP3 file but I got this error:

FFMPEG error: Unsupported sample format
FFMPEG error: Unsupported sample format
FFMPEG error: Unsupported sample format
FFMPEG terminating due to errors

Seems that my MP3 was having sample format AV_SAMPLE_FMT_U8P which should be added to src/ffmpeg.cc.

http://ffmpeg.org/doxygen/trunk/group__lavu__sampfmts.html#gaf9a51ca15301871723577c730b5865c5

My setup:

nieknooijens commented 9 years ago

We have alot of audio issues, first of all we ported composer to qaudiodecoder (qt multimedia) which works perfect on linux, but is a piece of crap on windows, then there's the master/ffmpeg stuff in which I removed all the deprecated code so it'll compile correctly, but that breaks alot of shit ;-( I'll look into it next weekend. probably needs the new libavresample code to detect sample format and convert between them

yoda-jm commented 9 years ago

I think we should avoid detecting sample type here and always convert the audio into a known sample format (see performous code).

nieknooijens commented 9 years ago

@yoda-jm That's exatly what I meant, and you can do that with libavresample by setting: av_opt_set_int(avr, "in_sample_fmt", AV-CODEC_CONTEXT->sample_fmt, 0); av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);

then convert it with: out_samples = avresample_convert(avr, &output, out_linesize, out_samples, input, in_linesize, in_samples);

Like I did with performous.

nieknooijens commented 9 years ago

I pushed my first attempt to the new avresampledecode branch, in theory it shoud work, but in practice it doesn't. I was busy for 3 months fixing the old ffmpeg code in performous and this will be no exeption....

nieknooijens commented 9 years ago

I got everything working in the avresample-decode branch, hope it works!

nieknooijens commented 9 years ago

I merged it to master, everything should work now.