[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
Joakim Plate elu...@ecce.se added the comment: You are so right. Sorry for the noise. FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563
[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
Ronald S. Bultje rsbul...@gmail.com added the comment: Fixed in 4acc94e97a9551d11ead29735e23283d71f1d4c2. -- status: new - closed substatus: new - fixed FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563
[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
Ronald S. Bultje rsbul...@gmail.com added the comment: no, the 1st stream has idnex 0, the second index 1, 100th index 99. FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563
[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
Ronald S. Bultje rsbul...@gmail.com added the comment: Here is a forward from ffmpeg-devel. Please adjust the patch so it has the correct message and MAX_STREAMS (100, not 99, since they're numbered from 0 onwards, not 1 onwards), and then it's OK. 2011/1/24 Måns Rullgård m...@mansr.com: Ronald S. Bultje rsbul...@gmail.com writes: Hi guys, posting next patch: longstone zhibing@hotmail.com added the comment: Add error check in avi_write_header() function. Looks fine to me, although I guess 99 should be 100 (100 streams means IDs 00-99). Correct. Ronald Index: libavformat/avi.h === --- libavformat/avi.h (revision 26402) +++ libavformat/avi.h (working copy) @@ -32,6 +32,7 @@ #define AVI_MAX_RIFF_SIZE 0x4000LL #define AVI_MASTER_INDEX_SIZE 256 +#define AVI_MAX_STREAM_COUNT 99 //AVI format is able to assign stream ID for at most 99 streams Wrong value and useless comment. /* index flags */ #define AVIIF_INDEX 0x10 Index: libavformat/avienc.c === --- libavformat/avienc.c (revision 26402) +++ libavformat/avienc.c (working copy) @@ -85,8 +85,8 @@ static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type) { - tag[0] = '0'; - tag[1] = '0' + index; + tag[0] = '0' + (index/10); + tag[1] = '0' + (index%10); Lose the (). if (type == AVMEDIA_TYPE_VIDEO) { tag[2] = 'd'; tag[3] = 'c'; @@ -158,6 +158,12 @@ int64_t list1, list2, strh, strf; AVMetadataTag *t = NULL; + /* check the total stream number */ Useless comment. + if (s-nb_streams AVI_MAX_STREAM_COUNT) { + av_log(s, AV_LOG_ERROR, Too many streams for avi format file. Please limit the number to be less than 100.\n); + return -1; + } Wrong message. -- Måns Rullgård m...@mansr.com ___ ffmpeg-devel mailing list ffmpeg-de...@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563
[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
longstone zhibing@hotmail.com added the comment: The patch has been adjusted as requested: 1. The comment and log info have been removed; 2. The max stream count has been defined as 100. FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563 [Issue_2563]_AdjustedPatch.patch Description: Binary data
[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
longstone zhibing@hotmail.com added the comment: Add the resolution patch. FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563 [Issue_2563]_Optional_resolution_patch.patch Description: Binary data
[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
Ronald S. Bultje rsbul...@gmail.com added the comment: can you add a check in write_header() to error out on 100 streams? Ronald FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563
[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
longstone zhibing@hotmail.com added the comment: Add error check in avi_write_header() function. FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563 [Issue_2563]_Resolution.patch Description: Binary data
[issue2563] AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag
New submission from longstone zhibing@hotmail.com: When I'm tring to mux an AVI file with multiple video and audio streams, the AVI encoder created a file with uncorrect fourcc tag when the total streams' count is more than 10. According to the AVI spec, each stream is assigned with one stream ID. If the new file contains 12 streams (6 video and 6 audio streams respectively), their stream ID and chunk tag should be: 0: '00dc' 1: '01dc' 2: '02dc' 3: '03dc' 4: '04dc' 5: '05dc' 6: '06wb' 7: '07wb' 8: '08wb' 9: '09wb' 10: '10wb' 11: '11wb' The truth is that the file created by the current version of avi encoder, has got an uncorrect chunk tag for streams with stream ID 10 and 11. The chunk tag are '0:wb' and '0;wb' respectively. This can be fixed by modifying the content of the following function: // Original source static char* avi_stream2fourcc(char* tag, int index, enum CodecType type) { tag[0] = '0'; tag[1] = '0' + index; if (type == CODEC_TYPE_VIDEO) { tag[2] = 'd'; tag[3] = 'c'; } else { tag[2] = 'w'; tag[3] = 'b'; } tag[4] = '\0'; return tag; } // Modified // However, this works when the total stream number = 99. // If the count is = 100, no answer then... static char* avi_stream2fourcc(char* tag, int index, enum CodecType type) { tag[0] = '0' + (index/10); tag[1] = '0' + (index%10); if (type == CODEC_TYPE_VIDEO) { tag[2] = 'd'; tag[3] = 'c'; } else { tag[2] = 'w'; tag[3] = 'b'; } tag[4] = '\0'; return tag; } -- messages: 13518 priority: normal status: new substatus: new title: AVI encoder create a file (contains multiple video and audio streams) with uncorrect fourcc tag type: bug FFmpeg issue tracker iss...@roundup.ffmpeg.org https://roundup.ffmpeg.org/issue2563