[FFmpeg-devel] [PATCH]Warn if s16be is muxed into flv

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Jan 15 23:31:32 CET 2014


Hi!

We should warn users when muxing s16be into flv. The specification suggests 
playback only on big-endian hardware.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index fb36f66..172503d 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -233,6 +233,9 @@ static int flv_write_header(AVFormatContext *s)
             audio_enc = enc;
             if (get_audio_flags(s, enc) < 0)
                 return AVERROR_INVALIDDATA;
+            if (enc->codec_id == AV_CODEC_ID_PCM_S16BE)
+                av_log(s, AV_LOG_WARNING,
+                       "16bit big-endian audio in flv is valid but most likely unplayable, use s16le\n");
             break;
         case AVMEDIA_TYPE_DATA:
             if (enc->codec_id != AV_CODEC_ID_TEXT) {


More information about the ffmpeg-devel mailing list