From 37daf9367a246f1e6086ee9c90cbbceaee869f68 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 18 Oct 2014 18:22:55 +0200 Subject: [PATCH] Update ffmpeg supported encoders list * Add FLAC, which works * Remove raw audio, ogg and AC3, as they are crashing the current ffmpeg version. Now it's possible to use MediaConvert to convert to FLAC, at least. For other formats we will need to either fix ffmpeg, or write encoders using the respective libraries (musepack, libvorbis, ...) for each format we want to support. Note that there are also some problems at the reading side, so using MediaConvert, the output will be truncated and about 2 seconds of audio will be missing at the end of the file in several cases. When this happens, the input file is not removed from the list. Watch out for this and don't delete the source files until you're very sure the output is correct! --- .../media/plugins/ffmpeg/EncoderTable.cpp | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp b/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp index b16e26fada..a404c47167 100644 --- a/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp +++ b/src/add-ons/media/plugins/ffmpeg/EncoderTable.cpp @@ -8,6 +8,7 @@ const EncoderDescription gEncoderTable[] = { + // Video codecs { { "MPEG-4 video", @@ -86,6 +87,127 @@ const EncoderDescription gEncoderTable[] = { B_MEDIA_ENCODED_VIDEO, 5 }, + + // Audio codecs + { + { + "Free Lossless Audio Codec (FLAC)", + "flac", + 0, + CODEC_ID_FLAC, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, + // All of those crash ffmpeg in one way or another... +#if 0 + { + { + "Advanced Audio Coding (AAC)", + "aac", + 0, + CODEC_ID_AAC, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, + { + { + "Dolby AC-3", + "ac3", + 0, + CODEC_ID_AC3, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, + { + { + "Apple Lossless Audio Codec", + "alac", + 0, + CODEC_ID_ALAC, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, + { + { + "Adaptive Transform Acoustic Coding", + "atrac", + 0, + CODEC_ID_ATRAC3, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, + { + { + "MPEG Layer III (MP3)", + "mp3", + 0, + CODEC_ID_MP3, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, + { + { + "Monkey's Audio", + "ape", + 0, + CODEC_ID_APE, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, + { + { + "Musepack", + "mpc", + 0, + CODEC_ID_MUSEPACK8, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, + { + { + "Windows Media Audio (WMA)", + "wma", + 0, + CODEC_ID_WMAV2, + { 0 } + }, + B_ANY_FORMAT_FAMILY, + B_MEDIA_RAW_AUDIO, + B_MEDIA_ENCODED_AUDIO, + 10 + }, { { "Raw audio", @@ -125,6 +247,7 @@ const EncoderDescription gEncoderTable[] = { B_MEDIA_ENCODED_AUDIO, 10 } +#endif }; const size_t gEncoderCount = sizeof(gEncoderTable) / sizeof(EncoderDescription);