aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/flvenc.c
diff options
context:
space:
mode:
authorJoseph Wecker <jwecker@justin.tv>2011-08-25 14:04:37 -0700
committerMichael Niedermayer <michaelni@gmx.at>2011-09-07 02:02:03 +0200
commit30bcd6a945ae296ef7b36a91cc21789a05de85d9 (patch)
treec5f55fdb31500d1943331ac7102fcbfd264f140e /libavformat/flvenc.c
parentb5d4c0e26e356ed11533ea43d83ab53d85f63781 (diff)
downloadffmpeg-30bcd6a945ae296ef7b36a91cc21789a05de85d9.tar.gz
flv: Ammon's changes migrated from 0.6.0 - I believe for the android broadcaster.
Diffstat (limited to 'libavformat/flvenc.c')
-rw-r--r--libavformat/flvenc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 5bf9809358..d790a12288 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -33,6 +33,8 @@
static const AVCodecTag flv_video_codec_ids[] = {
{CODEC_ID_FLV1, FLV_CODECID_H263 },
+ {CODEC_ID_H263, FLV_CODECID_REALH263},
+ {CODEC_ID_MPEG4, FLV_CODECID_MPEG4 },
{CODEC_ID_FLASHSV, FLV_CODECID_SCREEN},
{CODEC_ID_FLASHSV2, FLV_CODECID_SCREEN2},
{CODEC_ID_VP6F, FLV_CODECID_VP6 },
@@ -300,7 +302,7 @@ static int flv_write_header(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVCodecContext *enc = s->streams[i]->codec;
- if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) {
+ if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) {
int64_t pos;
avio_w8(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO ?
FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO);
@@ -342,7 +344,7 @@ static int flv_write_trailer(AVFormatContext *s)
for (i = 0; i < s->nb_streams; i++) {
AVCodecContext *enc = s->streams[i]->codec;
if (enc->codec_type == AVMEDIA_TYPE_VIDEO &&
- enc->codec_id == CODEC_ID_H264) {
+ (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)) {
put_avc_eos_tag(pb, flv->last_video_ts);
}
}
@@ -374,7 +376,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
if(enc->codec_id == CODEC_ID_VP6 || enc->codec_id == CODEC_ID_VP6F ||
enc->codec_id == CODEC_ID_AAC)
flags_size= 2;
- else if(enc->codec_id == CODEC_ID_H264)
+ else if(enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)
flags_size= 5;
else
flags_size= 1;
@@ -398,7 +400,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_w8(pb, FLV_TAG_TYPE_AUDIO);
}
- if (enc->codec_id == CODEC_ID_H264) {
+ if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) {
/* check if extradata looks like mp4 formated */
if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
if (ff_avc_parse_nal_units_buf(pkt->data, &data, &size) < 0)
@@ -428,7 +430,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_w8(pb, enc->extradata_size ? enc->extradata[0] : 0);
else if (enc->codec_id == CODEC_ID_AAC)
avio_w8(pb,1); // AAC raw
- else if (enc->codec_id == CODEC_ID_H264) {
+ else if (enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4) {
avio_w8(pb,1); // AVC NALU
avio_wb24(pb,pkt->pts - pkt->dts);
}