Hi everybody,
I am trying to implement the functionality ffmpeg provides using the
parameters -vcodec copy to cut videos.
It actually works quite fine with most of the codecs and formats except
for raw-videos in an AVI-Container.
The original file is coded BottomUp as indicated by the extradata of the
used codec for the corresponding stream.
When I copy the extradata to the copied stream, copy the packages I need
and write the resulting file back to disk the Video appears to be
flipped BottomUp :-(
Not only my code creates such videos, but also ffmpeg using the command:
ffmpeg -an -y -t 10 -i RAWVIDEO.avi -vcodec copy subclip.avi
Has anybody experienced simmilar problems using libav with rawvideo?
I think that some vital parameters of the format or the codec are not
copied, but I cant figure out which one.
I also noticed a bug in avidec.c when decoding the correct
extradata_size, which should be fixed using the applied patch.
When using the patch, the libav internal decoder detects it correctly
and decodes correctly oriented viedoframes.
The Problem is, that external players (like vlc or Windows MediaPlayer)
do not (of course as they dont use my patche source ;-).
Best Regards,
Philip
--- ffmpeg-r25767/libavformat/avidec.c 2010-11-29 12:49:09.703155200 +0100
+++ ffmpeg-r25767/libavformat/avidec.c.new 2010-11-29 12:42:15.527465700
+0100
@@ -484,7 +484,7 @@
url_fskip(pb, size);
break;
}
- get_le32(pb); /* size */
+ unsigned int real_size = get_le32(pb); /* size */
st->codec->width = get_le32(pb);
st->codec->height = (int32_t)get_le32(pb);
get_le16(pb); /* panes */
@@ -503,8 +503,8 @@
break;
}
- if(size > 10*4 && size<(1<<30)){
- st->codec->extradata_size= size - 10*4;
+ if(real_size > 10*4 && real_size<(1<<30)){
+ st->codec->extradata_size= real_size - 10*4;
st->codec->extradata=
av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata) {
st->codec->extradata_size= 0;
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user