[FFmpeg-devel] [PATCH]Support tag H263 both for QuickTime / Perian and Flash Media Server
Carl Eugen Hoyos
cehoyos at ag.or.at
Wed Nov 14 11:59:37 CET 2012
Hi!
Flash Media Server streams f4v containing Sorenson Spark with tag H263, some
QuickTime users like to remux their H263 streams into mov.
I don't know how this can be solved differently.
Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 3271056..45e99cd 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -228,7 +228,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
{ AV_CODEC_ID_DIRAC, MKTAG('d', 'r', 'a', 'c') },
{ AV_CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n') }, /* AVID DNxHD */
-// { AV_CODEC_ID_FLV1, MKTAG('H', '2', '6', '3') }, /* Flash Media Server */
+// { AV_CODEC_ID_FLV1, MKTAG('H', '2', '6', '3') }, /* Flash Media Server, forced in demuxer */
{ AV_CODEC_ID_MSMPEG4V3, MKTAG('3', 'I', 'V', 'D') }, /* 3ivx DivX Doctor */
{ AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'V', '1', 'x') }, /* AVID 1:1x */
{ AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'V', 'u', 'p') },
diff --git a/libavformat/mov.c b/libavformat/mov.c
index f33a5ac..f1ce5e4 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1254,7 +1254,13 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
} else if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO && /* do not overwrite codec type */
format && format != MKTAG('m','p','4','s')) { /* skip old asf mpeg4 tag */
+ /* Flash Media Server streams files with Sorenson Spark and tag H263 */
+ if (strstr(av_dict_get(c->fc->metadata, "major_brand", NULL, AV_DICT_MATCH_CASE)->value, "f4v")
+ && format == MKTAG('H','2','6','3')) {
+ id = AV_CODEC_ID_FLV1;
+ } else {
- id = ff_codec_get_id(ff_codec_movvideo_tags, format);
+ id = ff_codec_get_id(ff_codec_movvideo_tags, format);
+ }
if (id <= 0)
id = ff_codec_get_id(ff_codec_bmp_tags, format);
if (id > 0)
More information about the ffmpeg-devel
mailing list