The efficient adaptation of scalable media resources is a major point of interest, due to today's tremendous heterogeneity in terms of end-user terminals, network technologies, and coding formats. In order to create a media resource adaptation engine supporting current and future coding formats, a generic (i.e., format-independent) solution is needed. One way to realize this goal is to rely on automatically created textual descriptions of the high-level syntax of binary media resources. MPEG-21 generic Bitstream Syntax Schema (gBS Schema) is a tool that is part of the MPEG-21 Multimedia Framework. It enables the use of generic Bitstream Syntax Descriptions (gBSDs), i.e., textual descriptions in XML, to steer the adaptation of a binary media resource, using format-independent adaptation logic. The major contribution of this paper is the introduction of gBFlavor. It is a novel solution for the automatic and format-agnostic generation of gBSDs. gBFlavor offers the possibility to automatically create a format-specific parser that is able to produce a gBSD, taking as input a particular media resource compliant to the coding format described by the parser. This paper provides an overview of the gBFlavor language, which allows describing the high-level structure of a coding format. The overall functioning of a gBFlavor-enabled adaptation framework is discussed as well. Performance results for two scalable coding formats, in particular H.264/AVC Scalable Video Coding and JPEG2000, show that our proposed solution outperforms existing techniques in terms of execution speed