[Ffmpeg-devel] Reading TAGS?

Måns Rullgård mans
Fri Mar 30 23:37:05 CEST 2007


Wildex999 <krstjern at animeamanga.com> writes:

> Hello, I'm trying to use the FFMPEG format reader for a poject I'm
> working on, and I need to get the 4 byte(32-bit) tag/fourcc for a
> video/audio codec after opening the stream, but it doesn't always
> return a video tag, and never a readable audio tag. Am I doing
> something wrong, or is there some functions I have to use?
>
> Heres part of my code:
> av_open_input_file(&pFormatCtx, argv[i+1], NULL, 0, NULL) //Open file
> av_find_stream_info(pFormatCtx) //Read stream info
> cout << (char)(pFormatCtx->streams[ii]->codec->codec_tag);
> cout << (char)(pFormatCtx->streams[ii]->codec->codec_tag>>8);
> cout << (char)(pFormatCtx->streams[ii]->codec->codec_tag>>16);
> cout << (char)(pFormatCtx->streams[ii]->codec->codec_tag>>24);
>
> */Not including error checking*/
>
> I do sometimes get the right tags(SNOW, XVID, WMV3 etc) for video, but
> the audio streams doesn't work, and some vidoe streams(MPEG being one)
> doesn't return a tag =/

Some things you are doing wrong:

- Asking ffmpeg-user questions on ffmpeg-devel.
- Assuming there will always be a codec_tag.
- Assuming the codec_tag will be meaningful at all.
- Using C++.
- Commenting the obvious.
- Using Bulgarian (or whatever the country is this year) variable names.

The above list is not intended to be complete.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list