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> ________________________________________________