[FFmpeg-user] no encoding of VP6 flv files

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Feb 3 18:41:29 CET 2012


On Friday 03 February 2012 02:31:35 pm Marc Waesche wrote:

> I use ffmpeg for merging a video track (flv) and a audio track (mp3)
> together without new encoding. It runs on a debian linux server. For
> building a new header I use flvtool2. That works perfect with a flv file
> encoded with h.264 as video input but does not work with flv files
> encoded with VP6. I need this to use alpha channel. Is this a bug or is
> VP6 not provided by ffmpeg?

Encoding to VP6A (VP6 with transparency support) is not supported but ...

> Here is the command line: ffmpeg -i
> "video.flv" -i "audio.mp3" -vcodec copy -acodec copy "video_and_audio.flv"

... this command line does not encode anything but only tries to remux.

Could you test attached patch?

Thank you, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 3f034bc..fee22f6 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -39,6 +39,7 @@ static const AVCodecTag flv_video_codec_ids[] = {
     {CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2},
     {CODEC_ID_VP6F,    FLV_CODECID_VP6   },
     {CODEC_ID_VP6,     FLV_CODECID_VP6   },
+    {CODEC_ID_VP6A,    FLV_CODECID_VP6A  },
     {CODEC_ID_H264,    FLV_CODECID_H264  },
     {CODEC_ID_NONE,    0}
 };
@@ -407,7 +408,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
 //    av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n", enc->codec_type, timestamp, size);
 
     if(enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6F ||
-       enc->codec_id == CODEC_ID_AAC)
+       enc->codec_id == CODEC_ID_VP6A || enc->codec_id == CODEC_ID_AAC)
         flags_size= 2;
     else if(enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)
         flags_size= 5;
@@ -477,7 +478,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
     if(flags_size)
         avio_w8(pb,flags);
 
-    if (enc->codec_id == CODEC_ID_VP6)
+    if (enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6A)
         avio_w8(pb,0);
     if (enc->codec_id == CODEC_ID_VP6F)
         avio_w8(pb, enc->extradata_size ? enc->extradata[0] : 0);


More information about the ffmpeg-user mailing list