pax_global_header00006660000000000000000000000064151322551420014512gustar00rootroot0000000000000052 comment=172394d5c5639b63133d9bce07f70f81898c683a bplaum-gmerlin-encoders-172394d/000077500000000000000000000000001513225514200165045ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/ABOUT-NLS000066400000000000000000002671331513225514200177470ustar00rootroot000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl' library and will decide to use it. If not, you may have to to use the `--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of June 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] | iso_639_3 | | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] | +--------------------------------------------------+ af am an ar as ast az be be@latin bg bn_IN bs ca 6 0 1 2 3 19 1 10 3 28 3 1 38 crh cs da de el en en_GB en_ZA eo es et eu fa +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] | aspell | [] [] [] [] [] | bash | [] [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] | bison | [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] [] [] | cflow | [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | | cppi | | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] | flex | [] [] | freedink | [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] | gjay | [] | gliv | [] [] [] | glunarclock | [] [] | gnubiff | () | gnucash | [] () () () () | gnuedu | [] [] | gnulib | [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] () [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] [] [] | help2man | [] | hylafax | [] [] | idutils | [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] [] [] [] () [] [] [] () | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] | iso_639 | [] [] [] [] () [] [] | iso_639_3 | [] | jwhois | [] | kbd | [] [] [] [] [] | keytouch | [] [] | keytouch-editor | [] [] | keytouch-keyboa... | [] | klavaro | [] [] [] [] | latrine | [] () | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] | linkdr | [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] | mkisofs | | myserver | | nano | [] [] [] | opcodes | [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] | psmisc | [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] | rosegarden | () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] | wyslij-po | | xchat | [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ crh cs da de el en en_GB en_ZA eo es et eu fa 5 64 105 117 18 1 8 0 28 89 18 19 0 fi fr ga gl gu he hi hr hu hy id is it ja ka kn +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] [] | aspell | [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | bibshelf | [] [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] | cppi | [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] | freedink | [] [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] [] | gjay | [] | gliv | [] () | glunarclock | [] [] [] [] | gnubiff | () [] () | gnucash | () () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | [] () [] [] [] [] | iso_639 | [] () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] [] | keytouch-editor | [] [] [] [] [] | keytouch-keyboa... | [] [] [] [] [] | klavaro | [] [] | latrine | [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] [] | linkdr | [] [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] [] | myserver | | nano | [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] [] | psmisc | [] [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | [] | wget | [] [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +----------------------------------------------------+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] [] | 12 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 14 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 29 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () [] () | 10 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 26 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] | 24 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 7 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 14 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] [] | 17 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If June 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. bplaum-gmerlin-encoders-172394d/AUTHORS000066400000000000000000000000541513225514200175530ustar00rootroot00000000000000Burkhard Plaum (plaum@ipf.uni-stuttgart.de) bplaum-gmerlin-encoders-172394d/COPYING000077700000000000000000000000001513225514200247502/usr/share/automake-1.16/COPYINGustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/ChangeLog000066400000000000000000000040071513225514200202570ustar00rootroot000000000000002014-06-17 gettextize * m4/gettext.m4: Upgrade to gettext-0.18.3. * m4/iconv.m4: Upgrade to gettext-0.18.3. * m4/lib-ld.m4: Upgrade to gettext-0.18.3. * m4/lib-link.m4: Upgrade to gettext-0.18.3. * m4/lib-prefix.m4: Upgrade to gettext-0.18.3. * m4/nls.m4: Upgrade to gettext-0.18.3. * m4/po.m4: Upgrade to gettext-0.18.3. * m4/progtest.m4: Upgrade to gettext-0.18.3. 2007-02-15 gettextize * m4/codeset.m4: New file, from gettext-0.15. * m4/gettext.m4: New file, from gettext-0.15. * m4/glibc2.m4: New file, from gettext-0.15. * m4/glibc21.m4: New file, from gettext-0.15. * m4/iconv.m4: New file, from gettext-0.15. * m4/intdiv0.m4: New file, from gettext-0.15. * m4/intmax.m4: New file, from gettext-0.15. * m4/inttypes_h.m4: New file, from gettext-0.15. * m4/inttypes-h.m4: New file, from gettext-0.15. * m4/inttypes-pri.m4: New file, from gettext-0.15. * m4/lcmessage.m4: New file, from gettext-0.15. * m4/lib-ld.m4: New file, from gettext-0.15. * m4/lib-link.m4: New file, from gettext-0.15. * m4/lib-prefix.m4: New file, from gettext-0.15. * m4/lock.m4: New file, from gettext-0.15. * m4/longdouble.m4: New file, from gettext-0.15. * m4/longlong.m4: New file, from gettext-0.15. * m4/nls.m4: New file, from gettext-0.15. * m4/po.m4: New file, from gettext-0.15. * m4/printf-posix.m4: New file, from gettext-0.15. * m4/progtest.m4: New file, from gettext-0.15. * m4/signed.m4: New file, from gettext-0.15. * m4/size_max.m4: New file, from gettext-0.15. * m4/stdint_h.m4: New file, from gettext-0.15. * m4/uintmax_t.m4: New file, from gettext-0.15. * m4/ulonglong.m4: New file, from gettext-0.15. * m4/visibility.m4: New file, from gettext-0.15. * m4/wchar_t.m4: New file, from gettext-0.15. * m4/wint_t.m4: New file, from gettext-0.15. * m4/xsize.m4: New file, from gettext-0.15. * m4/Makefile.am (EXTRA_DIST): Add the new files. * Makefile.am (SUBDIRS): Add po. (EXTRA_DIST): Add config.rpath. * configure.ac (AC_CONFIG_FILES): Add po/Makefile.in. bplaum-gmerlin-encoders-172394d/INSTALL000066400000000000000000000030431513225514200175350ustar00rootroot000000000000001. Requirements First of all: You need at least gmerlin, which can be downloaded from the gmerlin website. All other libraries are OPTIONAL, i.e. the configure script will search for them and use them, if they are found. The more libraries you have, the more files formats you can encode, e.g. if you really don't want to encode FLAC files, you can skip the installation of flac and everything will be fine for you. If you installed a library but it wasn't found by the configure script, the error is in 99% of the cases one of the following: - A binary package (e.g. rpm) was installed but not the development package (e.g. for libfoo-1.2.3-4.i386.rpm you also need libfoo-devel-1.2.3-4.i386.rpm) - The path where the libraries got installed (usually /usr/local/bin for source packages) is missing in the file /etc/ld.so.conf. This is the case e.g. on Fedora Core 3. Add the path there, run /sbin/ldconfig as root and everything should work. - After installation of the library, /sbin/ldconfig wasn't called - The package wasn't found, because the environment variable PKG_CONFIG_PATH is not properly set. Typing export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig before calling configure helps in most cases. If all these tips don't help, attach the file config.log to an email and send it to gmerlin-general@lists.sourceforge.net. 2. Compilation Nothing special here. It's the usual procedure: ./configure make su make install The configure script supports some command line options, type ./configure --help to see them. bplaum-gmerlin-encoders-172394d/Makefile.am000066400000000000000000000002051513225514200205350ustar00rootroot00000000000000# aclocal Path ACLOCAL_AMFLAGS = -I m4 SUBDIRS= po lib include plugins m4 utils EXTRA_DIST = config.rpath autogen.sh make_potfiles bplaum-gmerlin-encoders-172394d/NEWS000066400000000000000000000000001513225514200171710ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/README000066400000000000000000000005441513225514200173670ustar00rootroot00000000000000This package contains some encoder plugins for gmerlin. If you install it, gmerlin-transcoder will be able to encode more file formats. I utilizes mostly the existing encoder APIs for the supported formats. A small amount of common code is in the lib directory with the headers in include. Please consult the file INSTALL for installation instructions. bplaum-gmerlin-encoders-172394d/acinclude.m4000066400000000000000000000007771513225514200207100ustar00rootroot00000000000000dnl AC_TRY_CFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS]) dnl check if $CC supports a given set of cflags AC_DEFUN([AC_TRY_CFLAGS], [AC_MSG_CHECKING([if $CC supports $1 flags]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$1" AC_TRY_COMPILE([],[],[ac_cv_try_cflags_ok=yes],[ac_cv_try_cflags_ok=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT([$ac_cv_try_cflags_ok]) if test x"$ac_cv_try_cflags_ok" = x"yes"; then ifelse([$2],[],[:],[$2]) else ifelse([$3],[],[:],[$3]) fi]) bplaum-gmerlin-encoders-172394d/autogen.sh000077500000000000000000000021511513225514200205040ustar00rootroot00000000000000#!/bin/sh ./make_potfiles if test -d /usr/local/share/aclocal; then ACLOCAL_FLAGS="-I /usr/local/share/aclocal" else ACLOCAL_FLAGS="" fi LIBTOOLIZE=`which glibtoolize` if test "x$LIBTOOLIZE" = "x"; then LIBTOOLIZE=`which libtoolize` fi if test "x$LIBTOOLIZE" = "x"; then echo "No libtoolize command found" exit 1 fi echo -n "doing aclocal..." aclocal $ACLOCAL_FLAGS -I m4 if test $? != "0"; then echo "failed" exit 1 fi echo "done" echo -n "doing libtoolize..." $LIBTOOLIZE --automake --copy --force if test $? != "0"; then echo "failed" exit 1 fi echo "done" echo -n "doing autoheader..." autoheader if test $? != "0"; then echo "failed" exit 1 fi echo "done" echo -n "doing autoconf..." autoconf if test $? != "0"; then echo "failed" exit 1 fi echo "done" echo -n "doing automake..." automake -a if test $? != "0"; then echo -n "automake failed in first try (broken version). Trying once more..." $LIBTOOLIZE --automake --copy --force automake -a if test $? != "0"; then echo "failed" exit 1 else echo "Success :)" fi fi echo "done" echo "You can now run ./configure" bplaum-gmerlin-encoders-172394d/config.rpath000077500000000000000000000444351513225514200210260ustar00rootroot00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2013 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <= $GMERLIN_REQUIRED, , AC_MSG_ERROR("gmerlin not found")) gmerlin_plugindir='$(libdir)/gmerlin/plugins' dnl LDFLAGS for plugins GMERLIN_PLUGIN_LDFLAGS="-export-symbols "`pkg-config --variable=prefix gmerlin`"/share/gmerlin/plugin.sym $SAVE_LDFLAGS" AC_SUBST(GMERLIN_PLUGIN_LDFLAGS) AC_SUBST(gmerlin_plugindir) AC_SUBST(GMERLIN_REQUIRED) AM_GNU_GETTEXT([external]) dnl dnl Optional libraries dnl dnl dnl Ogg dnl GMERLIN_CHECK_OGG dnl dnl Vorbis dnl GMERLIN_CHECK_VORBIS dnl dnl Theora dnl GMERLIN_CHECK_THEORAENC dnl dnl OPUS dnl GMERLIN_CHECK_OPUS dnl dnl FLAC dnl GMERLIN_CHECK_FLAC dnl dnl lame dnl GMERLIN_CHECK_LAME dnl dnl libavcodec dnl GMERLIN_CHECK_AVCODEC dnl dnl libavformat dnl GMERLIN_CHECK_AVFORMAT dnl dnl Check if we have at least one video encoder dnl available dnl AM_CONDITIONAL(HAVE_OGG_VIDEO, test "x$have_theoraenc" = "xtrue") dnl dnl CFLAGS dnl LQT_OPT_CFLAGS(["-O3 -fomit-frame-pointer -ffast-math"]) CFLAGS="$CFLAGS -D_REENTRANT -D_FILE_OFFSET_BITS=64 $OPT_CFLAGS $GMERLIN_CFLAGS" LQT_TRY_CFLAGS(-Wall, CFLAGS="$CFLAGS -Wall") LQT_TRY_CFLAGS(-Wmissing-declarations, CFLAGS="$CFLAGS -Wmissing-declarations" ) LQT_TRY_CFLAGS(-Wdeclaration-after-statement, CFLAGS="$CFLAGS -Wdeclaration-after-statement") dnl dnl LIBS dnl LIBS="$GMERLIN_LIBS" if test "x$prefix" = xNONE; then prefix="${ac_default_prefix}" fi if test "x$exec_prefix" = xNONE; then exec_prefix="${prefix}" fi AC_CONFIG_FILES([Makefile \ po/Makefile.in \ include/Makefile \ lib/Makefile \ m4/Makefile \ utils/Makefile \ plugins/Makefile \ plugins/flac/Makefile \ plugins/ogg/Makefile \ plugins/lame/Makefile \ plugins/ffmpeg/Makefile \ ]) AC_OUTPUT echo "" echo "=== Libraries: =================================" echo -n "flac: " if test "x$have_flac" = "xtrue"; then echo "Found (CFLAGS=$FLAC_CFLAGS LIBS=$FLAC_LIBS)" else echo "Missing (Go to: http://flac.sourceforge.net/)" fi echo -n "ogg: " if test "x$have_ogg" = "xtrue"; then echo "Found (CFLAGS=$OGG_CFLAGS LIBS=$OGG_LIBS)" else echo "Missing (Go to: http://www.xiph.org/)" fi echo -n "vorbis: " if test "x$have_vorbis" = "xtrue"; then echo "Found (CFLAGS=$VORBIS_CFLAGS LIBS=$VORBIS_LIBS)" else echo "Missing (Go to: http://www.vorbis.com/)" fi echo -n "theoraenc: " if test "x$have_theoraenc" = "xtrue"; then echo "Found (CFLAGS=$THEORAENC_CFLAGS LIBS=$THEORAENC_LIBS)" else echo "Missing (Go to: http://www.theora.org/)" fi echo -n "opus: " if test "x$have_opus" = "xtrue"; then echo "Found (CFLAGS=$OPUS_CFLAGS LIBS=$OPUS_LIBS)" else echo "Missing (Go to: http://www.opus-codec.org/)" fi echo -n "lame: " if test "x$have_lame" = "xtrue"; then echo "Found (CFLAGS=$LAME_CFLAGS LIBS=$LAME_LIBS)" else echo "Missing (Go to: https://lame.sourceforge.io)" fi echo -n "ffmpeg: " if test "x$have_avformat" = "xtrue"; then echo "Found (CFLAGS=$AVFORMAT_CFLAGS LIBS=$AVFORMAT_LIBS)" else echo "Missing (Go to: http://ffmpeg.org/)" fi echo echo "If the configure script reaches this point, all missing packages are " echo "optional so compilation should succeed anyway." echo bplaum-gmerlin-encoders-172394d/cvs_clean.sh000077500000000000000000000011241513225514200207760ustar00rootroot00000000000000#!/bin/sh SUBDIRS="lib include plugins plugins/flac plugins/vorbis plugins/lame plugins/faac" make distclean CLEANFILES="Makefile.in *.o *.lo *.la .libs .deps" TOPCLEANFILES="aclocal.m4 config.guess config.status config.sub configure gmerlin.spec gmerlin.pc libtool ltmain.sh autom4te*.cache depcomp install-sh missing mkinstalldirs Makefile.in include/config.h.in COPYING" echo "Cleaning up..." for i in $TOPCLEANFILES; do echo "Removing $i" rm -rf $i done for i in $SUBDIRS; do for j in $CLEANFILES; do echo rm -rf $i/$j rm -rf $i/$j done done echo "You can now rerun autogen.sh" bplaum-gmerlin-encoders-172394d/include/000077500000000000000000000000001513225514200201275ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/include/Makefile.am000066400000000000000000000001101513225514200221530ustar00rootroot00000000000000noinst_HEADERS = gmerlin_encoders.h bgflac.h bgshout.h vorbiscomment.h bplaum-gmerlin-encoders-172394d/include/bgflac.h000066400000000000000000000043561513225514200215260ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ // #define MAKE_VERSION(maj,min,pat) ((maj<<16)|(min<<8)|pat) // #define BGAV_FLAC_VERSION_INT MAKE_VERSION(BGAV_FLAC_MAJOR,BGAV_FLAC_MINOR,BGAV_FLAC_PATCHLEVEL) #include /* Flac in Ogg */ #include #define BG_FLAC_HEADER_SIZE (4+38) typedef struct bg_flac_s bg_flac_t; bg_flac_t * bg_flac_create(void); const bg_parameter_info_t * bg_flac_get_parameters(void); void bg_flac_set_parameter(void * data, const char * name, const gavl_value_t * val); gavl_packet_sink_t * bg_flac_start_compressed(bg_flac_t * flac, gavl_dictionary_t * stream); gavl_audio_sink_t * bg_flac_start_uncompressed(bg_flac_t * flac, gavl_dictionary_t * stream); #if 0 int bg_flac_start(bg_flac_t * flac, gavl_audio_format_t * fmt, gavl_compression_info_t * ci, gavl_dictionary_t * stream_metadata); #endif // gavl_audio_sink_t * bg_flac_get_audio_sink(bg_flac_t * flac); // gavl_packet_sink_t * bg_flac_get_packet_sink(bg_flac_t * flac); // int bg_flac_encode_audio_frame(bg_flac_t * flac, gavl_audio_frame_t * frame); void bg_flac_free(bg_flac_t * flac); void bg_flac_set_callbacks(bg_flac_t * flac, int (*streaminfo_callback)(void*, uint8_t *, int), void * priv); void bg_flac_set_sink(bg_flac_t * flac, gavl_packet_sink_t * psink); bplaum-gmerlin-encoders-172394d/include/bgshout.h000066400000000000000000000030251513225514200217530ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include typedef struct bg_shout_s bg_shout_t; bg_shout_t * bg_shout_create(int format); const bg_parameter_info_t * bg_shout_get_parameters(void); void bg_shout_set_parameter(void * data, const char * name, const gavl_value_t * val); void bg_shout_set_metadata(bg_shout_t * s, const gavl_dictionary_t * m); int bg_shout_open(bg_shout_t *); void bg_shout_update_metadata(bg_shout_t *, const gavl_dictionary_t * m); void bg_shout_destroy(bg_shout_t *); int bg_shout_write(bg_shout_t *, const uint8_t * data, int len); /* Also closes */ void bg_shout_destroy(bg_shout_t *); bplaum-gmerlin-encoders-172394d/include/config.h.in~000066400000000000000000000061221513225514200223510ustar00rootroot00000000000000/* include/config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Do we have libavcodec installed? */ #undef HAVE_AVCODEC /* Do we have libavformat installed? */ #undef HAVE_AVFORMAT /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Enable faac */ #undef HAVE_FAAC /* Enable FLAC */ #undef HAVE_FLAC /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Do we have lame installed? */ #undef HAVE_LAME /* Ogg libraries are there */ #undef HAVE_OGG /* Do we have libopus installed? */ #undef HAVE_OPUS /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Do we have theora encoder installed? */ #undef HAVE_THEORAENC /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Vorbis libraries are there */ #undef HAVE_VORBIS /* Define to 1 if you have the `vorbis_synthesis_restart' function. */ #undef HAVE_VORBIS_SYNTHESIS_RESTART /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif bplaum-gmerlin-encoders-172394d/include/gmerlin_encoders.h000066400000000000000000000024511513225514200236210ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include /* ID3 V1.1 and V2.4 support */ typedef struct bgen_id3v1_s bgen_id3v1_t; bgen_id3v1_t * bgen_id3v1_create(const gavl_dictionary_t*); #define ID3_ENCODING_LATIN1 0x00 #define ID3_ENCODING_UTF8 0x03 int bgen_id3v1_write(gavl_io_t * output, const bgen_id3v1_t *); void bgen_id3v1_destroy(bgen_id3v1_t *); bplaum-gmerlin-encoders-172394d/include/vorbiscomment.h000066400000000000000000000021771513225514200231760ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ int bg_vorbis_comment_write(gavl_io_t * output, const gavl_dictionary_t * m_stream, const gavl_dictionary_t * m_global, int framing); bplaum-gmerlin-encoders-172394d/lib/000077500000000000000000000000001513225514200172525ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/lib/Makefile.am000066400000000000000000000005331513225514200213070ustar00rootroot00000000000000AM_CPPFLAGS = -I$(top_srcdir)/include if HAVE_FLAC flac_libs = libbgflac.la else flac_libs = endif AM_CFLAGS = -DLOCALE_DIR=\"$(localedir)\" @FLAC_CFLAGS@ noinst_LTLIBRARIES = libgmerlin_encoders.la $(flac_libs) libgmerlin_encoders_la_SOURCES = \ id3v1.c \ vorbiscomment.c libbgflac_la_CFLAGS = @FLAC_CFLAGS@ libbgflac_la_SOURCES = bgflac.c bplaum-gmerlin-encoders-172394d/lib/bgflac.c000066400000000000000000000366531513225514200206510ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include #define LOG_DOMAIN "flacenc" struct bg_flac_s { int clevel; /* Compression level 0..8 */ int bits_per_sample; int shift_bits; int divisor; // int samples_per_block; int fixed_blocksize; void (*copy_frame)(int32_t * dst[], gavl_audio_frame_t * src, int num_channels); /* Buffer */ int32_t * buffer[GAVL_MAX_CHANNELS]; int buffer_alloc; /* In samples */ gavl_audio_format_t *format; // FLAC__StreamMetadata * vorbis_comment; FLAC__StreamEncoder * enc; /* Needs to be set by the client */ gavl_packet_sink_t * psink_out; int (*streaminfo_callback)(void * data, uint8_t * si, int len); void * callback_priv; int64_t pts; gavl_compression_info_t ci; FLAC__StreamMetadata_StreamInfo si; }; /* Copy functions */ static void copy_frame_8(int32_t * dst[], gavl_audio_frame_t * src, int num_channels) { int i, j; for(i = 0; i < num_channels; i++) { for(j = 0; j < src->valid_samples; j++) { dst[i][j] = src->channels.s_8[i][j]; } } } static void copy_frame_16(int32_t * dst[], gavl_audio_frame_t * src, int num_channels) { int i, j; for(i = 0; i < num_channels; i++) { for(j = 0; j < src->valid_samples; j++) { dst[i][j] = src->channels.s_16[i][j]; } } } static void copy_frame_32(int32_t * dst[], gavl_audio_frame_t * src, int num_channels) { int i; for(i = 0; i < num_channels; i++) { memcpy(dst[i], src->channels.s_32[i], src->valid_samples * sizeof(dst[0][0])); } } static void do_shift(int32_t * dst[], int num_channels, int num_samples, int divisor) { int i, j; for(i = 0; i < num_channels; i++) { for(j = 0; j < num_samples; j++) { dst[i][j] /= divisor; } } } static const bg_parameter_info_t audio_parameters[] = { { .name = "bits", .long_name = TRS("Bits"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("16"), .multi_names = (char const *[]){ "8", "12", "16", "20", "24", NULL }, }, { .name = "compression_level", .long_name = TRS("Compression Level"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(8), .val_default = GAVL_VALUE_INIT_INT(8), .help_string = TRS("0: Fastest encoding, biggest files\n\ 8: Slowest encoding, smallest files") }, { /* End of parameters */ } }; const bg_parameter_info_t * bg_flac_get_parameters() { return audio_parameters; } void bg_flac_set_parameter(void * data, const char * name, const gavl_value_t * val) { bg_flac_t * flac; flac = data; if(!name) { return; } else if(!strcmp(name, "compression_level")) { flac->clevel = val->v.i; } else if(!strcmp(name, "bits")) { flac->bits_per_sample = atoi(val->v.str); } // fprintf(stderr, "set_audio_parameter_flac %s\n", name); } static void metadata_callback(const FLAC__StreamEncoder *enc, const FLAC__StreamMetadata *m, void *client_data) { bg_flac_t * flac = client_data; if((m->type == FLAC__METADATA_TYPE_STREAMINFO) && flac->streaminfo_callback) { const FLAC__StreamMetadata_StreamInfo * si; uint8_t * ptr; uint32_t i; /* Re-write stream info */ si = &m->data.stream_info; ptr = flac->ci.codec_header.buf + 8; // Signature + metadata header GAVL_16BE_2_PTR(si->min_blocksize, ptr); ptr += 2; GAVL_16BE_2_PTR(si->max_blocksize, ptr); ptr += 2; GAVL_24BE_2_PTR(si->min_framesize, ptr); ptr += 3; GAVL_24BE_2_PTR(si->max_framesize, ptr); ptr += 3; i = si->sample_rate >> 4; GAVL_16BE_2_PTR(i, ptr); ptr += 2; i = si->sample_rate & 0x0f; // Samplerate (lower 4 bits) i <<= 3; // Channels i |= (si->channels-1) & 0x7; i <<= 5; // Bits i |= (si->bits_per_sample-1) & 0x1f; i <<= 4; // Total samples i |= (si->total_samples >> 32) & 0xf; GAVL_16BE_2_PTR(i, ptr); ptr += 2; i = (si->total_samples) & 0xffffffff; GAVL_32BE_2_PTR(i, ptr); ptr += 4; memcpy(ptr, si->md5sum, 16); ptr += 16; flac->streaminfo_callback(flac->callback_priv, flac->ci.codec_header.buf, flac->ci.codec_header.len); } } static FLAC__StreamEncoderWriteStatus write_callback(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *data) { bg_flac_t * flac = data; if(flac->ci.codec_header.len < BG_FLAC_HEADER_SIZE) { // fprintf(stderr, "write callback: %d %ld\n", flac->ci.global_header_len, // bytes); gavl_buffer_append_data(&flac->ci.codec_header, buffer, bytes); if(flac->ci.codec_header.len == BG_FLAC_HEADER_SIZE) { /* * Last metadata packet. By default libflac will emit a vorbis_comment * with just the vendor_string after that. */ flac->ci.codec_header.buf[4] |= 0x80; /* Extract codec header */ if(flac->streaminfo_callback) flac->streaminfo_callback(flac->callback_priv, flac->ci.codec_header.buf, flac->ci.codec_header.len); } } /* Compressed packet */ if(samples) { gavl_packet_t gp; gavl_packet_init(&gp); gp.buf.len = bytes; gp.buf.buf = (uint8_t*)buffer; gp.duration = samples; gp.pts = flac->pts; flac->pts += samples; if(gavl_packet_sink_put_packet(flac->psink_out, &gp) != GAVL_SINK_OK) return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; else return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; } return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; } void bg_flac_set_callbacks(bg_flac_t * flac, int (*streaminfo_callback)(void*, uint8_t *, int), void * priv) { flac->streaminfo_callback = streaminfo_callback; flac->callback_priv = priv; } static gavl_sink_status_t write_audio_packet_func_flac(void * priv, gavl_packet_t * packet) { bg_flac_t * flac = priv; // fprintf(stderr, "%ld %ld\n", packet->duration, flac->samples_written); if(packet->buf.len < 6) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Packet data too small: %d", packet->buf.len); return GAVL_SINK_ERROR; } if(!flac->si.total_samples) { flac->fixed_blocksize = !(packet->buf.buf[1] & 0x01); // bit 15 flac->si.min_blocksize = packet->duration; flac->si.max_blocksize = packet->duration; } else if(!flac->fixed_blocksize) { if(packet->duration < flac->si.min_blocksize) flac->si.min_blocksize = packet->duration; if(packet->duration > flac->si.max_blocksize) flac->si.max_blocksize = packet->duration; } if(!flac->si.min_framesize || (packet->buf.len < flac->si.min_framesize)) flac->si.min_framesize = packet->buf.len; if(packet->buf.len > flac->si.max_framesize) flac->si.max_framesize = packet->buf.len; flac->si.total_samples += packet->duration; return gavl_packet_sink_put_packet(flac->psink_out, packet); } gavl_packet_sink_t * bg_flac_start_compressed(bg_flac_t * flac, gavl_dictionary_t * stream) { uint16_t i_tmp; uint8_t * ptr; /* gavl_audio_format_t * fmt, gavl_compression_info_t * ci, gavl_dictionary_t * stream_metadata */ flac->format = gavl_stream_get_audio_format_nc(stream); gavl_stream_get_compression_info(stream, &flac->ci); ptr = flac->ci.codec_header.buf + 8 // Signature + metadata header + 10 // min/max frame/blocksize + 2; // upper 16 bit of 20 samplerate bits // |4|3|5|4| i_tmp = ptr[0]; i_tmp <<= 8; i_tmp |= ptr[1]; flac->si.sample_rate = flac->format->samplerate; flac->si.channels = flac->format->num_channels; flac->si.bits_per_sample = ((i_tmp >> 4) & 0x1f)+1; flac->si.total_samples = 0; memcpy(flac->si.md5sum, flac->ci.codec_header.buf + 42 - 16, 16); if(flac->streaminfo_callback) flac->streaminfo_callback(flac->callback_priv, flac->ci.codec_header.buf, flac->ci.codec_header.len); return gavl_packet_sink_create(NULL, write_audio_packet_func_flac, flac);; } static gavl_sink_status_t encode_audio_func(void * priv, gavl_audio_frame_t * frame) { int i; bg_flac_t * flac = priv; /* Reallocate sample buffer */ if(flac->buffer_alloc < frame->valid_samples) { flac->buffer_alloc = frame->valid_samples + 10; for(i = 0; i < flac->format->num_channels; i++) flac->buffer[i] = realloc(flac->buffer[i], flac->buffer_alloc * sizeof(flac->buffer[0][0])); } /* Copy and shift */ flac->copy_frame(flac->buffer, frame, flac->format->num_channels); if(flac->shift_bits) do_shift(flac->buffer, flac->format->num_channels, frame->valid_samples, flac->divisor); if(!FLAC__stream_encoder_process(flac->enc, (const FLAC__int32 **) flac->buffer, frame->valid_samples)) return 0; return 1; } gavl_audio_sink_t * bg_flac_start_uncompressed(bg_flac_t * flac, gavl_dictionary_t * stream) { flac->format = gavl_stream_get_audio_format_nc(stream); /* Common initialization */ flac->format->interleave_mode = GAVL_INTERLEAVE_NONE; /* Samplerates which are no multiples of 10 are invalid */ flac->format->samplerate = ((flac->format->samplerate + 9) / 10) * 10; /* Bits per sample */ /* bits_per_sample is zero when writing compressed packets */ if(!flac->bits_per_sample) flac->bits_per_sample = 16; if(flac->bits_per_sample <= 8) { flac->copy_frame = copy_frame_8; flac->shift_bits = 8 - flac->bits_per_sample; flac->format->sample_format = GAVL_SAMPLE_S8; } else if(flac->bits_per_sample <= 16) { flac->copy_frame = copy_frame_16; flac->shift_bits = 16 - flac->bits_per_sample; flac->format->sample_format = GAVL_SAMPLE_S16; } else if(flac->bits_per_sample <= 32) { flac->copy_frame = copy_frame_32; flac->shift_bits = 32 - flac->bits_per_sample; flac->format->sample_format = GAVL_SAMPLE_S32; } flac->divisor = (1 << flac->shift_bits); /* Set compression parameters from presets */ FLAC__stream_encoder_set_sample_rate(flac->enc, flac->format->samplerate); FLAC__stream_encoder_set_channels(flac->enc, flac->format->num_channels); /* */ FLAC__stream_encoder_set_compression_level(flac->enc, flac->clevel); FLAC__stream_encoder_set_bits_per_sample(flac->enc, flac->bits_per_sample); /* Initialize */ /* Set vendor string: Must be done early because it's needed in the streaminfo callback */ gavl_dictionary_set_string(gavl_stream_get_metadata_nc(stream), GAVL_META_SOFTWARE, FLAC__VENDOR_STRING); flac->ci.id = GAVL_CODEC_ID_FLAC; if(FLAC__stream_encoder_init_stream(flac->enc, write_callback, NULL, NULL, metadata_callback, flac) != FLAC__STREAM_ENCODER_INIT_STATUS_OK) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "FLAC__stream_encoder_init_stream failed"); return NULL; } // flac->samples_per_block = // FLAC__stream_encoder_get_blocksize(flac->enc); gavl_stream_set_compression_info(stream, &flac->ci); return gavl_audio_sink_create(NULL, encode_audio_func, flac, flac->format); } void bg_flac_free(bg_flac_t * flac) { int i; FLAC__stream_encoder_finish(flac->enc); FLAC__stream_encoder_delete(flac->enc); if(flac->buffer[0]) { for(i = 0; i < flac->format->num_channels; i++) { free(flac->buffer[i]); flac->buffer[i] = NULL; } } gavl_compression_info_free(&flac->ci); free(flac); } /* Metadata -> vorbis comment */ #define STR_COMMENT(gavl_name, key) \ if((val = gavl_dictionary_get_string(m, gavl_name))) \ { \ memset(&entry, 0, sizeof(entry)); \ entry.entry = (uint8_t*)gavl_sprintf("%s=%s", key, val); \ entry.length = strlen((char*)entry.entry); \ FLAC__metadata_object_vorbiscomment_insert_comment(flac->vorbis_comment, \ num_comments++, \ entry, \ 1); \ free(entry.entry); \ } #define INT_COMMENT(num, key) \ {\ memset(&entry, 0, sizeof(entry)); \ entry.entry = (uint8_t*)gavl_sprintf("%s=%d", key, num); \ entry.length = strlen((char*)entry.entry); \ FLAC__metadata_object_vorbiscomment_insert_comment(flac->vorbis_comment, \ num_comments++, \ entry, \ 1); \ free(entry.entry); \ } #define RAW_COMMENT(str) \ if(m->str) \ { \ memset(&entry, 0, sizeof(entry)); \ entry.entry = (uint8_t*)gavl_sprintf("%s", m->str); \ entry.length = strlen((char*)(entry.entry)); \ FLAC__metadata_object_vorbiscomment_insert_comment(flac->vorbis_comment, \ num_comments++, \ entry, \ 1); \ free(entry.entry); \ } bg_flac_t * bg_flac_create() { bg_flac_t * flac = calloc(1, sizeof(*flac)); flac->enc = FLAC__stream_encoder_new(); flac->ci.id = GAVL_CODEC_ID_FLAC; gavl_buffer_alloc(&flac->ci.codec_header, BG_FLAC_HEADER_SIZE); return flac; } void bg_flac_set_sink(bg_flac_t * flac, gavl_packet_sink_t * psink) { flac->psink_out = psink; } bplaum-gmerlin-encoders-172394d/lib/bgshout.c000066400000000000000000000151041513225514200210720ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #define LOG_DOMAIN "shout" #include #include struct bg_shout_s { shout_t * s; shout_metadata_t * met; int metadata_sent; int64_t bytes_sent; int format; bg_charset_converter_t * cnv; }; bg_shout_t * bg_shout_create(int format) { bg_shout_t * ret; ret = calloc(1, sizeof(*ret)); shout_init(); ret->s = shout_new(); ret->format = format; if(ret->format != SHOUT_FORMAT_OGG) ret->cnv = bg_charset_converter_create("UTF-8", "ISO-8859-1"); shout_set_format(ret->s, format); return ret; } static const bg_parameter_info_t parameters[] = { { .name = "server", .long_name = TRS("Server"), .type = BG_PARAMETER_STRING, .val_default = GAVL_VALUE_INIT_STRING("localhost"), }, { .name = "port", .long_name = TRS("Port"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(1), .val_max = GAVL_VALUE_INIT_INT(65535), .val_default = GAVL_VALUE_INIT_INT(8000), }, { .name = "mount", .long_name = TRS("Mount"), .type = BG_PARAMETER_STRING, .val_default = GAVL_VALUE_INIT_STRING("/stream.ogg"), }, { .name = "user", .long_name = TRS("User"), .type = BG_PARAMETER_STRING, .val_default = GAVL_VALUE_INIT_STRING("source"), }, { .name = "password", .long_name = TRS("Password"), .type = BG_PARAMETER_STRING_HIDDEN, }, { .name = "name", .long_name = TRS("Name"), .type = BG_PARAMETER_STRING, .val_default = GAVL_VALUE_INIT_STRING("Test stream"), }, { .name = "description", .long_name = TRS("Description"), .type = BG_PARAMETER_STRING, .val_default = GAVL_VALUE_INIT_STRING("Brought to you by gmerlin"), }, { .name = "genre", .long_name = TRS("Genre"), .type = BG_PARAMETER_STRING, }, { /* */ }, }; const bg_parameter_info_t * bg_shout_get_parameters(void) { return parameters; } void bg_shout_set_parameter(void * data, const char * name, const gavl_value_t * val) { bg_shout_t * s = data; if(!name) return; if(!strcmp(name, "server")) { shout_set_host(s->s, val->v.str); } else if(!strcmp(name, "port")) { shout_set_port(s->s, val->v.i); } else if(!strcmp(name, "mount")) { shout_set_mount(s->s, val->v.str); } else if(!strcmp(name, "user")) { if(val->v.str) shout_set_user(s->s, val->v.str); } else if(!strcmp(name, "password")) { if(val->v.str) shout_set_password(s->s, val->v.str); } else if(!strcmp(name, "name")) { if(val->v.str) shout_set_name(s->s, val->v.str); } else if(!strcmp(name, "description")) { if(val->v.str) shout_set_description(s->s, val->v.str); } else if(!strcmp(name, "genre")) { if(val->v.str) shout_set_genre(s->s, val->v.str); } } int bg_shout_open(bg_shout_t * s) { if(shout_open(s->s)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Connecting failed: %s", shout_get_error(s->s)); return 0; } gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Connected to icecast server"); return 1; } void bg_shout_set_metadata(bg_shout_t * s, const gavl_dictionary_t * m) { const char * genre; if((genre = gavl_dictionary_get_string(m, GAVL_META_GENRE))) shout_set_genre(s->s, genre); } void bg_shout_destroy(bg_shout_t * s) { if(shout_get_connected(s->s) == SHOUTERR_CONNECTED) shout_close(s->s); shout_free(s->s); if(s->cnv) bg_charset_converter_destroy(s->cnv); free(s); } static void flush_metadata(bg_shout_t * s) { if(shout_set_metadata(s->s, s->met) != SHOUTERR_SUCCESS) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Sending metadata failed: %s", shout_get_error(s->s)); } shout_metadata_free(s->met); s->met = NULL; } int bg_shout_write(bg_shout_t * s, const uint8_t * data, int len) { shout_sync(s->s); if(shout_send(s->s, data, len) != SHOUTERR_SUCCESS) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Sending data failed: %s", shout_get_error(s->s)); return 0; } s->bytes_sent += len; // if(s->met && (s->bytes_sent > 32000)) // flush_metadata(s); return len; } static void metadata_add(bg_shout_t * s, const char * name, const char * val) { if(!s->cnv) shout_metadata_add(s->met, name, val); else { char * tmp_string = bg_convert_string(s->cnv, val, -1, NULL); shout_metadata_add(s->met, name, tmp_string); free(tmp_string); } } void bg_shout_update_metadata(bg_shout_t * s, const gavl_dictionary_t * m) { const char * artist = NULL; const char * title = NULL; const char * label = NULL; if(s->met) shout_metadata_free(s->met); s->met = shout_metadata_new(); if(m) { artist = gavl_dictionary_get_string(m, GAVL_META_ARTIST); title = gavl_dictionary_get_string(m, GAVL_META_TITLE); label = gavl_dictionary_get_string(m, GAVL_META_LABEL); } if(artist && title) { metadata_add(s, "artist", artist); metadata_add(s, "title", title); } else if(label) { metadata_add(s, "song", label); } else /* Clear everything */ { metadata_add(s, "song", shout_get_name(s->s)); } flush_metadata(s); } bplaum-gmerlin-encoders-172394d/lib/id3v1.c000066400000000000000000000130651513225514200203510ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #define GENRE_MAX 0x94 static const char *id3_genres[GENRE_MAX] = { "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient", "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", "Alt", "Bass", "Soul", "Punk", "Space", "Meditative", "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta Rap", "Top 40", "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave", "Psychedelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde", "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A Cappella", "Euro-House", "Dance Hall", "Goa", "Drum & Bass", "Club-House", "Hardcore", "Terror", "Indie", "BritPop", "Negerpunk", "Polsk Punk", "Beat", "Christian Gangsta Rap", "Heavy Metal", "Black Metal", "Crossover", "Contemporary Christian", "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop", "Synthpop" }; #define TITLE_POS 3 #define TITLE_LEN 30 #define ARTIST_POS 33 #define ARTIST_LEN 30 #define ALBUM_POS 63 #define ALBUM_LEN 30 #define YEAR_POS 93 #define YEAR_LEN 4 #define COMMENT_POS 97 #define COMMENT_LEN 28 #define TRACK_POS 126 #define GENRE_POS 127 struct bgen_id3v1_s { char data[128]; }; static void set_string(char * dst, const gavl_dictionary_t * m, const char * key, int max_len, gavl_charset_converter_t * cnv) { int out_len; char * tmp_string; const char * src = gavl_dictionary_get_string(m, key); if(!src) return; tmp_string = gavl_convert_string(cnv, src, -1, &out_len); if(!tmp_string) /* String could not be converted */ return; if(out_len > max_len) out_len = max_len; memcpy(dst, tmp_string, out_len); free(tmp_string); } bgen_id3v1_t * bgen_id3v1_create(const gavl_dictionary_t * m) { int track; int i; char * tmp_string; int year; gavl_charset_converter_t * cnv; bgen_id3v1_t * ret; const char * genre; ret = calloc(1, sizeof(*ret)); ret->data[0] = 'T'; ret->data[1] = 'A'; ret->data[2] = 'G'; cnv = gavl_charset_converter_create("UTF-8", "ISO-8859-1"); set_string(&ret->data[TITLE_POS], m, GAVL_META_TITLE, TITLE_LEN, cnv); set_string(&ret->data[ARTIST_POS], m, GAVL_META_ARTIST, ARTIST_LEN, cnv); set_string(&ret->data[ALBUM_POS], m, GAVL_META_ALBUM, ALBUM_LEN, cnv); /* Year */ year = bg_metadata_get_year(m); if(year) { tmp_string = gavl_sprintf("%d", year); if(strlen(tmp_string) == 4) { memcpy(&ret->data[YEAR_POS], tmp_string, 4); } free(tmp_string); } /* Comment */ set_string(&ret->data[COMMENT_POS], m, GAVL_META_COMMENT, COMMENT_LEN, cnv); /* Track */ if(gavl_dictionary_get_int(m, GAVL_META_TRACKNUMBER, &track) && (track > 0) && (track < 255)) ret->data[TRACK_POS] = track; /* Genre */ ret->data[GENRE_POS] = 0xff; genre = gavl_dictionary_get_string(m, GAVL_META_GENRE); if(genre) { for(i = 0; i < GENRE_MAX; i++) { if(!strcasecmp(genre, id3_genres[i])) { ret->data[GENRE_POS] = i; break; } } } gavl_charset_converter_destroy(cnv); return ret; } int bgen_id3v1_write(gavl_io_t * output, const bgen_id3v1_t * tag) { if(gavl_io_write_data(output, (uint8_t*)tag->data, 128) < 128) return 0; return 1; } void bgen_id3v1_destroy(bgen_id3v1_t * tag) { free(tag); } bplaum-gmerlin-encoders-172394d/lib/vorbiscomment.c000066400000000000000000000126331513225514200223120ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include #define LOG_DOMAIN "vorbiscomment" #include static const struct { const char * gavl_name; const char * vorbis_name; gavl_type_t type; } tags[] = { { GAVL_META_ARTIST, "ARTIST", GAVL_TYPE_STRING }, { GAVL_META_TITLE, "TITLE", GAVL_TYPE_STRING }, { GAVL_META_ALBUM, "ALBUM", GAVL_TYPE_STRING }, { GAVL_META_ALBUMARTIST, "ALBUM ARTIST", GAVL_TYPE_STRING }, { GAVL_META_ALBUMARTIST, "ALBUMARTIST", GAVL_TYPE_STRING }, { GAVL_META_GENRE, "GENRE", GAVL_TYPE_STRING }, { GAVL_META_COPYRIGHT, "COPYRIGHT", GAVL_TYPE_STRING }, { GAVL_META_TRACKNUMBER, "TRACKNUMBER", GAVL_TYPE_INT }, { GAVL_META_COMMENT, "COMMENT", GAVL_TYPE_STRING }, { /* End */ } }; static const char * get_vendor(const gavl_dictionary_t * m) { const char * ret = gavl_dictionary_get_string(m, GAVL_META_SOFTWARE); if(!ret) ret = PACKAGE"-"VERSION; return ret; } int bg_vorbis_comment_write(gavl_io_t * output, const gavl_dictionary_t * m_stream, const gavl_dictionary_t * m_global, int framing) { int len1; int len2; int len_total; int num_tags = 0; int64_t num_tags_pos; int64_t old_pos; int64_t start_pos; int i = 0; int year; const char * str; /* Vendor string */ start_pos = gavl_io_position(output); str = get_vendor(m_stream); if(!str) { /* Vendor string missing */ return 0; } len1 = strlen(str); gavl_io_write_32_le(output, len1); gavl_io_write_data(output, (uint8_t*)str, len1); num_tags_pos = gavl_io_position(output); gavl_io_write_32_le(output, 0); // Filled in later while(tags[i].gavl_name) { switch(tags[i].type) { case GAVL_TYPE_STRING: { int j = 0; while((str = gavl_dictionary_get_string_array(m_global, tags[i].gavl_name, j))) { len1 = strlen(tags[i].vorbis_name); len2 = strlen(str); len_total = len1 + 1 + len2; gavl_io_write_32_le(output, len_total); gavl_io_write_data(output, (uint8_t*)tags[i].vorbis_name, len1); gavl_io_write_data(output, (uint8_t*)"=", 1); gavl_io_write_data(output, (uint8_t*)str, len2); num_tags++; j++; } } break; case GAVL_TYPE_INT: { int val_i; if(gavl_dictionary_get_int(m_global, tags[i].gavl_name, &val_i)) { char * tmp_string = gavl_sprintf("%d", val_i); len1 = strlen(tags[i].vorbis_name); len2 = strlen(tmp_string); len_total = len1 + 1 + len2; gavl_io_write_32_le(output, len_total); gavl_io_write_data(output, (uint8_t*)tags[i].vorbis_name, len1); gavl_io_write_data(output, (uint8_t*)"=", 1); gavl_io_write_data(output, (uint8_t*)tmp_string, len2); free(tmp_string); num_tags++; } } break; default: break; } i++; } /* Date needs special attention */ if((str = gavl_dictionary_get_string(m_global, GAVL_META_DATE)) && !gavl_string_ends_with(str, "99-99")) { len1 = 5; // DATE= len2 = strlen(str); len_total = len1 + len2; gavl_io_write_32_le(output, len_total); gavl_io_write_data(output, (uint8_t*)"DATE=", 5); gavl_io_write_data(output, (uint8_t*)str, len2); num_tags++; } else if((year = gavl_dictionary_get_year(m_global, GAVL_META_YEAR)) || (year = gavl_dictionary_get_year(m_global, GAVL_META_DATE))) { char * tmp_string; len1 = 5; // DATE= tmp_string = gavl_sprintf("%d", year); len2 = strlen(tmp_string); len_total = len1 + len2; gavl_io_write_32_le(output, len_total); gavl_io_write_data(output, (uint8_t*)"DATE=", 5); gavl_io_write_data(output, (uint8_t*)tmp_string, len2); free(tmp_string); num_tags++; } old_pos = gavl_io_position(output); gavl_io_seek(output, num_tags_pos, SEEK_SET); gavl_io_write_32_le(output, num_tags); // Filled in later gavl_io_seek(output, old_pos, SEEK_SET); if(framing) gavl_io_write_8(output, 0x01); return gavl_io_position(output) - start_pos; } bplaum-gmerlin-encoders-172394d/m4/000077500000000000000000000000001513225514200170245ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/m4/Makefile.am000066400000000000000000000006351513225514200210640ustar00rootroot00000000000000EXTRA_DIST= codeset.m4 gettext.m4 glibc2.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes_h.m4 inttypes-h.m4 inttypes-pri.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 lock.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 visibility.m4 wchar_t.m4 wint_t.m4 xsize.m4 lqt_opt_cflags.m4 check_funcs.m4 avcodec.m4 avformat.m4 bplaum-gmerlin-encoders-172394d/m4/avcodec.m4000066400000000000000000000071031513225514200206730ustar00rootroot00000000000000# Configure paths for libavcodec # Burkhard Plaum, 2004-08-12 dnl Compile an avcodec test program and figure out the version AC_DEFUN([ACL_CHECK_AVCODEC],[ AC_MSG_CHECKING([for build ID in libavcodec, libs: $AVCODEC_LIBS]) CFLAGS_save=$CFLAGS LIBS_save=$LIBS CFLAGS="$GMERLIN_DEP_CFLAGS $CFLAGS $AVCODEC_CFLAGS" LIBS="$GMERLIN_DEP_LIBS $AVCODEC_LIBS" AVCODEC_HEADER="" dnl Look for header found_header="false" AC_TRY_COMPILE([ #include ],[], [found_header="true";AVCODEC_HEADER="";VAAPI_HEADER="" ],) if test $found_header = "false"; then AC_TRY_COMPILE([ #include ],[],[found_header="true";AVCODEC_HEADER="";VAAPI_HEADER=""]) fi if test $found_header = "false"; then AC_TRY_COMPILE([ #include ],[], [found_header="true";AVCODEC_HEADER="";VAAPI_HEADER="" ],) fi AC_CHECK_HEADERS([libavcore/avcore.h]) avcodec_ok="false" AC_TRY_RUN([ #include #include $AVCODEC_HEADER int main() { FILE * output; if(LIBAVCODEC_BUILD < $1) return -1; output=fopen("avcodec_version", "w"); fprintf(output, AV_TOSTRING(LIBAVCODEC_VERSION)); fclose(output); return 0; } ], [ # program could be run if test "x$AVCODEC_VERSION" = "x"; then AVCODEC_VERSION=`cat avcodec_version` fi rm -f avcodec_version avcodec_ok="true" AC_MSG_RESULT(ok) ], [ # program could not be run AC_MSG_RESULT(failed) ]) have_avcodec_img_convert="false" if test "x$avcodec_ok" = "xtrue"; then avcodec_swscale_missing="false" AC_MSG_CHECKING(for img_convert) AC_TRY_LINK([#include ], [img_convert(NULL, 0, NULL, 0, 0, 0); return 0;], have_avcodec_img_convert=true AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) if test "x$have_avcodec_img_convert" != "xtrue"; then if test "x$have_libswscale" != xtrue; then avcodec_swscale_missing="true" avcodec_ok="false" fi fi fi CFLAGS="$CFLAGS_save" LIBS="$LIBS_save" ]) dnl ACL_PATH_AVCODEC(BUILD_ID [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test for libavcodec, and define AVCODEC_CFLAGS, AVCODEC_LIBS and dnl AVCODEC_VERSION AC_DEFUN([ACL_PATH_AVCODEC],[ AC_ARG_WITH(avcodec,[ --with-avcodec=PFX Prefix where libavcodec is installed (optional)], avcodec_prefix="$withval", avcodec_prefix="") dnl We need the _save variables because PKG_CHECK_MODULES will change dnl the other variables AVCODEC_CFLAGS_save="" AVCODEC_LIBS_save="" avcodec_done="false" AH_TEMPLATE([AVCODEC_HEADER], [Header for libavcodec]) AH_TEMPLATE([VAAPI_HEADER], [Header for vaapi]) dnl dnl First preference: configure options dnl if test "x$avcodec_prefix" != x; then AVCODEC_CFLAGS="-I$avcodec_prefix/include" AVCODEC_LIBS="-L$avcodec_prefix/lib -lavcodec" ACL_CHECK_AVCODEC([$1]) if test "x$avcodec_ok" = "xtrue"; then avcodec_done="true" fi fi dnl dnl Second Perference: Autodetect dnl if test "x$avcodec_done" = "xfalse"; then PKG_CHECK_MODULES(AVCODEC, libavcodec, avcodec_orig="true", avcodec_orig="false") dnl dnl No idea for what this is good but libavcodec is not found if this is missing dnl if test "x$os_win32" = "xyes"; then AVCODEC_LIBS="-L/usr/local/bin $AVCODEC_LIBS" fi ACL_CHECK_AVCODEC([$1]) if test "x$avcodec_ok" = "xtrue"; then avcodec_done="true" fi fi if test "x$avcodec_done" = "xtrue"; then ifelse([$2], , :, [$2]) AC_DEFINE_UNQUOTED(AVCODEC_HEADER, $AVCODEC_HEADER) AC_DEFINE_UNQUOTED(VAAPI_HEADER, $VAAPI_HEADER) else ifelse([$3], , :, [$3]) fi ]) bplaum-gmerlin-encoders-172394d/m4/avformat.m4000066400000000000000000000051001513225514200211010ustar00rootroot00000000000000# Configure paths for libavformat # Burkhard Plaum, 2004-08-12 dnl Compile an avformat test program and figure out the version AC_DEFUN([ACL_CHECK_AVFORMAT],[ AC_MSG_CHECKING([for build ID in libavformat, libs: $AVFORMAT_LIBS]) CFLAGS_save=$CFLAGS LIBS_save=$LIBS dnl Look for header found_header="false" CFLAGS="$CFLAGS $GMERLIN_DEP_CFLAGS $AVFORMAT_CFLAGS" LIBS="$LIBS $GMERLIN_DEP_LIBS" AC_TRY_COMPILE([ #include ],[], [found_header="true";AVFORMAT_HEADER="" ],) if test $found_header = "false"; then AC_TRY_COMPILE([ #include ],[], [found_header="true";AVFORMAT_HEADER="" ],) fi if test $found_header = "false"; then AC_TRY_COMPILE([ #include ],[],[found_header="true";AVFORMAT_HEADER=""]) fi avformat_ok="false" AC_TRY_RUN([ #include #include $AVFORMAT_HEADER int main() { FILE * output; if(LIBAVFORMAT_BUILD < $1) return -1; output=fopen("avformat_version", "w"); fprintf(output, AV_TOSTRING(LIBAVFORMAT_VERSION)); fclose(output); return 0; } ], [ # program could be run if test "x$AVFORMAT_VERSION" = "x"; then AVFORMAT_VERSION=`cat avformat_version` fi rm -f avformat_version avformat_ok="true" AC_MSG_RESULT(ok) ], [ # program could not be run AC_MSG_RESULT(failed) ]) CFLAGS="$CFLAGS_save" LIBS="$LIBS_save" ]) dnl ACL_PATH_AVFORMAT(BUILD_ID [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl Test for libavformat, and define AVFORMAT_CFLAGS, AVFORMAT_LIBS and dnl AVFORMAT_VERSION AC_DEFUN([ACL_PATH_AVFORMAT],[ AC_ARG_WITH(avformat,[ --with-avformat=PFX Prefix where libavformat is installed (optional)], avformat_prefix="$withval", avformat_prefix="") dnl We need the _save variables because PKG_CHECK_MODULES will change dnl the other variables AVFORMAT_CFLAGS_save="" AVFORMAT_LIBS_save="" avformat_done="false" dnl dnl First preference: configure options dnl if test "x$avformat_prefix" != x; then AVFORMAT_CFLAGS="-I$avformat_prefix/include" AVFORMAT_LIBS="-L$avformat_prefix/lib -lavformat" ACL_CHECK_AVFORMAT([$1]) if test "x$avformat_ok" = "xtrue"; then avformat_done="true" fi fi dnl dnl Second Perference: Autodetect dnl if test "x$avformat_done" = "xfalse"; then PKG_CHECK_MODULES(AVFORMAT, libavformat, avformat_orig="true", avformat_orig="false") ACL_CHECK_AVFORMAT([$1]) if test "x$avformat_ok" = "xtrue"; then avformat_done="true" fi fi if test "x$avformat_done" = "xtrue"; then ifelse([$2], , :, [$2]) else ifelse([$3], , :, [$3]) fi ]) bplaum-gmerlin-encoders-172394d/m4/check_funcs.m4000066400000000000000000000145051513225514200215460ustar00rootroot00000000000000dnl dnl Standardized linker flags: dnl We use --as-needed for executables and dnl --no-undefined for libraries dnl AC_DEFUN([GMERLIN_CHECK_LDFLAGS],[ GMERLIN_LIB_LDFLAGS="" GMERLIN_EXE_LDFLAGS="" AC_MSG_CHECKING(if linker supports --no-undefined) OLD_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--no-undefined" AC_TRY_LINK([],[], [GMERLIN_LIB_LDFLAGS="-Wl,--no-undefined $GMERLIN_LIB_LDFLAGS"; AC_MSG_RESULT(Supported)], [AC_MSG_RESULT(Unsupported)]) LDFLAGS=$OLD_LDFLAGS AC_MSG_CHECKING(if linker supports --as-needed) OLD_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--as-needed" AC_TRY_LINK([],[], [GMERLIN_EXE_LDFLAGS="-Wl,--as-needed $GMERLIN_EXE_LDFLAGS"; AC_MSG_RESULT(Supported)], [AC_MSG_RESULT(Unsupported)]) LDFLAGS=$OLD_LDFLAGS AC_SUBST(GMERLIN_LIB_LDFLAGS) AC_SUBST(GMERLIN_EXE_LDFLAGS) ]) dnl dnl Check for theora encoder dnl AC_DEFUN([GMERLIN_CHECK_THEORAENC],[ AH_TEMPLATE([HAVE_THEORAENC], [Do we have theora encoder installed?]) have_theora="false" THEORAENC_REQUIRED="1.0.0" AC_ARG_ENABLE(theoraenc, [AS_HELP_STRING([--disable-theoraenc],[Disable theoraenc (default: autodetect)]) ], [case "${enableval}" in yes) test_theoraenc=true ;; no) test_theoraenc=false ;; esac],[test_theoraenc=true]) if test x$test_theoraenc = xtrue; then PKG_CHECK_MODULES(THEORAENC, theoraenc, have_theoraenc="true", have_theoraenc="false") fi AC_SUBST(THEORAENC_REQUIRED) AC_SUBST(THEORAENC_LIBS) AC_SUBST(THEORAENC_CFLAGS) AM_CONDITIONAL(HAVE_THEORAENC, test x$have_theoraenc = xtrue) if test "x$have_theoraenc" = "xtrue"; then AC_DEFINE([HAVE_THEORAENC]) fi ]) dnl dnl Check for libavcodec dnl AC_DEFUN([GMERLIN_CHECK_AVCODEC],[ AH_TEMPLATE([HAVE_AVCODEC], [Do we have libavcodec installed?]) have_libavcodec="false" AVCODEC_REQUIRED="58.54.100" AC_ARG_ENABLE(avcodec, [AS_HELP_STRING([--disable-avcodec],[Disable libavcodec (default: autodetect)])], [case "${enableval}" in yes) test_avcodec=true ;; no) test_avcodec=false ;; esac],[test_avcodec=true]) if test x$test_avcodec = xtrue; then PKG_CHECK_MODULES(AVCODEC, libavcodec, have_avcodec="true", have_avcodec="false") fi AC_SUBST(AVCODEC_REQUIRED) AC_SUBST(AVCODEC_LIBS) AC_SUBST(AVCODEC_CFLAGS) AM_CONDITIONAL(HAVE_AVCODEC, test x$have_avcodec = xtrue) if test "x$have_avcodec" = "xtrue"; then AC_DEFINE([HAVE_AVCODEC]) fi ]) AC_DEFUN([GMERLIN_CHECK_AVFORMAT],[ AH_TEMPLATE([HAVE_AVFORMAT], [Do we have libavformat installed?]) have_libavformat="false" AVFORMAT_REQUIRED="58.29.100" AC_ARG_ENABLE(avformat, [AS_HELP_STRING([--disable-avformat],[Disable libavformat (default: autodetect)])], [case "${enableval}" in yes) test_avformat=true ;; no) test_avformat=false ;; esac],[test_avformat=true]) if test x$test_avformat = xtrue; then PKG_CHECK_MODULES(AVFORMAT, libavformat, have_avformat="true", have_avformat="false") fi AC_SUBST(AVFORMAT_REQUIRED) AC_SUBST(AVFORMAT_LIBS) AC_SUBST(AVFORMAT_CFLAGS) AM_CONDITIONAL(HAVE_AVFORMAT, test x$have_avformat = xtrue) if test "x$have_avformat" = "xtrue"; then AC_DEFINE([HAVE_AVFORMAT]) fi ]) dnl dnl Ogg dnl AC_DEFUN([GMERLIN_CHECK_OGG],[ OGG_REQUIRED="1.0" have_ogg=false AH_TEMPLATE([HAVE_OGG], [Ogg libraries are there]) AC_ARG_ENABLE(ogg, [AS_HELP_STRING([--disable-ogg],[Disable ogg (default: autodetect)])], [case "${enableval}" in yes) test_ogg=true ;; no) test_ogg=false ;; esac],[test_ogg=true]) if test x$test_ogg = xtrue; then PKG_CHECK_MODULES(OGG, ogg, have_ogg="true", have_ogg="false") fi AC_SUBST(OGG_LIBS) AC_SUBST(OGG_CFLAGS) AM_CONDITIONAL(HAVE_OGG, test x$have_ogg = xtrue) if test x$have_ogg = xtrue; then AC_DEFINE(HAVE_OGG) fi AC_SUBST(OGG_REQUIRED) ]) dnl dnl Vorbis dnl AC_DEFUN([GMERLIN_CHECK_VORBIS],[ VORBIS_REQUIRED="1.0" have_vorbis=false AH_TEMPLATE([HAVE_VORBIS], [Vorbis libraries are there]) AC_ARG_ENABLE(vorbis, [AS_HELP_STRING([--disable-vorbis],[Disable vorbis (default: autodetect)])], [case "${enableval}" in yes) test_vorbis=true ;; no) test_vorbis=false ;; esac],[test_vorbis=true]) if test x$test_vorbis = xtrue; then PKG_CHECK_MODULES(VORBISENC, vorbisenc, have_vorbis="true", have_vorbis="false") fi AM_CONDITIONAL(HAVE_VORBIS, test x$have_vorbis = xtrue) if test x$have_vorbis = xtrue; then AC_DEFINE(HAVE_VORBIS) OLD_CFLAGS=$CFLAGS OLD_LIBS=$LIBS CFLAGS="$VORBIS_CFLAGS" LIBS="$VORBIS_LIBS" AC_CHECK_FUNCS(vorbis_synthesis_restart) CFLAGS="$OLD_CFLAGS" LIBS="$OLD_LIBS" fi AC_SUBST(VORBIS_REQUIRED) ]) dnl dnl FLAC dnl AC_DEFUN([GMERLIN_CHECK_FLAC],[ FLAC_REQUIRED="1.2.0" have_flac="false" AC_ARG_ENABLE(flac, [AS_HELP_STRING([--disable-flac],[Disable flac (default: autodetect)])], [case "${enableval}" in yes) test_flac=true ;; no) test_flac=false ;; esac],[test_flac=true]) if test x$test_flac = xtrue; then AH_TEMPLATE([HAVE_FLAC], [Enable FLAC]) PKG_CHECK_MODULES(FLAC, flac, have_flac="true", have_flac="false") fi AC_SUBST(FLAC_CFLAGS) AC_SUBST(FLAC_LIBS) AC_SUBST(FLAC_REQUIRED) AM_CONDITIONAL(HAVE_FLAC, test x$have_flac = xtrue) if test x$have_flac = xtrue; then AC_DEFINE(HAVE_FLAC) fi ]) dnl dnl lame dnl AC_DEFUN([GMERLIN_CHECK_LAME],[ LAME_REQUIRED="3.93" have_lame="false" AC_ARG_ENABLE(lame, [AS_HELP_STRING([--disable-lame],[Disable lame (default: autodetect)])], [case "${enableval}" in yes) test_lame=true ;; no) test_lame=false ;; esac],[test_lame=true]) AH_TEMPLATE([HAVE_LAME], [Do we have lame installed?]) if test x$test_lame = xtrue; then PKG_CHECK_MODULES(LAME, lame, have_lame="true", have_lame="false") fi AC_SUBST(LAME_CFLAGS) AC_SUBST(LAME_LIBS) AC_SUBST(LAME_REQUIRED) AM_CONDITIONAL(HAVE_LAME, test x$have_lame = xtrue) if test x$have_lame = xtrue; then AC_DEFINE(HAVE_LAME) fi ]) dnl dnl Check for opus codec dnl AC_DEFUN([GMERLIN_CHECK_OPUS],[ AH_TEMPLATE([HAVE_OPUS], [Do we have libopus installed?]) have_opus="false" OPUS_REQUIRED="1.0.0" AC_ARG_ENABLE(opus, [AS_HELP_STRING([--disable-opus],[Disable opus (default: autodetect)])], [case "${enableval}" in yes) test_opus=true ;; no) test_opus=false ;; esac],[test_opus=true]) if test x$test_opus = xtrue; then PKG_CHECK_MODULES(OPUS, opus, have_opus="true", have_opus="false") fi AC_SUBST(OPUS_REQUIRED) AC_SUBST(OPUS_LIBS) AC_SUBST(OPUS_CFLAGS) AM_CONDITIONAL(HAVE_OPUS, test x$have_opus = xtrue) if test "x$have_opus" = "xtrue"; then AC_DEFINE([HAVE_OPUS]) fi ]) bplaum-gmerlin-encoders-172394d/m4/codeset.m4000066400000000000000000000013511513225514200207140ustar00rootroot00000000000000# codeset.m4 serial AM1 (gettext-0.10.40) dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) bplaum-gmerlin-encoders-172394d/m4/gettext.m4000066400000000000000000000356151513225514200207640ustar00rootroot00000000000000# gettext.m4 serial 66 (gettext-0.18.2) dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value '$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) bplaum-gmerlin-encoders-172394d/m4/glibc2.m4000066400000000000000000000013541513225514200204330ustar00rootroot00000000000000# glibc2.m4 serial 1 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.0 or newer. # From Bruno Haible. AC_DEFUN([gt_GLIBC2], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer, ac_cv_gnu_library_2, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ >= 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2=yes, ac_cv_gnu_library_2=no) ] ) AC_SUBST(GLIBC2) GLIBC2="$ac_cv_gnu_library_2" ] ) bplaum-gmerlin-encoders-172394d/m4/glibc21.m4000066400000000000000000000014451513225514200205150ustar00rootroot00000000000000# glibc21.m4 serial 3 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([gl_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) bplaum-gmerlin-encoders-172394d/m4/iconv.m4000066400000000000000000000216201513225514200204050ustar00rootroot00000000000000# iconv.m4 serial 18 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include #include int main () { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; const char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) result |= 16; return result; }]])], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [ changequote(,)dnl case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac changequote([,])dnl ]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) fi ]) bplaum-gmerlin-encoders-172394d/m4/intdiv0.m4000066400000000000000000000033401513225514200206430ustar00rootroot00000000000000# intdiv0.m4 serial 1 (gettext-0.11.3) dnl Copyright (C) 2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gt_INTDIV0], [ AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], gt_cv_int_divbyzero_sigfpe, [ AC_TRY_RUN([ #include #include static void #ifdef __cplusplus sigfpe_handler (int sig) #else sigfpe_handler (sig) int sig; #endif { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ exit (sig != SIGFPE); } int x = 1; int y = 0; int z; int nan; int main () { signal (SIGFPE, sigfpe_handler); /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) signal (SIGTRAP, sigfpe_handler); #endif /* Linux/SPARC yields signal SIGILL. */ #if defined (__sparc__) && defined (__linux__) signal (SIGILL, sigfpe_handler); #endif z = x / y; nan = y / y; exit (1); } ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, [ # Guess based on the CPU. case "$host_cpu" in alpha* | i[34567]86 | m68k | s390*) gt_cv_int_divbyzero_sigfpe="guessing yes";; *) gt_cv_int_divbyzero_sigfpe="guessing no";; esac ]) ]) case "$gt_cv_int_divbyzero_sigfpe" in *yes) value=1;; *) value=0;; esac AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, [Define if integer division by zero raises signal SIGFPE.]) ]) bplaum-gmerlin-encoders-172394d/m4/intmax.m4000066400000000000000000000017461513225514200205760ustar00rootroot00000000000000# intmax.m4 serial 2 (gettext-0.14.2) dnl Copyright (C) 2002-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the system has the 'intmax_t' type, but don't attempt to dnl find a replacement if it is lacking. AC_DEFUN([gt_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, [AC_TRY_COMPILE([ #include #include #if HAVE_STDINT_H_WITH_UINTMAX #include #endif #if HAVE_INTTYPES_H_WITH_UINTMAX #include #endif ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then AC_DEFINE(HAVE_INTMAX_T, 1, [Define if you have the 'intmax_t' type in or .]) fi ]) bplaum-gmerlin-encoders-172394d/m4/inttypes-h.m4000066400000000000000000000015001513225514200213660ustar00rootroot00000000000000# inttypes-h.m4 serial 1 (gettext-0.15) dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H if exists and doesn't clash with # . AC_DEFUN([gl_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [ AC_TRY_COMPILE( [#include #include ], [], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no) ]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, [Define if exists and doesn't clash with .]) fi ]) bplaum-gmerlin-encoders-172394d/m4/inttypes-pri.m4000066400000000000000000000020061513225514200217330ustar00rootroot00000000000000# inttypes-pri.m4 serial 2 (gettext-0.15) dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. AC_DEFUN([gt_INTTYPES_PRI], [ AC_REQUIRE([gl_HEADER_INTTYPES_H]) if test $gl_cv_header_inttypes_h = yes; then AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], gt_cv_inttypes_pri_broken, [ AC_TRY_COMPILE([#include #ifdef PRId32 char *p = PRId32; #endif ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, [Define if exists and defines unusable PRI* macros.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/inttypes_h.m4000066400000000000000000000016231513225514200214560ustar00rootroot00000000000000# inttypes_h.m4 serial 6 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)]) if test $gl_cv_header_inttypes_h = yes; then AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) bplaum-gmerlin-encoders-172394d/m4/lcmessage.m4000066400000000000000000000024041513225514200212310ustar00rootroot00000000000000# lcmessage.m4 serial 4 (gettext-0.14.2) dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995. # Check whether LC_MESSAGES is available in . AC_DEFUN([gt_LC_MESSAGES], [ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)]) if test $gt_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/lib-ld.m4000066400000000000000000000071431513225514200204360ustar00rootroot00000000000000# lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 = 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) bplaum-gmerlin-encoders-172394d/m4/lib-prefix.m4000066400000000000000000000204221513225514200213270ustar00rootroot00000000000000# lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) bplaum-gmerlin-encoders-172394d/m4/lock.m4000066400000000000000000000266731513225514200202340ustar00rootroot00000000000000# lock.m4 serial 2 (gettext-0.15) dnl Copyright (C) 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Tests for a multithreading library to be used. dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS, dnl USE_PTH_THREADS, USE_WIN32_THREADS dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with dnl libtool). dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for dnl programs that really need multithread functionality. The difference dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread". dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. AC_DEFUN([gl_LOCK], [ AC_REQUIRE([gl_LOCK_BODY]) ]) dnl The guts of gl_LOCK. Needs to be expanded only once. AC_DEFUN([gl_LOCK_BODY], [ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that dnl influences the result of the autoconf tests that test for *_unlocked dnl declarations, on AIX 5 at least. Therefore it must come early. AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl AC_BEFORE([$0], [gl_ARGP])dnl AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems dnl Check for multithreading. AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) AC_HELP_STRING([--disable-threads], [build without multithread safety]), gl_use_threads=$enableval, gl_use_threads=yes) gl_threads_api=none LIBTHREAD= LTLIBTHREAD= LIBMULTITHREAD= LTLIBMULTITHREAD= if test "$gl_use_threads" != no; then dnl Check whether the compiler and linker support weak declarations. AC_MSG_CHECKING([whether imported symbols can be declared weak]) gl_have_weak=no AC_TRY_LINK([extern void xyzzy (); #pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes]) AC_MSG_RESULT([$gl_have_weak]) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that # it groks . gl_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_REENTRANT" AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no) CPPFLAGS="$gl_save_CPPFLAGS" if test "$gl_have_pthread_h" = yes; then # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads case "$host_os" in osf*) # On OSF/1, the compiler needs the flag -D_REENTRANT so that it # groks . cc also understands the flag -pthread, but # we don't use it because 1. gcc-2.95 doesn't understand -pthread, # 2. putting a flag into CPPFLAGS that has an effect on the linker # causes the AC_TRY_LINK test below to succeed unexpectedly, # leading to wrong values of LIBTHREAD and LTLIBTHREAD. CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac gl_have_pthread= # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist # in libc. IRIX 6.5 has the first one in both libc and libpthread, but # the second one only in libpthread, and lock.c needs it. AC_TRY_LINK([#include ], [pthread_mutex_lock((pthread_mutex_t*)0); pthread_mutexattr_init((pthread_mutexattr_t*)0);], [gl_have_pthread=yes]) # Test for libpthread by looking for pthread_kill. (Not pthread_self, # since it is defined as a macro on OSF/1.) if test -n "$gl_have_pthread"; then # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. AC_CHECK_LIB(pthread, pthread_kill, [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread # On Solaris and HP-UX, most pthread functions exist also in libc. # Therefore pthread_in_use() needs to actually try to create a # thread: pthread_create from libc will fail, whereas # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1, [Define if the pthread_in_use() detection is hard.]) esac ]) else # Some library is needed. Try libpthread and libc_r. AC_CHECK_LIB(pthread, pthread_kill, [gl_have_pthread=yes LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread]) if test -z "$gl_have_pthread"; then # For FreeBSD 4. AC_CHECK_LIB(c_r, pthread_kill, [gl_have_pthread=yes LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r]) fi fi if test -n "$gl_have_pthread"; then gl_threads_api=posix AC_DEFINE([USE_POSIX_THREADS], 1, [Define if the POSIX multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then AC_DEFINE([USE_POSIX_THREADS_WEAK], 1, [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. AC_CHECK_TYPE([pthread_rwlock_t], [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1, [Define if the POSIX multithreading library has read/write locks.])], [], [#include ]) # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. AC_TRY_COMPILE([#include ], [#if __FreeBSD__ == 4 error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; #endif], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, [Define if the defines PTHREAD_MUTEX_RECURSIVE.])]) # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of 'errno' in . case "$host_os" in aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; esac fi fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then gl_have_solaristhread= gl_save_LIBS="$LIBS" LIBS="$LIBS -lthread" AC_TRY_LINK([#include #include ], [thr_self();], [gl_have_solaristhread=yes]) LIBS="$gl_save_LIBS" if test -n "$gl_have_solaristhread"; then gl_threads_api=solaris LIBTHREAD=-lthread LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" AC_DEFINE([USE_SOLARIS_THREADS], 1, [Define if the old Solaris multithreading library can be used.]) if test $gl_have_weak = yes; then AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1, [Define if references to the old Solaris multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi fi fi if test "$gl_use_threads" = pth; then gl_save_CPPFLAGS="$CPPFLAGS" AC_LIB_LINKFLAGS(pth) gl_have_pth= gl_save_LIBS="$LIBS" LIBS="$LIBS -lpth" AC_TRY_LINK([#include ], [pth_self();], gl_have_pth=yes) LIBS="$gl_save_LIBS" if test -n "$gl_have_pth"; then gl_threads_api=pth LIBTHREAD="$LIBPTH" LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" AC_DEFINE([USE_PTH_THREADS], 1, [Define if the GNU Pth multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then AC_DEFINE([USE_PTH_THREADS_WEAK], 1, [Define if references to the GNU Pth multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= fi fi else CPPFLAGS="$gl_save_CPPFLAGS" fi fi if test -z "$gl_have_pthread"; then if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then if { case "$host_os" in mingw*) true;; *) false;; esac }; then gl_threads_api=win32 AC_DEFINE([USE_WIN32_THREADS], 1, [Define if the Win32 multithreading API can be used.]) fi fi fi fi AC_MSG_CHECKING([for multithread API to use]) AC_MSG_RESULT([$gl_threads_api]) AC_SUBST(LIBTHREAD) AC_SUBST(LTLIBTHREAD) AC_SUBST(LIBMULTITHREAD) AC_SUBST(LTLIBMULTITHREAD) gl_PREREQ_LOCK ]) # Prerequisites of lib/lock.c. AC_DEFUN([gl_PREREQ_LOCK], [ AC_REQUIRE([AC_C_INLINE]) ]) dnl Survey of platforms: dnl dnl Platform Available Compiler Supports test-lock dnl flavours option weak result dnl --------------- --------- --------- -------- --------- dnl Linux 2.4/glibc posix -lpthread Y OK dnl dnl GNU Hurd/glibc posix dnl dnl FreeBSD 5.3 posix -lc_r Y dnl posix -lkse ? Y dnl posix -lpthread ? Y dnl posix -lthr Y dnl dnl FreeBSD 5.2 posix -lc_r Y dnl posix -lkse Y dnl posix -lthr Y dnl dnl FreeBSD 4.0,4.10 posix -lc_r Y OK dnl dnl NetBSD 1.6 -- dnl dnl OpenBSD 3.4 posix -lpthread Y OK dnl dnl MacOS X 10.[123] posix -lpthread Y OK dnl dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK dnl dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl dnl IRIX 6.5 posix -lpthread Y 0.5 dnl dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK dnl -lpthread (gcc) Y dnl dnl Cygwin posix -lpthread Y OK dnl dnl Any of the above pth -lpth 0.0 dnl dnl Mingw win32 N OK dnl dnl BeOS 5 -- dnl dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is dnl turned off: dnl OK if all three tests terminate OK, dnl 0.5 if the first test terminates OK but the second one loops endlessly, dnl 0.0 if the first test already loops endlessly. bplaum-gmerlin-encoders-172394d/m4/longdouble.m4000066400000000000000000000022771513225514200214300ustar00rootroot00000000000000# longdouble.m4 serial 2 (gettext-0.15) dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether the compiler supports the 'long double' type. dnl Prerequisite: AC_PROG_CC dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics. AC_DEFUN([gt_TYPE_LONGDOUBLE], [ AC_CACHE_CHECK([for long double], gt_cv_c_long_double, [if test "$GCC" = yes; then gt_cv_c_long_double=yes else AC_TRY_COMPILE([ /* The Stardent Vistra knows sizeof(long double), but does not support it. */ long double foo = 0.0; /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ int array [2*(sizeof(long double) >= sizeof(double)) - 1]; ], , gt_cv_c_long_double=yes, gt_cv_c_long_double=no) fi]) if test $gt_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/longlong.m4000066400000000000000000000014161513225514200211070ustar00rootroot00000000000000# longlong.m4 serial 5 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_LONG_LONG if 'long long' works. AC_DEFUN([gl_AC_TYPE_LONG_LONG], [ AC_CACHE_CHECK([for long long], ac_cv_type_long_long, [AC_TRY_LINK([long long ll = 1LL; int i = 63;], [long long llmax = (long long) -1; return ll << i | ll >> i | llmax / ll | llmax % ll;], ac_cv_type_long_long=yes, ac_cv_type_long_long=no)]) if test $ac_cv_type_long_long = yes; then AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have the 'long long' type.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/lqt_opt_cflags.m4000066400000000000000000000041571513225514200222760ustar00rootroot00000000000000# # Automatic OPT_CFLAGS generation by Burkhard Plaum (2005-05-24) # dnl LQT_TRY_CFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS]) dnl check if $CC supports a given set of cflags AC_DEFUN([LQT_TRY_CFLAGS], [AC_MSG_CHECKING([if $CC supports $1 flags]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$1" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main() { return 0; } ]])], [lqt_try_cflags_ok=yes],[lqt_try_cflags_ok=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT([$lqt_try_cflags_ok]) if test x"$lqt_try_cflags_ok" = x"yes"; then ifelse([$2],[],[:],[$2]) else ifelse([$3],[],[:],[$3]) fi]) dnl LQT_OPT_CFLAGS([ADDITIONAL_OPT_FLAGS]) dnl Get proper optimization flags. dnl dnl ADDITIONAL_OPT_FLAGS: Additional optimization flags (e.g. -O3 --fast-math) dnl On output, the Variable LQT_OPT_CFLAGS will be set to the compiler flags dnl Furthermore, is debuggind was requested, the variable LQT_DEBUG will be dnl set to "true" AC_DEFUN([LQT_OPT_CFLAGS],[ dnl dnl Debugging Support dnl LQT_DEBUG=false AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[Enable debugging, disable optimization])], [case "${enableval}" in yes) LQT_DEBUG=true ;; no) LQT_DEBUG=false ;; esac],[LQT_DEBUG=false]) dnl dnl Extra cflags from the commandline. Can have the special values "none" or "auto" dnl AC_ARG_WITH(cpuflags, AS_HELP_STRING([--with-cpuflags],[Set CPU specific compiler flags. Default is auto, which does autodetection. Specify none for compiling the most portable binaries]), lqt_cpuflags="$withval", lqt_cpuflags="auto") if test x$lqt_cpuflags = xnone; then lqt_cpuflags="" fi dnl Let gcc detect the architecture if test "x$lqt_cpuflags" = "xauto"; then lqt_cpuflags="-march=native -mtune=native" fi dnl dnl Build the final flags dnl lqt_additional_opt_flags=ifelse([$1],[],[],[$1]) lqt_test_flags=$lqt_cpuflags if test x$LQT_DEBUG = xtrue; then lqt_test_cflags="$lqt_test_flags -g -DDEBUG" else lqt_test_cflags="$lqt_test_flags $lqt_additional_opt_flags" fi OPT_CFLAGS="" for i in $lqt_test_cflags; do LQT_TRY_CFLAGS($i, OPT_CFLAGS="$OPT_CFLAGS $i") ; done ]) bplaum-gmerlin-encoders-172394d/m4/nls.m4000066400000000000000000000023151513225514200200630ustar00rootroot00000000000000# nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) bplaum-gmerlin-encoders-172394d/m4/po.m4000066400000000000000000000450411513225514200177100ustar00rootroot00000000000000# po.m4 serial 21 (gettext-0.18.3) dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assignment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" < #include /* The string "%2$d %1$d", with dollar characters protected from the shell's dollar expansion (possibly an autoconf bug). */ static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; static char buf[100]; int main () { sprintf (buf, format, 33, 55); return (strcmp (buf, "55 33") != 0); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ AC_EGREP_CPP(notposix, [ #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif ], gt_cv_func_printf_posix="guessing no", gt_cv_func_printf_posix="guessing yes") ]) ]) case $gt_cv_func_printf_posix in *yes) AC_DEFINE(HAVE_POSIX_PRINTF, 1, [Define if your printf() function supports format strings with positions.]) ;; esac ]) bplaum-gmerlin-encoders-172394d/m4/progtest.m4000066400000000000000000000060401513225514200211350ustar00rootroot00000000000000# progtest.m4 serial 7 (gettext-0.18.2) dnl Copyright (C) 1996-2003, 2005, 2008-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) bplaum-gmerlin-encoders-172394d/m4/signed.m4000066400000000000000000000011541513225514200205400ustar00rootroot00000000000000# signed.m4 serial 1 (gettext-0.10.40) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([bh_C_SIGNED], [ AC_CACHE_CHECK([for signed], bh_cv_c_signed, [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) if test $bh_cv_c_signed = no; then AC_DEFINE(signed, , [Define to empty if the C compiler doesn't support this keyword.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/size_max.m4000066400000000000000000000043301513225514200211050ustar00rootroot00000000000000# size_max.m4 serial 4 dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([gl_SIZE_MAX], [ AC_CHECK_HEADERS(stdint.h) dnl First test whether the system already has SIZE_MAX. AC_MSG_CHECKING([for SIZE_MAX]) result= AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H #include #endif #ifdef SIZE_MAX Found it #endif ], result=yes) if test -z "$result"; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. Try hard to find a definition that can dnl be used in a preprocessor #if, i.e. doesn't contain a cast. _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1, [#include #include ], size_t_bits_minus_1=) _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, [#include ], fits_in_uint=) if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then if test $fits_in_uint = 1; then dnl Even though SIZE_MAX fits in an unsigned int, it must be of type dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. AC_TRY_COMPILE([#include extern size_t foo; extern unsigned long foo; ], [], fits_in_uint=0) fi dnl We cannot use 'expr' to simplify this expression, because 'expr' dnl works only with 'long' integers in the host environment, while we dnl might be cross-compiling from a 32-bit platform to a 64-bit platform. if test $fits_in_uint = 1; then result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" else result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" fi else dnl Shouldn't happen, but who knows... result='((size_t)~(size_t)0)' fi fi AC_MSG_RESULT([$result]) if test "$result" != yes; then AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], [Define as the maximum value of type 'size_t', if the system doesn't define it.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/stdint_h.m4000066400000000000000000000015731513225514200211100ustar00rootroot00000000000000# stdint_h.m4 serial 5 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_STDINT_H_WITH_UINTMAX if exists, # doesn't clash with , and declares uintmax_t. AC_DEFUN([gl_AC_HEADER_STDINT_H], [ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h, [AC_TRY_COMPILE( [#include #include ], [uintmax_t i = (uintmax_t) -1;], gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)]) if test $gl_cv_header_stdint_h = yes; then AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi ]) bplaum-gmerlin-encoders-172394d/m4/uintmax_t.m4000066400000000000000000000020761513225514200213030ustar00rootroot00000000000000# uintmax_t.m4 serial 9 dnl Copyright (C) 1997-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. AC_PREREQ(2.13) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG]) test $ac_cv_type_unsigned_long_long = yes \ && ac_type='unsigned long long' \ || ac_type='unsigned long' AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, [Define to unsigned long or unsigned long long if and don't define.]) else AC_DEFINE(HAVE_UINTMAX_T, 1, [Define if you have the 'uintmax_t' type in or .]) fi ]) bplaum-gmerlin-encoders-172394d/m4/ulonglong.m4000066400000000000000000000016151513225514200212750ustar00rootroot00000000000000# ulonglong.m4 serial 4 dnl Copyright (C) 1999-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Paul Eggert. # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG], [ AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], [unsigned long long ullmax = (unsigned long long) -1; return ull << i | ull >> i | ullmax / ull | ullmax % ull;], ac_cv_type_unsigned_long_long=yes, ac_cv_type_unsigned_long_long=no)]) if test $ac_cv_type_unsigned_long_long = yes; then AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, [Define if you have the 'unsigned long long' type.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/visibility.m4000066400000000000000000000041301513225514200214530ustar00rootroot00000000000000# visibility.m4 serial 1 (gettext-0.15) dnl Copyright (C) 2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Tests whether the compiler supports the command-line option dnl -fvisibility=hidden and the function and variable attributes dnl __attribute__((__visibility__("hidden"))) and dnl __attribute__((__visibility__("default"))). dnl Does *not* test for __visibility__("protected") - which has tricky dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on dnl MacOS X. dnl Does *not* test for __visibility__("internal") - which has processor dnl dependent semantics. dnl Does *not* test for #pragma GCC visibility push(hidden) - which is dnl "really only recommended for legacy code". dnl Set the variable CFLAG_VISIBILITY. dnl Defines and sets the variable HAVE_VISIBILITY. AC_DEFUN([gl_VISIBILITY], [ AC_REQUIRE([AC_PROG_CC]) CFLAG_VISIBILITY= HAVE_VISIBILITY=0 if test -n "$GCC"; then AC_MSG_CHECKING([for simple visibility declarations]) AC_CACHE_VAL(gl_cv_cc_visibility, [ gl_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" AC_TRY_COMPILE( [extern __attribute__((__visibility__("hidden"))) int hiddenvar; extern __attribute__((__visibility__("default"))) int exportedvar; extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void); extern __attribute__((__visibility__("default"))) int exportedfunc (void);], [], gl_cv_cc_visibility=yes, gl_cv_cc_visibility=no) CFLAGS="$gl_save_CFLAGS"]) AC_MSG_RESULT([$gl_cv_cc_visibility]) if test $gl_cv_cc_visibility = yes; then CFLAG_VISIBILITY="-fvisibility=hidden" HAVE_VISIBILITY=1 fi fi AC_SUBST([CFLAG_VISIBILITY]) AC_SUBST([HAVE_VISIBILITY]) AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY], [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.]) ]) bplaum-gmerlin-encoders-172394d/m4/wchar_t.m4000066400000000000000000000013261513225514200207170ustar00rootroot00000000000000# wchar_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wchar_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WCHAR_T], [ AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, [AC_TRY_COMPILE([#include wchar_t foo = (wchar_t)'\0';], , gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) if test $gt_cv_c_wchar_t = yes; then AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/wint_t.m4000066400000000000000000000013041513225514200205700ustar00rootroot00000000000000# wint_t.m4 serial 1 (gettext-0.12) dnl Copyright (C) 2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl Test whether has the 'wint_t' type. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], [ AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, [AC_TRY_COMPILE([#include wint_t foo = (wchar_t)'\0';], , gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) fi ]) bplaum-gmerlin-encoders-172394d/m4/xsize.m4000066400000000000000000000006451513225514200204350ustar00rootroot00000000000000# xsize.m4 serial 3 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS(stdint.h) ]) bplaum-gmerlin-encoders-172394d/make_potfiles000077500000000000000000000000751513225514200212560ustar00rootroot00000000000000#!/bin/sh find . -name "*.[ch]" | cut -b 3- > po/POTFILES.in bplaum-gmerlin-encoders-172394d/plugins/000077500000000000000000000000001513225514200201655ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/plugins/Makefile.am000066400000000000000000000005151513225514200222220ustar00rootroot00000000000000if HAVE_VORBIS ogg_subdirs = ogg else ogg_subdirs = endif if HAVE_FLAC flac_subdirs = flac else flac_subdirs = endif if HAVE_LAME lame_subdirs = lame else lame_subdirs = endif if HAVE_AVFORMAT ffmpeg_subdirs = ffmpeg else ffmpeg_subdirs = endif SUBDIRS = \ $(ogg_subdirs) \ $(flac_subdirs) \ $(lame_subdirs) \ $(ffmpeg_subdirs) bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/000077500000000000000000000000001513225514200214315ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/Makefile.am000066400000000000000000000045461513225514200234760ustar00rootroot00000000000000gmerlin_plugindir = @gmerlin_plugindir@ AM_CPPFLAGS = -I$(top_srcdir)/include AM_LDFLAGS = @GMERLIN_PLUGIN_LDFLAGS@ -avoid-version -module AM_CFLAGS = @AVFORMAT_CFLAGS@ @AVCODEC_CFLAGS@ -DLOCALE_DIR=\"$(localedir)\" gmerlin_plugin_LTLIBRARIES = \ c_ffmpeg_ac3.la \ c_ffmpeg_alaw.la \ c_ffmpeg_ulaw.la \ c_ffmpeg_mpeg4.la \ c_ffmpeg_x264.la \ c_ffmpeg_mp2.la \ c_ffmpeg_jpeg.la \ c_ffmpeg_mpeg1.la \ c_ffmpeg_mpeg2.la \ c_ffmpeg_tga.la \ c_ffmpeg_vp8.la \ e_mpeg1video.la \ e_mpeg2video.la \ e_au.la \ e_aiff.la \ e_mp2.la \ e_ac3.la \ e_adts.la \ e_wma.la \ e_avi.la \ e_mpeg.la \ e_vob.la \ e_dvd.la \ e_asf.la \ e_mpegts.la \ e_matroska.la \ e_webm.la \ e_mp4.la common_sources = ffmpeg_common.c codecs.c codec.c codec_sources = codecs.c codec.c LIBS = @AVFORMAT_LIBS@ e_mpeg1video_la_SOURCES = e_mpeg1video.c $(common_sources) e_mpeg2video_la_SOURCES = e_mpeg2video.c $(common_sources) e_au_la_SOURCES = e_au.c $(common_sources) e_aiff_la_SOURCES = e_aiff.c $(common_sources) e_mp2_la_SOURCES = e_mp2.c $(common_sources) e_ac3_la_SOURCES = e_ac3.c $(common_sources) e_adts_la_SOURCES = e_adts.c $(common_sources) e_wma_la_SOURCES = e_wma.c $(common_sources) e_avi_la_SOURCES = e_avi.c $(common_sources) e_mpeg_la_SOURCES = e_mpeg.c $(common_sources) e_vob_la_SOURCES = e_vob.c $(common_sources) e_dvd_la_SOURCES = e_dvd.c $(common_sources) e_asf_la_SOURCES = e_asf.c $(common_sources) e_mpegts_la_SOURCES = e_mpegts.c $(common_sources) e_matroska_la_SOURCES = e_matroska.c $(common_sources) e_webm_la_SOURCES = e_webm.c $(common_sources) e_mp4_la_SOURCES = e_mp4.c $(common_sources) c_ffmpeg_mpeg4_la_SOURCES = c_ffmpeg_mpeg4.c $(common_sources) c_ffmpeg_x264_la_SOURCES = c_ffmpeg_x264.c $(common_sources) c_ffmpeg_mp2_la_SOURCES = c_ffmpeg_mp2.c $(common_sources) c_ffmpeg_ac3_la_SOURCES = c_ffmpeg_ac3.c $(common_sources) c_ffmpeg_alaw_la_SOURCES = c_ffmpeg_alaw.c $(common_sources) c_ffmpeg_ulaw_la_SOURCES = c_ffmpeg_ulaw.c $(common_sources) c_ffmpeg_jpeg_la_SOURCES = c_ffmpeg_jpeg.c $(common_sources) c_ffmpeg_mpeg1_la_SOURCES = c_ffmpeg_mpeg1.c $(common_sources) c_ffmpeg_mpeg2_la_SOURCES = c_ffmpeg_mpeg2.c $(common_sources) c_ffmpeg_tga_la_SOURCES = c_ffmpeg_tga.c $(common_sources) c_ffmpeg_vp8_la_SOURCES = c_ffmpeg_vp8.c $(common_sources) noinst_HEADERS = ffmpeg_common.h params.h EXTRA_DIST= _codec_plugin.c _e_ffmpeg_video.c _e_ffmpeg_audio.c _e_ffmpeg.c bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/_codec_plugin.c000066400000000000000000000070371513225514200243760ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ typedef struct { bg_ffmpeg_codec_context_t * codec; } stream_codec_t; static void * create_codec() { stream_codec_t * ret = calloc(1, sizeof(*ret)); ret->codec = bg_ffmpeg_codec_create( #ifdef IS_AUDIO AVMEDIA_TYPE_AUDIO, #else AVMEDIA_TYPE_VIDEO, #endif NULL, CODEC_ID, NULL); return ret; } static void destroy_codec(void * priv) { stream_codec_t * c = priv; if(c->codec) bg_ffmpeg_codec_destroy(c->codec); free(c); } #ifndef NO_PARAMS static const bg_parameter_info_t * get_parameters(void * priv) { stream_codec_t * c = priv; return bg_ffmpeg_codec_get_parameters(c->codec); } static void set_parameter(void * priv, const char * name, const gavl_value_t * val) { stream_codec_t * c = priv; bg_ffmpeg_codec_set_parameter(c->codec, name, val); } #endif #ifdef IS_AUDIO static gavl_audio_sink_t * open_audio(void * priv, gavl_dictionary_t * s) { stream_codec_t * c = priv; return bg_ffmpeg_codec_open_audio(c->codec, s); } #else static gavl_video_sink_t * open_video(void * priv, gavl_dictionary_t * s) { stream_codec_t * c = priv; return bg_ffmpeg_codec_open_video(c->codec, s); } #endif static void set_packet_sink(void * priv, gavl_packet_sink_t * s) { stream_codec_t * c = priv; bg_ffmpeg_codec_set_packet_sink(c->codec, s); } gavl_codec_id_t compressions[] = { COMPRESSION, GAVL_CODEC_ID_NONE }; static const gavl_codec_id_t * get_compressions(void * priv) { return compressions; } const bg_codec_plugin_t the_plugin = { .common = { BG_LOCALE, .name = CODEC_NAME, /* Unique short name */ .long_name = CODEC_LONG_NAME, .description = CODEC_DESC, #ifdef IS_AUDIO .type = BG_PLUGIN_COMPRESSOR_AUDIO, #else .type = BG_PLUGIN_COMPRESSOR_VIDEO, #endif .priority = 5, .create = create_codec, .destroy = destroy_codec, #ifndef NO_PARAMS .get_parameters = get_parameters, .set_parameter = set_parameter, #endif }, #ifdef IS_AUDIO .open_encode_audio = open_audio, #else .open_encode_video = open_video, #endif .set_packet_sink = set_packet_sink, .get_compressions = get_compressions, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/_e_ffmpeg.c000066400000000000000000000234321513225514200235100ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include "ffmpeg_common.h" #ifdef FORMAT_AVI #define NAME "avi" static const ffmpeg_format_info_t format = { .label = "AVI", .name = NAME, .extension = "avi", .max_audio_streams = 1, .max_video_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MP3, AV_CODEC_ID_MP2, AV_CODEC_ID_PCM_S16LE, AV_CODEC_ID_PCM_U8, AV_CODEC_ID_PCM_ALAW, AV_CODEC_ID_PCM_MULAW, AV_CODEC_ID_AC3, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MPEG4, AV_CODEC_ID_MSMPEG4V3, AV_CODEC_ID_MJPEG, AV_CODEC_ID_NONE }, .flags = FLAG_CONSTANT_FRAMERATE, }; #endif #ifdef FORMAT_MPEG #define NAME "mpeg" static const ffmpeg_format_info_t format = { .label = "MPEG-1", .name = NAME, .extension = "mpg", .max_audio_streams = -1, .max_video_streams = -1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MP2, AV_CODEC_ID_MP3, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_NONE }, .flags = FLAG_CONSTANT_FRAMERATE | FLAG_PIPE, }; #endif #ifdef FORMAT_VOB #define NAME "vob" static const ffmpeg_format_info_t format = { .label = "MPEG-2 (generic)", .name = NAME, .extension = "vob", .max_audio_streams = -1, .max_video_streams = -1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MP2, AV_CODEC_ID_MP3, AV_CODEC_ID_AC3, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_NONE }, .flags = FLAG_CONSTANT_FRAMERATE | FLAG_PIPE, }; #endif #ifdef FORMAT_DVD #define NAME "dvd" static const ffmpeg_format_info_t format = { .label = "MPEG-2 (dvd)", .name = "dvd", .extension = "vob", .max_audio_streams = -1, .max_video_streams = -1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MP2, AV_CODEC_ID_AC3, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_NONE }, .flags = FLAG_CONSTANT_FRAMERATE | FLAG_PIPE, }; #endif #ifdef FORMAT_ASF #define NAME "asf" static const ffmpeg_format_info_t format = { .label = "ASF", .name = NAME, .extension = "asf", .max_audio_streams = 1, .max_video_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_WMAV2, AV_CODEC_ID_WMAV1, AV_CODEC_ID_MP3, AV_CODEC_ID_MP2, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_WMV1, // AV_CODEC_ID_WMV2, /* Crash */ AV_CODEC_ID_NONE }, }; #endif #ifdef FORMAT_MPEGTS #define NAME "mpegts" static const ffmpeg_format_info_t format = { .label = "MPEG-2 Transport stream", .name = NAME, .extension = "ts", .max_audio_streams = 1, .max_video_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MP2, AV_CODEC_ID_MP3, AV_CODEC_ID_AC3, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_NONE }, .flags = FLAG_CONSTANT_FRAMERATE | FLAG_PIPE, }; #endif #ifdef FORMAT_MATROSKA #define NAME "matroska" static const ffmpeg_format_info_t format = { .label = "Matroska", .name = NAME, .extension = "mkv", .max_audio_streams = -1, .max_video_streams = -1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MP3, AV_CODEC_ID_MP2, AV_CODEC_ID_AC3, AV_CODEC_ID_VORBIS, AV_CODEC_ID_DTS, AV_CODEC_ID_AAC, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_H264, AV_CODEC_ID_MPEG4, AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_VP8, AV_CODEC_ID_MSMPEG4V3, AV_CODEC_ID_NONE }, }; #endif #ifdef FORMAT_WEBM #define NAME "webm" static const ffmpeg_format_info_t format = { .label = "Webm", .name = NAME, .extension = "webm", .max_audio_streams = -1, .max_video_streams = -1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_VORBIS, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_VP8, AV_CODEC_ID_NONE }, .flags = FLAG_PIPE, }; #endif #ifdef FORMAT_MP4 #define NAME "mp4" static const ffmpeg_format_info_t format = { .label = "MP4", .name = NAME, .extension = "mp4", .max_audio_streams = -1, .max_video_streams = -1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_AAC, AV_CODEC_ID_NONE }, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_H264, AV_CODEC_ID_MPEG4, AV_CODEC_ID_NONE }, }; #endif static void * create_ffmpeg() { return bg_ffmpeg_create(&format); } static const char * get_extensions_ffmpeg(void * data) { return format.extension; } const bg_encoder_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "e_" NAME, /* Unique short name */ .long_name = format.label, .description = TRS("Based on ffmpeg (http://www.ffmpeg.org)."), .type = BG_PLUGIN_ENCODER, .flags = BG_PLUGIN_FILE | BG_PLUGIN_PIPE, .priority = 5, .create = create_ffmpeg, .destroy = bg_ffmpeg_destroy, .get_parameters = bg_ffmpeg_get_parameters, .set_parameter = bg_ffmpeg_set_parameter, .get_extensions = get_extensions_ffmpeg, }, .max_audio_streams = -1, .max_video_streams = -1, .max_text_streams = -1, .get_audio_parameters = bg_ffmpeg_get_audio_parameters, .get_video_parameters = bg_ffmpeg_get_video_parameters, .set_callbacks = bg_ffmpeg_set_callbacks, .open = bg_ffmpeg_open, .open_io = bg_ffmpeg_open_io, .writes_compressed_audio = bg_ffmpeg_writes_compressed_audio, .writes_compressed_video = bg_ffmpeg_writes_compressed_video, .add_audio_stream = bg_ffmpeg_add_audio_stream, .add_video_stream = bg_ffmpeg_add_video_stream, .add_text_stream = bg_ffmpeg_add_text_stream, .add_audio_stream_compressed = bg_ffmpeg_add_audio_stream_compressed, .add_video_stream_compressed = bg_ffmpeg_add_video_stream_compressed, .set_video_pass = bg_ffmpeg_set_video_pass, .set_audio_parameter = bg_ffmpeg_set_audio_parameter, .set_video_parameter = bg_ffmpeg_set_video_parameter, .get_audio_sink = bg_ffmpeg_get_audio_sink, .get_audio_packet_sink = bg_ffmpeg_get_audio_packet_sink, .get_video_sink = bg_ffmpeg_get_video_sink, .get_video_packet_sink = bg_ffmpeg_get_video_packet_sink, .start = bg_ffmpeg_start, .get_text_sink = bg_ffmpeg_get_text_packet_sink, .close = bg_ffmpeg_close, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/_e_ffmpeg_audio.c000066400000000000000000000120131513225514200246620ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include "ffmpeg_common.h" #ifdef FORMAT_AU #define NAME "au" static const ffmpeg_format_info_t format = { .label = "SUN AU Format", .name = "au", .extension = "au", .max_audio_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_PCM_MULAW, AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_ALAW, AV_CODEC_ID_NONE }, }; #endif #ifdef FORMAT_AC3 #define NAME "ac3" static const ffmpeg_format_info_t format = { .label= "Raw AC3", .name = "ac3", .extension = "ac3", .max_audio_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_AC3, AV_CODEC_ID_NONE }, .flags = FLAG_PIPE, }; #endif #ifdef FORMAT_AIFF #define NAME "aiff" static const ffmpeg_format_info_t format = { .label= "AIFF", .name = "aiff", .extension = "aif", .max_audio_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S8, AV_CODEC_ID_PCM_ALAW, AV_CODEC_ID_PCM_MULAW, AV_CODEC_ID_NONE }, }; #endif #ifdef FORMAT_MP2 #define NAME "mp2" static const ffmpeg_format_info_t format = { .label= "MP2", .name = "mp2", .extension = "mp2", .max_audio_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MP2, AV_CODEC_ID_NONE }, .flags = FLAG_PIPE, }; #endif #ifdef FORMAT_WMA #define NAME "wma" static const ffmpeg_format_info_t format = { .label= "WMA", .name = NAME, .ffmpeg_name = "asf", .extension = "wma", .max_audio_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_WMAV2, AV_CODEC_ID_WMAV1, AV_CODEC_ID_NONE }, }; #endif #ifdef FORMAT_ADTS #define NAME "adts" static const ffmpeg_format_info_t format = { .label= "ADTS", .name = NAME, .extension = "aac", .max_audio_streams = 1, .audio_codecs = (enum AVCodecID[]){ AV_CODEC_ID_AAC, AV_CODEC_ID_NONE }, .flags = FLAG_PIPE, }; #endif static void * create_ffmpeg() { return bg_ffmpeg_create(&format); } static const char * get_extensions_ffmpeg(void * data) { return format.extension; } const bg_encoder_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "e_" NAME, /* Unique short name */ .long_name = format.label, .description = TRS("Based on ffmpeg (http://www.ffmpeg.org)."), .type = BG_PLUGIN_ENCODER_AUDIO, .flags = BG_PLUGIN_FILE | BG_PLUGIN_PIPE, .priority = 5, .create = create_ffmpeg, .destroy = bg_ffmpeg_destroy, .get_parameters = bg_ffmpeg_get_parameters, .set_parameter = bg_ffmpeg_set_parameter, .get_extensions = get_extensions_ffmpeg, }, .max_audio_streams = 1, .get_audio_parameters = bg_ffmpeg_get_audio_parameters, .set_callbacks = bg_ffmpeg_set_callbacks, .open = bg_ffmpeg_open, .open_io = bg_ffmpeg_open_io, .writes_compressed_audio = bg_ffmpeg_writes_compressed_audio, .add_audio_stream = bg_ffmpeg_add_audio_stream, .add_audio_stream_compressed = bg_ffmpeg_add_audio_stream_compressed, .set_audio_parameter = bg_ffmpeg_set_audio_parameter, .get_audio_sink = bg_ffmpeg_get_audio_sink, .get_audio_packet_sink = bg_ffmpeg_get_audio_packet_sink, .start = bg_ffmpeg_start, .close = bg_ffmpeg_close, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/_e_ffmpeg_video.c000066400000000000000000000065451513225514200247040ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include "ffmpeg_common.h" #ifdef FORMAT_MPEG1VIDEO #define NAME "mpeg1video" static const ffmpeg_format_info_t format = { .label = "MPEG-1 video", .name = NAME, .extension = "m1v", .max_video_streams = 1, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_NONE }, .flags = FLAG_CONSTANT_FRAMERATE | FLAG_PIPE, }; #endif #ifdef FORMAT_MPEG2VIDEO #define NAME "mpeg2video" static const ffmpeg_format_info_t format = { .label = "MPEG-2 video", .name = NAME, .extension = "m2v", .max_video_streams = 1, .video_codecs = (enum AVCodecID[]){ AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_NONE }, .flags = FLAG_CONSTANT_FRAMERATE | FLAG_PIPE, }; #endif static void * create_ffmpeg() { return bg_ffmpeg_create(&format); } static const char * get_extensions_ffmpeg(void * data) { return format.extension; } const bg_encoder_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "e_" NAME, /* Unique short name */ .long_name = format.label, .description = TRS("Based on ffmpeg (http://www.ffmpeg.org)"), .type = BG_PLUGIN_ENCODER_VIDEO, .flags = BG_PLUGIN_FILE | BG_PLUGIN_PIPE, .priority = 5, .create = create_ffmpeg, .destroy = bg_ffmpeg_destroy, .get_parameters = bg_ffmpeg_get_parameters, .set_parameter = bg_ffmpeg_set_parameter, .get_extensions = get_extensions_ffmpeg, }, .max_video_streams = 1, .get_video_parameters = bg_ffmpeg_get_video_parameters, .set_callbacks = bg_ffmpeg_set_callbacks, .open = bg_ffmpeg_open, .open_io = bg_ffmpeg_open_io, .add_video_stream = bg_ffmpeg_add_video_stream, .set_video_pass = bg_ffmpeg_set_video_pass, .set_video_parameter = bg_ffmpeg_set_video_parameter, .get_video_sink = bg_ffmpeg_get_video_sink, .get_video_packet_sink = bg_ffmpeg_get_video_packet_sink, .start = bg_ffmpeg_start, .close = bg_ffmpeg_close, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_ac3.c000066400000000000000000000024161513225514200240740ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_ac3" #define CODEC_LONG_NAME TRS("AC3") #define CODEC_ID AV_CODEC_ID_AC3 #define COMPRESSION GAVL_CODEC_ID_AC3 #define CODEC_DESC TRS("libavcodec AC3 encoder") #define IS_AUDIO #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_alaw.c000066400000000000000000000024511513225514200243510ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_alaw" #define CODEC_LONG_NAME TRS("alaw") #define CODEC_ID AV_CODEC_ID_PCM_ALAW #define COMPRESSION GAVL_CODEC_ID_ALAW #define CODEC_DESC TRS("libavcodec alaw encoder") #define IS_AUDIO #define NO_PARAMS #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_jpeg.c000066400000000000000000000024041513225514200243500ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_jpeg" #define CODEC_LONG_NAME TRS("JPEG") #define CODEC_ID AV_CODEC_ID_MJPEG #define COMPRESSION GAVL_CODEC_ID_JPEG #define CODEC_DESC TRS("libavcodec JPEG encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_mp2.c000066400000000000000000000024171513225514200241250ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_mp2" #define CODEC_LONG_NAME TRS("mp2") #define CODEC_ID AV_CODEC_ID_MP2 #define COMPRESSION GAVL_CODEC_ID_MP2 #define CODEC_DESC TRS("libavcodec mp2 encoder") #define IS_AUDIO #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_mpeg1.c000066400000000000000000000024171513225514200244400ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_mpeg1" #define CODEC_LONG_NAME TRS("MPEG-1") #define CODEC_ID AV_CODEC_ID_MPEG1VIDEO #define COMPRESSION GAVL_CODEC_ID_MPEG1 #define CODEC_DESC TRS("libavcodec MPEG-1 encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_mpeg2.c000066400000000000000000000024171513225514200244410ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_mpeg2" #define CODEC_LONG_NAME TRS("MPEG-2") #define CODEC_ID AV_CODEC_ID_MPEG2VIDEO #define COMPRESSION GAVL_CODEC_ID_MPEG2 #define CODEC_DESC TRS("libavcodec MPEG-2 encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_mpeg4.c000066400000000000000000000024161513225514200244420ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_mpeg4" #define CODEC_LONG_NAME TRS("MPEG-4") #define CODEC_ID AV_CODEC_ID_MPEG4 #define COMPRESSION GAVL_CODEC_ID_MPEG4_ASP #define CODEC_DESC TRS("libavcodec MPEG-4 encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_tga.c000066400000000000000000000024041513225514200241760ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_tga" #define CODEC_LONG_NAME TRS("Targa") #define CODEC_ID AV_CODEC_ID_TARGA #define COMPRESSION GAVL_CODEC_ID_TGA #define CODEC_DESC TRS("libavcodec Targa encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_ulaw.c000066400000000000000000000024531513225514200243770ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_ulaw" #define CODEC_LONG_NAME TRS("ulaw") #define CODEC_ID AV_CODEC_ID_PCM_MULAW #define COMPRESSION GAVL_CODEC_ID_ULAW #define CODEC_DESC TRS("libavcodec ulaw encoder") #define IS_AUDIO #define NO_PARAMS #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_vp8.c000066400000000000000000000024201513225514200241360ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_vp8" #define CODEC_LONG_NAME TRS("VP8") #define CODEC_ID AV_CODEC_ID_VP8 #define COMPRESSION GAVL_CODEC_ID_VP8 #define CODEC_DESC TRS("libavcodec VP8 encoder (based on libvpx)") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/c_ffmpeg_x264.c000066400000000000000000000024051513225514200241270ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ffmpeg_common.h" #define CODEC_NAME "c_ffmpeg_x264" #define CODEC_LONG_NAME TRS("H.264") #define CODEC_ID AV_CODEC_ID_H264 #define COMPRESSION GAVL_CODEC_ID_H264 #define CODEC_DESC TRS("libavcodec H.264 encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/codec.c000066400000000000000000000712621513225514200226620ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include "ffmpeg_common.h" #include #include #include #include #define LOG_DOMAIN "ffmpeg_encoder" #include #include /* * Standalone codecs */ #define FLAG_INITIALIZED (1<<0) #define FLAG_ERROR (1<<1) #define FLAG_FLUSHED (1<<2) #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(61, 13, 100) /* New API */ #define NEW_CONFIG_TYPES_API #else /* Alte API - verwende codec->ch_layouts etc. direkt */ #endif static void get_pixelformat_converter(bg_ffmpeg_codec_context_t * ctx, enum AVPixelFormat fmt, int do_convert); #if 0 static void dump_options(AVCodecContext * avctx) { const AVOption * opt = 0; fprintf(stderr, "Codec options\n"); while((opt = av_opt_next(avctx, opt))) { fprintf(stderr, " Name: %s\n", opt->name); } } #endif static int find_encoder(bg_ffmpeg_codec_context_t * ctx) { if(ctx->id == AV_CODEC_ID_NONE) return 0; if(ctx->codec) return 1; if(!(ctx->codec = avcodec_find_encoder(ctx->id))) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Codec %s not available in your libavcodec installation", bg_ffmpeg_get_codec_name(ctx->id)); return 0; } return 1; } /* * Create a codec context. * If avctx is NULL, it will be created and destroyed. * If id is AV_CODEC_ID_NONE, a "codec" parameter will be supported */ bg_ffmpeg_codec_context_t * bg_ffmpeg_codec_create(int type, AVCodecParameters * params, enum AVCodecID id, const ffmpeg_format_info_t * format) { bg_ffmpeg_codec_context_t * ret; // avcodec_register_all(); ret = calloc(1, sizeof(*ret)); ret->format = format; ret->id = id; ret->type = type; if(!find_encoder(ret)) goto fail; if(!(ret->avctx = avcodec_alloc_context3(ret->codec))) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Context for Codec %s could not be initialized", bg_ffmpeg_get_codec_name(ret->id)); goto fail; } /* Get codec context from format context */ if(params) avcodec_parameters_to_context(ret->avctx, params); ret->avctx->codec_id = ret->id; ret->avctx->codec_type = type; ret->frame = av_frame_alloc(); ret->pkt = av_packet_alloc(); return ret; fail: if(ret->avctx) avcodec_free_context(&ret->avctx); free(ret); return NULL; } const bg_parameter_info_t * bg_ffmpeg_codec_get_parameters(bg_ffmpeg_codec_context_t * ctx) { if(!ctx) return NULL; return bg_ffmpeg_get_codec_parameters(ctx->id, ctx->type); } static void apply_func(void * priv, const char * name, const gavl_value_t * val) { bg_ffmpeg_codec_context_t * ctx; if(!name || !strcmp(name, BG_CFG_TAG_NAME)) return; ctx = priv; bg_ffmpeg_set_codec_parameter(ctx->avctx, &ctx->options, name, val); } void bg_ffmpeg_codec_set_parameter(bg_ffmpeg_codec_context_t * ctx, const char * name, const gavl_value_t * v) { if(!name) return; if(!strcmp(name, "codec")) { const char * name; const gavl_dictionary_t * codec = gavl_value_get_dictionary(v); name = gavl_dictionary_get_string(codec, BG_CFG_TAG_NAME); if(ctx->type == AVMEDIA_TYPE_VIDEO) ctx->id = bg_ffmpeg_find_video_encoder(ctx->format, name); else ctx->id = bg_ffmpeg_find_audio_encoder(ctx->format, name); if(ctx->id == AV_CODEC_ID_NONE) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Codec %s is not available in libavcodec or not supported in the container", v->v.str); return; } find_encoder(ctx); bg_cfg_section_apply(codec, NULL, apply_func, ctx); } else if(bg_encoder_set_framerate_parameter(&ctx->fr, name, v)) return; } static int set_compression_info(bg_ffmpeg_codec_context_t * ctx, gavl_dictionary_t * s, const ffmpeg_codec_info_t * info) { gavl_compression_info_t ci; gavl_compression_info_init(&ci); /* Set up compression info */ if((ci.id = bg_codec_id_ffmpeg_2_gavl(ctx->codec->id))) ci.id = GAVL_CODEC_ID_EXTENDED; /* Extract extradata */ if(ctx->avctx->extradata_size) { gavl_buffer_append_data(&ci.codec_header, ctx->avctx->extradata, ctx->avctx->extradata_size); gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Got extradata: %d bytes", ctx->avctx->extradata_size); } switch(ctx->avctx->codec_id) { case AV_CODEC_ID_WMAV1: case AV_CODEC_ID_WMAV2: ci.block_align = ctx->avctx->block_align; case AV_CODEC_ID_MP2: case AV_CODEC_ID_AC3: ci.bitrate = ctx->avctx->bit_rate; break; default: break; } if(ctx->avctx->codec_type == AVMEDIA_TYPE_AUDIO) { ci.pre_skip = ctx->avctx->delay; } else if(ctx->avctx->codec_type == AVMEDIA_TYPE_VIDEO) { if(!(info->flags & FLAG_INTRA_ONLY)) { if((ctx->avctx->gop_size > 1) || (ctx->avctx->gop_size < 0)) { ci.flags |= GAVL_COMPRESSION_HAS_P_FRAMES; } if((info->flags & FLAG_B_FRAMES) && ((ctx->avctx->max_b_frames > 0) || ctx->avctx->has_b_frames)) ci.flags |= GAVL_COMPRESSION_HAS_B_FRAMES | GAVL_COMPRESSION_HAS_P_FRAMES; } } gavl_stream_set_compression_info(s, &ci); gavl_compression_info_free(&ci); gavl_dictionary_set_string(gavl_stream_get_metadata_nc(s), GAVL_META_SOFTWARE, LIBAVCODEC_IDENT); return 1; } /* * Audio */ static int flush_audio(bg_ffmpeg_codec_context_t * ctx) { AVFrame * f; int result; gavl_packet_reset(&ctx->gp); ctx->pkt->data = ctx->gp.buf.buf; ctx->pkt->size = ctx->gp.buf.alloc; if(ctx->aframe->valid_samples) { /* * Pad with silent samples if the codec strictly requires fixed frame sizes. * The remainig samples should be zero from the last call to gavl_audio_frame_mute() */ if((ctx->avctx->frame_size > 0) && (ctx->aframe->valid_samples < ctx->avctx->frame_size) && !(ctx->codec->capabilities & (AV_CODEC_CAP_SMALL_LAST_FRAME | AV_CODEC_CAP_VARIABLE_FRAME_SIZE))) ctx->aframe->valid_samples = ctx->avctx->frame_size; ctx->frame->nb_samples = ctx->aframe->valid_samples; ctx->frame->pts = ctx->in_pts; ctx->in_pts += ctx->aframe->valid_samples; f = ctx->frame; } else { if(ctx->codec->capabilities & AV_CODEC_CAP_DELAY) f = NULL; else return 0; } if((result = avcodec_send_frame(ctx->avctx, f)) < 0) { char str[AV_ERROR_MAX_STRING_SIZE]; if(result != AVERROR_EOF) { av_strerror(result, str, AV_ERROR_MAX_STRING_SIZE); gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "avcodec_send_frame failed: %s", str); ctx->flags |= FLAG_ERROR; return -1; } } /* Mute frame */ gavl_audio_frame_mute(ctx->aframe, &ctx->afmt); ctx->aframe->valid_samples = 0; while(1) { result = avcodec_receive_packet(ctx->avctx, ctx->pkt); if(result == AVERROR(EAGAIN)) break; if(result == AVERROR_EOF) return 0; else if(result) { /* Fail */ return 0; } ctx->gp.pts = ctx->pkt->pts; ctx->gp.duration = ctx->pkt->duration; // fprintf(stderr, "Samples written: %ld\n", ctx->samples_written); /* Last frame can be smaller */ if(ctx->gp.pts + ctx->gp.duration > ctx->in_pts) ctx->gp.duration = ctx->in_pts - ctx->gp.pts; ctx->out_pts += ctx->gp.duration; ctx->gp.flags |= GAVL_PACKET_KEYFRAME; ctx->gp.buf.len = ctx->pkt->size; ctx->gp.buf.buf = ctx->pkt->data; // fprintf(stderr, "Put audio packet\n"); // gavl_packet_dump(&ctx->gp); if(gavl_packet_sink_put_packet(ctx->psink, &ctx->gp) != GAVL_SINK_OK) ctx->flags |= FLAG_ERROR; } return 1; } static gavl_sink_status_t write_audio_func(void * data, gavl_audio_frame_t * frame) { int samples_written = 0; int samples_copied; bg_ffmpeg_codec_context_t * ctx = data; if(ctx->in_pts == GAVL_TIME_UNDEFINED) { ctx->in_pts = frame->timestamp; ctx->out_pts = ctx->in_pts - ctx->avctx->delay; } while(samples_written < frame->valid_samples) { samples_copied = gavl_audio_frame_copy(&ctx->afmt, ctx->aframe, // dst frame frame, // src frame ctx->aframe->valid_samples, // dst_pos samples_written, // src_pos, ctx->afmt.samples_per_frame - ctx->aframe->valid_samples, // dst_size, frame->valid_samples - samples_written); ctx->aframe->valid_samples += samples_copied; if(ctx->aframe->valid_samples == ctx->afmt.samples_per_frame) { flush_audio(ctx); if(ctx->flags & FLAG_ERROR) return GAVL_SINK_ERROR; } samples_written += samples_copied; } return GAVL_SINK_OK; } #if 0 static gavl_audio_frame_t * get_audio_frame_func(void * data) { bg_ffmpeg_codec_context_t * ctx = data; return ctx->aframe; } #endif static int try_channel_layout(const AVChannelLayout * ch_layout, const AVCodec * codec) { int i = 0; const AVChannelLayout * ch_layouts; #ifdef NEW_CONFIG_TYPES_API int ret; ret = avcodec_get_supported_config(NULL, codec, AV_CODEC_CONFIG_CHANNEL_LAYOUT, 0, (const void **)&ch_layouts, NULL); if(ret < 0) return 0; #else ch_layouts = codec->ch_layouts; #endif if(!ch_layouts) return 1; // Accept everything while(ch_layouts[i].nb_channels) { if((ch_layouts[i].nb_channels == ch_layout->nb_channels) && (ch_layouts[i].order == AV_CHANNEL_ORDER_NATIVE) && (ch_layouts[i].u.mask == ch_layout->u.mask)) return 1; i++; } return 0; } int bg_ffmpeg_set_audio_format_avctx(AVCodecContext * ctx, const AVCodec * codec, gavl_audio_format_t * fmt) { /* Set format for codec */ ctx->sample_rate = fmt->samplerate; ctx->time_base.den = fmt->samplerate; ctx->time_base.num = 1; ctx->ch_layout.order = AV_CHANNEL_ORDER_NATIVE; ctx->ch_layout.nb_channels = fmt->num_channels; ctx->ch_layout.u.mask = bg_ffmpeg_get_channel_mask(fmt); if(!try_channel_layout(&ctx->ch_layout, codec)) { /* Try stereo */ fmt->num_channels = 2; fmt->channel_locations[0] = GAVL_CHID_NONE; gavl_set_channel_setup(fmt); ctx->ch_layout.nb_channels = 2; ctx->ch_layout.u.mask = AV_CH_LAYOUT_STEREO; if(!try_channel_layout(&ctx->ch_layout, codec)) { /* Try mono */ fmt->num_channels = 1; fmt->channel_locations[0] = GAVL_CHID_NONE; gavl_set_channel_setup(fmt); ctx->ch_layout.nb_channels = 1; ctx->ch_layout.u.mask = AV_CH_LAYOUT_MONO; if(!try_channel_layout(&ctx->ch_layout, codec)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "No suitable channel layout found"); return 0; } } } return 1; } void bg_ffmpeg_set_audio_format_params(AVCodecParameters * avctx, gavl_audio_format_t * fmt) { /* Set format for codec */ avctx->sample_rate = fmt->samplerate; /* Channel setup */ avctx->ch_layout.order = AV_CHANNEL_ORDER_NATIVE; avctx->ch_layout.nb_channels = fmt->num_channels; avctx->ch_layout.u.mask = bg_ffmpeg_get_channel_mask(fmt); avctx->frame_size = fmt->samples_per_frame; } gavl_audio_sink_t * bg_ffmpeg_codec_open_audio(bg_ffmpeg_codec_context_t * ctx, gavl_dictionary_t * s) { // const AVOutputFormat * ofmt; // if(!find_encoder(ctx)) // return NULL; gavl_audio_format_t * fmt = gavl_stream_get_audio_format_nc(s); #ifdef NEW_CONFIG_TYPES_API const enum AVSampleFormat *sample_fmts; int ret; #endif /* Set format for codec */ if(!ctx->codec) return NULL; if(!bg_ffmpeg_set_audio_format_avctx(ctx->avctx, ctx->codec, fmt)) return NULL; /* Sample format */ #ifdef NEW_CONFIG_TYPES_API ret = avcodec_get_supported_config(ctx->avctx, NULL, AV_CODEC_CONFIG_CHANNEL_LAYOUT, 0, (const void **)&sample_fmts, NULL); if(ret < 0) return NULL; #else ctx->avctx->sample_fmt = ctx->codec->sample_fmts[0]; #endif fmt->sample_format = bg_sample_format_ffmpeg_2_gavl(ctx->avctx->sample_fmt, &fmt->interleave_mode); /* Set codec specific stuff */ switch(ctx->avctx->codec_id) { case AV_CODEC_ID_PCM_S16BE: case AV_CODEC_ID_PCM_S16LE: ctx->avctx->bit_rate = ctx->afmt.samplerate * ctx->afmt.num_channels * 16; break; case AV_CODEC_ID_PCM_S8: case AV_CODEC_ID_PCM_U8: case AV_CODEC_ID_PCM_ALAW: case AV_CODEC_ID_PCM_MULAW: ctx->avctx->bit_rate = ctx->afmt.samplerate * ctx->afmt.num_channels * 8; break; case AV_CODEC_ID_AAC: case AV_CODEC_ID_VORBIS: if(!ctx->avctx->bit_rate) ctx->avctx->flags |= AV_CODEC_FLAG_QSCALE; break; default: break; } /* Decide whether we need a global header */ #if 0 if(!ctx->format || ((ofmt = bg_ffmpeg_guess_format(ctx->format)) && (ofmt->flags & AVFMT_GLOBALHEADER))) #endif ctx->avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; /* Open encoder */ if(avcodec_open2(ctx->avctx, ctx->codec, &ctx->options) < 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "avcodec_open2 failed for audio"); return NULL; } // dump_options(ctx->avctx); if(ctx->avctx->frame_size <= 1) fmt->samples_per_frame = 1024; // Frame size for uncompressed codecs else fmt->samples_per_frame = ctx->avctx->frame_size; ctx->aframe = gavl_audio_frame_create(NULL); /* Allocate AVFrame */ if(fmt->interleave_mode == GAVL_INTERLEAVE_ALL) { ctx->frame->extended_data = ctx->frame->data; ctx->frame->linesize[0] = gavl_bytes_per_sample(fmt->sample_format) * fmt->samples_per_frame * fmt->num_channels; ctx->frame->buf[0] = av_buffer_alloc(ctx->frame->linesize[0]); ctx->frame->data[0] = ctx->frame->buf[0]->data; ctx->aframe->samples.u_8 = ctx->frame->extended_data[0]; } else { int i; ctx->frame->linesize[0] = gavl_bytes_per_sample(fmt->sample_format) * fmt->samples_per_frame; if(fmt->num_channels > AV_NUM_DATA_POINTERS) { ctx->frame->extended_data = av_mallocz(fmt->num_channels * sizeof(*ctx->frame->extended_data)); ctx->frame->extended_buf = av_mallocz((fmt->num_channels-AV_NUM_DATA_POINTERS)* sizeof(*ctx->frame->extended_buf)); for(i = 0; i < AV_NUM_DATA_POINTERS; i++) { ctx->frame->buf[i] = av_buffer_alloc(ctx->frame->linesize[0]); ctx->frame->extended_data[i] = ctx->frame->buf[i]->data; } for(i = 0; i < fmt->num_channels - AV_NUM_DATA_POINTERS; i++) { ctx->frame->extended_buf[i] = av_buffer_alloc(ctx->frame->linesize[0]); ctx->frame->extended_data[i + AV_NUM_DATA_POINTERS] = ctx->frame->extended_buf[i]->data; } ctx->frame->nb_extended_buf = fmt->num_channels - AV_NUM_DATA_POINTERS; } else { ctx->frame->extended_data = ctx->frame->data; for(i = 0; i < fmt->num_channels; i++) { ctx->frame->buf[i] = av_buffer_alloc(ctx->frame->linesize[0]); ctx->frame->extended_data[i] = ctx->frame->buf[i]->data; } } for(i = 0; i < fmt->num_channels; i++) ctx->aframe->channels.u_8[i] = ctx->frame->extended_data[i]; } /* Mute frame */ gavl_audio_frame_mute(ctx->aframe, fmt); ctx->aframe->valid_samples = 0; ctx->asink = gavl_audio_sink_create(NULL, write_audio_func, ctx, fmt); /* Copy format for later use */ gavl_audio_format_copy(&ctx->afmt, fmt); set_compression_info(ctx, s, NULL); ctx->in_pts = GAVL_TIME_UNDEFINED; ctx->out_pts = GAVL_TIME_UNDEFINED; ctx->flags |= FLAG_INITIALIZED; return ctx->asink; } /* * Video */ int bg_ffmpeg_codec_set_video_pass(bg_ffmpeg_codec_context_t * ctx, int pass, int total_passes, const char * stats_filename) { ctx->pass = pass; ctx->total_passes = total_passes; ctx->stats_filename = gavl_strrep(ctx->stats_filename, stats_filename); return 1; } static int flush_video(bg_ffmpeg_codec_context_t * ctx, AVFrame * frame) { int result; if((result = avcodec_send_frame(ctx->avctx, frame)) < 0) { if(result != AVERROR_EOF) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "avcodec_send_frame failed"); ctx->flags |= FLAG_ERROR; return 0; } } while(1) { result = avcodec_receive_packet(ctx->avctx, ctx->pkt); if((result == AVERROR(EAGAIN)) || (result == AVERROR_EOF)) break; else if(result) { /* Fail */ return 0; } /* Got packet */ gavl_packet_reset(&ctx->gp); ctx->gp.pts = ctx->pkt->pts; ctx->gp.dts = ctx->pkt->dts; #if 0 ctx->gp.duration = ctx->pkt->duration; ctx->gp.dts = ctx->pkt->dts; fprintf(stderr, "PTS: %"PRId64" DTS: %"PRId64" DUR: %"PRId64"\n", ctx->gp.pts, ctx->gp.dts, ctx->gp.duration); #endif if(ctx->pkt->flags & AV_PKT_FLAG_KEY) ctx->gp.flags |= GAVL_PACKET_KEYFRAME; ctx->gp.buf.len = ctx->pkt->size; ctx->gp.buf.buf = ctx->pkt->data; if(ctx->vfmt.framerate_mode == GAVL_FRAMERATE_CONSTANT) { ctx->gp.pts *= ctx->vfmt.frame_duration; ctx->gp.dts *= ctx->vfmt.frame_duration; } /* Detect VP8 alternate reference frames */ if((ctx->id == AV_CODEC_ID_VP8) && !(ctx->gp.buf.buf[0] & 0x10)) { ctx->gp.flags |= GAVL_PACKET_NOOUTPUT; gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Got alterate reference frame %"PRId64, ctx->gp.pts); } else { /* Decide frame type */ if(ctx->gp.pts < ctx->out_pts) ctx->gp.flags |= GAVL_PACKET_TYPE_B; else { if(ctx->gp.flags & GAVL_PACKET_KEYFRAME) ctx->gp.flags |= GAVL_PACKET_TYPE_I; else ctx->gp.flags |= GAVL_PACKET_TYPE_P; ctx->out_pts = ctx->gp.pts; } if(!bg_encoder_pts_cache_pop_packet(ctx->pc, &ctx->gp, -1, ctx->gp.pts)) { ctx->flags |= FLAG_ERROR; gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Got no packet in cache for pts %"PRId64, ctx->gp.pts); // fprintf(stderr, "Got no packet in cache for pts %"PRId64"\n", ctx->gp.pts); } // else // fprintf(stderr, "pop packet: %"PRId64"\n", ctx->gp.pts); } /* Write frame */ // fprintf(stderr, "Put video packet\n"); // gavl_packet_dump(&ctx->gp); if(gavl_packet_sink_put_packet(ctx->psink, &ctx->gp) != GAVL_SINK_OK) { ctx->flags |= FLAG_ERROR; gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Writing packet failed"); } /* Write stats */ if((ctx->pass == 1) && ctx->avctx->stats_out && ctx->stats_file) fprintf(ctx->stats_file, "%s", ctx->avctx->stats_out); ctx->gp.buf.buf = NULL; } return 1; } static gavl_sink_status_t write_video_func(void * data, gavl_video_frame_t * frame) { bg_ffmpeg_codec_context_t * ctx = data; if(!bg_encoder_pts_cache_push_frame(ctx->pc, frame)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "PTS cache full"); return GAVL_SINK_ERROR; } // fprintf(stderr, "push frame: %"PRId64"\n", frame->timestamp); if(ctx->convert_frame) ctx->convert_frame(ctx, frame); ctx->frame->pts = frame->timestamp; if(ctx->vfmt.framerate_mode == GAVL_FRAMERATE_CONSTANT) ctx->frame->pts /= ctx->vfmt.frame_duration; ctx->frame->data[0] = frame->planes[0]; ctx->frame->data[1] = frame->planes[1]; ctx->frame->data[2] = frame->planes[2]; ctx->frame->linesize[0] = frame->strides[0]; ctx->frame->linesize[1] = frame->strides[1]; ctx->frame->linesize[2] = frame->strides[2]; // ctx->frame->width = ctx->vfmt.image_width; // ctx->frame->height = ctx->vfmt.image_height; flush_video(ctx, ctx->frame); if(ctx->flags & FLAG_ERROR) return GAVL_SINK_ERROR; return GAVL_SINK_OK; } static gavl_video_frame_t * get_video_func(void * data) { bg_ffmpeg_codec_context_t * ctx = data; return ctx->vframe; } void bg_ffmpeg_set_video_dimensions_avctx(AVCodecContext * avctx, const gavl_video_format_t * fmt) { avctx->width = fmt->image_width; avctx->height = fmt->image_height; avctx->sample_aspect_ratio.num = fmt->pixel_width; avctx->sample_aspect_ratio.den = fmt->pixel_height; } void bg_ffmpeg_set_video_dimensions_params(AVCodecParameters * avctx, const gavl_video_format_t * fmt) { avctx->width = fmt->image_width; avctx->height = fmt->image_height; avctx->sample_aspect_ratio.num = fmt->pixel_width; avctx->sample_aspect_ratio.den = fmt->pixel_height; } gavl_video_sink_t * bg_ffmpeg_codec_open_video(bg_ffmpeg_codec_context_t * ctx, gavl_dictionary_t * s) { int do_convert = 0; const ffmpeg_codec_info_t * info; gavl_video_sink_get_func get_func = NULL; const AVOutputFormat * ofmt; gavl_video_format_t * fmt; // if(!find_encoder(ctx)) // return NULL; #ifdef NEW_CONFIG_TYPES_API const enum AVPixelFormat *pix_fmts; int ret; #endif fmt = gavl_stream_get_video_format_nc(s); if(!ctx->codec) return NULL; info = bg_ffmpeg_get_codec_info(ctx->id, AVMEDIA_TYPE_VIDEO); /* Set format for codec */ bg_ffmpeg_set_video_dimensions_avctx(ctx->avctx, fmt); ctx->avctx->codec_type = AVMEDIA_TYPE_VIDEO; ctx->avctx->codec_id = ctx->id; #ifdef NEW_CONFIG_TYPES_API ret = avcodec_get_supported_config(ctx->avctx, NULL, AV_CODEC_CONFIG_PIX_FORMAT, 0, (const void **)&pix_fmts, NULL); if(ret < 0) return NULL; bg_ffmpeg_choose_pixelformat(pix_fmts, &ctx->avctx->pix_fmt, &fmt->pixelformat, &do_convert); #else bg_ffmpeg_choose_pixelformat(ctx->codec->pix_fmts, &ctx->avctx->pix_fmt, &fmt->pixelformat, &do_convert); #endif /* Framerate */ if(info->flags & FLAG_CONSTANT_FRAMERATE || (ctx->format && (ctx->format->flags & FLAG_CONSTANT_FRAMERATE))) { if(info->framerates) bg_encoder_set_framerate_nearest(&ctx->fr, info->framerates, fmt); else bg_encoder_set_framerate(&ctx->fr, fmt); } if(fmt->framerate_mode == GAVL_FRAMERATE_CONSTANT) { ctx->avctx->time_base.den = fmt->timescale; ctx->avctx->time_base.num = fmt->frame_duration; } else { ctx->avctx->time_base.den = fmt->timescale; ctx->avctx->time_base.num = 1; } /* Set up multipass encoding */ if(ctx->total_passes) { int stats_len; if(ctx->pass == 1) { ctx->stats_file = fopen(ctx->stats_filename, "w"); ctx->avctx->flags |= AV_CODEC_FLAG_PASS1; } else if(ctx->pass == ctx->total_passes) { ctx->stats_file = fopen(ctx->stats_filename, "r"); fseek(ctx->stats_file, 0, SEEK_END); stats_len = ftell(ctx->stats_file); fseek(ctx->stats_file, 0, SEEK_SET); ctx->avctx->stats_in = av_malloc(stats_len + 1); if(fread(ctx->avctx->stats_in, 1, stats_len, ctx->stats_file) < stats_len) { av_free(ctx->avctx->stats_in); ctx->avctx->stats_in = NULL; } else ctx->avctx->stats_in[stats_len] = '\0'; fclose(ctx->stats_file); ctx->stats_file = NULL; ctx->avctx->flags |= AV_CODEC_FLAG_PASS2; } } /* Decide whether we need a global header */ if(!ctx->format || ((ofmt = bg_ffmpeg_guess_format(ctx->format)) && (ofmt->flags & AVFMT_GLOBALHEADER))) ctx->avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; if(avcodec_open2(ctx->avctx, ctx->codec, &ctx->options) < 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "avcodec_open2 failed for video"); return NULL; } ctx->pc = bg_encoder_pts_cache_create(); gavl_video_format_copy(&ctx->vfmt, fmt); /* Create temporary frame if necessary */ if(do_convert) { fprintf(stderr, "Need colorspace conversion\n"); ctx->vframe = gavl_video_frame_create(&ctx->vfmt); get_func = get_video_func; get_pixelformat_converter(ctx, ctx->avctx->pix_fmt, do_convert); } ctx->vsink = gavl_video_sink_create(get_func, write_video_func, ctx, &ctx->vfmt); /* Set up compression info */ set_compression_info(ctx, s, info); ctx->frame->width = ctx->vfmt.image_width; ctx->frame->height = ctx->vfmt.image_height; ctx->frame->format = ctx->avctx->pix_fmt; ctx->flags |= FLAG_INITIALIZED; return ctx->vsink; } void bg_ffmpeg_codec_set_packet_sink(bg_ffmpeg_codec_context_t * ctx, gavl_packet_sink_t * psink) { ctx->psink = psink; } void bg_ffmpeg_codec_flush(bg_ffmpeg_codec_context_t * ctx) { int result; /* Flush */ if(!(ctx->flags & FLAG_INITIALIZED)) return; if(ctx->type == AVMEDIA_TYPE_VIDEO) flush_video(ctx, NULL); else // Audio { while(1) { // fprintf(stderr, "Flush audio %d\n", ctx->aframe->valid_samples); result = flush_audio(ctx); if(result <= 0) break; } } ctx->flags |= FLAG_FLUSHED; } void bg_ffmpeg_codec_destroy(bg_ffmpeg_codec_context_t * ctx) { if(!(ctx->flags & FLAG_FLUSHED)) bg_ffmpeg_codec_flush(ctx); /* Destroy */ if(ctx->avctx) avcodec_free_context(&ctx->avctx); if(ctx->pc) bg_encoder_pts_cache_destroy(ctx->pc); if(ctx->aframe) { gavl_audio_frame_null(ctx->aframe); gavl_audio_frame_destroy(ctx->aframe); } if(ctx->vframe) gavl_video_frame_destroy(ctx->vframe); if(ctx->asink) gavl_audio_sink_destroy(ctx->asink); if(ctx->vsink) gavl_video_sink_destroy(ctx->vsink); if(ctx->frame->extended_data != ctx->frame->data) av_freep(&ctx->frame->extended_data); if(ctx->frame) av_frame_free(&ctx->frame); if(ctx->pkt) av_packet_free(&ctx->pkt); if(ctx->stats_filename) free(ctx->stats_filename); if(ctx->stats_file) fclose(ctx->stats_file); /* Prevent the buffer from being free()d */ gavl_buffer_init(&ctx->gp.buf); gavl_packet_free(&ctx->gp); free(ctx); } /* * Pixelformat conversion stuff */ static void convert_frame_bgra(bg_ffmpeg_codec_context_t * ctx, gavl_video_frame_t * f) { int i, j; uint8_t * ptr; uint8_t swp; for(i = 0; i < ctx->vfmt.image_height; i++) { ptr = f->planes[0] + i * f->strides[0]; for(j = 0; j < ctx->vfmt.image_width; j++) { /* RGBA -> BGRA */ swp = ptr[0]; ptr[0] = ptr[2]; ptr[2] = swp; ptr += 4; } } } static void get_pixelformat_converter(bg_ffmpeg_codec_context_t * ctx, enum AVPixelFormat fmt, int do_convert) { if(do_convert & CONVERT_OTHER) { if(fmt == AV_PIX_FMT_BGRA) { ctx->convert_frame = convert_frame_bgra; } } } bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/codecs.c000066400000000000000000001420311513225514200230360ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include "ffmpeg_common.h" #include "params.h" #include #include #include #include #include #define LOG_DOMAIN "ffmpeg.codecs" #define ENCODE_PARAM_MP2 \ { \ .name = "ff_bit_rate_str", \ .long_name = TRS("Bit rate (kbps)"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("128"), \ .multi_names = (char const *[]){ "32", "48", "56", "64", "80", "96", "112", \ "128", "160", "192", "224", "256", "320", "384",\ NULL } \ }, #define ENCODE_PARAM_MP3 \ { \ .name = "ff_bit_rate_str", \ .long_name = TRS("Bit rate (kbps)"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("128"), \ .multi_names = (char const *[]){ "32", "40", "48", "56", "64", "80", "96", \ "112", "128", "160", "192", "224", "256", "320",\ NULL } \ }, #define ENCODE_PARAM_AC3 \ { \ .name = "ff_bit_rate_str", \ .long_name = TRS("Bit rate (kbps)"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("128"), \ .multi_names = (char const *[]){ "32", "40", "48", "56", "64", "80", "96", "112", "128", \ "160", "192", "224", "256", "320", "384", "448", "512", \ "576", "640", NULL } \ }, /* * bit_rate can also be set to 1 (open), 2 (variable), 3 (lossless) */ #define ENCODE_PARAM_DTS \ { \ .name = "ff_bit_rate_str", \ .long_name = TRS("Bit rate (kbps)"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("1536"), \ .multi_names = (char const *[]){ "32", "56", \ "64", "96", "112", "128", \ "192", "224", "256", "320", "384", \ "448", "512", "576", "640", "768", \ "896", "1024", "1152", "1280", "1344", \ "1408", "1411200", "1472", "1536", "1920", \ "2048", "3072", "3840", \ NULL } \ }, #define ENCODE_PARAM_WMA \ { \ .name = "ff_bit_rate_str", \ .long_name = TRS("Bit rate (kbps)"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("128"), \ .multi_names = (char const *[]){ "24", "48", "64", "96", "128", NULL } \ }, #if 0 static const bg_parameter_info_t parameters_libfaac[] = { { .name = "faac_profile", .long_name = TRS("Profile"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("lc"), .multi_names = (char const *[]){"main", "lc", "ssr", "ltp", (char *)0}, .multi_labels = (char const *[]){TRS("Main"), TRS("LC"), TRS("SSR"), TRS("LTP"), (char *)0 }, }, PARAM_BITRATE_AUDIO, { .name = "faac_quality", .long_name = TRS("Quality"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(10), .val_max = GAVL_VALUE_INIT_INT(500), .val_default = GAVL_VALUE_INIT_INT(100), .help_string = TRS("Quantizer quality"), }, { /* */ } }; #endif static const bg_parameter_info_t parameters_libvorbis[] = { PARAM_BITRATE_AUDIO, PARAM_RC_MIN_RATE, PARAM_RC_MAX_RATE, { .name = "quality", .long_name = TRS("Quality"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(-1), .val_max = GAVL_VALUE_INIT_INT(10), .val_default = GAVL_VALUE_INIT_INT(3), .help_string = TRS("Quantizer quality"), }, { /* End */ }, }; #define ENCODE_PARAM_VIDEO_RATECONTROL \ { \ .name = "rate_control", \ .long_name = TRS("Rate control"), \ .type = BG_PARAMETER_SECTION, \ }, \ PARAM_BITRATE_VIDEO, \ PARAM_BITRATE_TOLERANCE, \ PARAM_RC_MIN_RATE, \ PARAM_RC_MAX_RATE, \ PARAM_RC_BUFFER_SIZE, \ PARAM_RC_INITIAL_COMPLEX, \ PARAM_RC_INITIAL_BUFFER_OCCUPANCY #define ENCODE_PARAM_VIDEO_QUANTIZER_I \ { \ .name = "quantizer", \ .long_name = TRS("Quantizer"), \ .type = BG_PARAMETER_SECTION, \ }, \ PARAM_QMIN, \ PARAM_QMAX, \ PARAM_MAX_QDIFF, \ PARAM_FLAG_QSCALE, \ PARAM_QSCALE, \ PARAM_QCOMPRESS, \ PARAM_QBLUR, \ PARAM_TRELLIS #define ENCODE_PARAM_VIDEO_QUANTIZER_IP \ ENCODE_PARAM_VIDEO_QUANTIZER_I, \ PARAM_I_QUANT_FACTOR, \ PARAM_I_QUANT_OFFSET #define ENCODE_PARAM_VIDEO_QUANTIZER_IPB \ ENCODE_PARAM_VIDEO_QUANTIZER_IP, \ PARAM_B_QUANT_FACTOR, \ PARAM_B_QUANT_OFFSET #define ENCODE_PARAM_VIDEO_FRAMETYPES_IP \ { \ .name = "frame_types", \ .long_name = TRS("Frame types"), \ .type = BG_PARAMETER_SECTION, \ }, \ PARAM_GOP_SIZE, \ PARAM_SCENE_CHANGE_THRESHOLD, \ PARAM_FLAG_CLOSED_GOP, \ PARAM_FLAG2_STRICT_GOP #define ENCODE_PARAM_VIDEO_FRAMETYPES_IPB \ ENCODE_PARAM_VIDEO_FRAMETYPES_IP, \ PARAM_MAX_B_FRAMES, \ PARAM_B_FRAME_STRATEGY #define ENCODE_PARAM_VIDEO_ME \ { \ .name = "motion_estimation", \ .long_name = TRS("Motion estimation"), \ .type = BG_PARAMETER_SECTION, \ }, \ PARAM_ME_METHOD, \ PARAM_ME_CMP,\ PARAM_ME_CMP_CHROMA,\ PARAM_ME_RANGE,\ PARAM_ME_THRESHOLD,\ PARAM_MB_DECISION,\ PARAM_DIA_SIZE #define ENCODE_PARAM_VIDEO_ME_PRE \ { \ .name = "motion_estimation", \ .long_name = TRS("ME pre-pass"), \ .type = BG_PARAMETER_SECTION, \ }, \ PARAM_PRE_ME,\ PARAM_ME_PRE_CMP,\ PARAM_ME_PRE_CMP_CHROMA,\ PARAM_PRE_DIA_SIZE #define ENCODE_PARAM_VIDEO_QPEL \ { \ .name = "qpel_motion_estimation", \ .long_name = TRS("Qpel ME"), \ .type = BG_PARAMETER_SECTION, \ }, \ PARAM_FLAG_QPEL, \ PARAM_ME_SUB_CMP,\ PARAM_ME_SUB_CMP_CHROMA,\ PARAM_ME_SUBPEL_QUALITY #define ENCODE_PARAM_VIDEO_MASKING \ { \ .name = "masking", \ .long_name = TRS("Masking"), \ .type = BG_PARAMETER_SECTION, \ }, \ PARAM_LUMI_MASKING, \ PARAM_DARK_MASKING, \ PARAM_TEMPORAL_CPLX_MASKING, \ PARAM_SPATIAL_CPLX_MASKING, \ PARAM_BORDER_MASKING, \ PARAM_P_MASKING #define ENCODE_PARAM_VIDEO_MISC \ { \ .name = "misc", \ .long_name = TRS("Misc"), \ .type = BG_PARAMETER_SECTION, \ }, \ PARAM_STRICT_STANDARD_COMPLIANCE, \ PARAM_NOISE_REDUCTION, \ PARAM_FLAG_GRAY, \ PARAM_FLAG_BITEXACT static const bg_parameter_info_t parameters_mpeg4[] = { ENCODE_PARAM_VIDEO_FRAMETYPES_IPB, PARAM_FLAG_AC_PRED_MPEG4, ENCODE_PARAM_VIDEO_RATECONTROL, ENCODE_PARAM_VIDEO_QUANTIZER_IPB, PARAM_FLAG_CBP_RD, ENCODE_PARAM_VIDEO_ME, PARAM_FLAG_4MV, PARAM_FLAG_QP_RD, ENCODE_PARAM_VIDEO_ME_PRE, ENCODE_PARAM_VIDEO_QPEL, ENCODE_PARAM_VIDEO_MASKING, ENCODE_PARAM_VIDEO_MISC, { /* End of parameters */ } }; static const bg_parameter_info_t parameters_mjpeg[] = { ENCODE_PARAM_VIDEO_RATECONTROL, ENCODE_PARAM_VIDEO_QUANTIZER_I, ENCODE_PARAM_VIDEO_MISC, { /* End of parameters */ } }; static const bg_parameter_info_t parameters_mpeg1[] = { ENCODE_PARAM_VIDEO_FRAMETYPES_IPB, ENCODE_PARAM_VIDEO_RATECONTROL, ENCODE_PARAM_VIDEO_QUANTIZER_IPB, ENCODE_PARAM_VIDEO_ME, ENCODE_PARAM_VIDEO_ME_PRE, ENCODE_PARAM_VIDEO_MASKING, ENCODE_PARAM_VIDEO_MISC, { /* End of parameters */ } }; static const bg_parameter_info_t parameters_msmpeg4v3[] = { ENCODE_PARAM_VIDEO_FRAMETYPES_IP, ENCODE_PARAM_VIDEO_RATECONTROL, ENCODE_PARAM_VIDEO_QUANTIZER_IP, ENCODE_PARAM_VIDEO_ME, ENCODE_PARAM_VIDEO_ME_PRE, ENCODE_PARAM_VIDEO_MASKING, ENCODE_PARAM_VIDEO_MISC, { /* End of parameters */ } }; static const bg_parameter_info_t parameters_libx264[] = { { .name = "libx264_preset", .long_name = TRS("Preset"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("medium"), .multi_names = (char const *[]){"ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo", (char *)0}, .multi_labels = (char const *[]){TRS("Ultrafast"), TRS("Superfast"), TRS("Veryfast"), TRS("Faster"), TRS("Fast"), TRS("Medium"), TRS("Slow"), TRS("Slower"), TRS("Veryslow"), TRS("Placebo"), (char *)0 }, }, { .name = "libx264_tune", .long_name = TRS("Tune"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("$none"), .multi_names = (char const *[]){"$none", "film", "animation", "grain", "stillimage", "psnr", "ssim", "fastdecode", "zerolatency", (char *)0}, .multi_labels = (char const *[]){TRS("None"), TRS("Film"), TRS("Animation"), TRS("Grain"), TRS("Still image"), TRS("PSNR"), TRS("SSIM"), TRS("Fast decode"), TRS("Zero latency"), (char *)0}, }, { .name = "ff_bit_rate_video", .long_name = TRS("Bit rate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(10000), .val_default = GAVL_VALUE_INIT_INT(0), .help_string = TRS("If > 0 encode with average bitrate"), }, { .name = "libx264_crf", .long_name = TRS("Quality-based VBR"), .type = BG_PARAMETER_SLIDER_FLOAT, .val_min = GAVL_VALUE_INIT_FLOAT(-1.0), .val_max = GAVL_VALUE_INIT_FLOAT(51.0), .val_default = GAVL_VALUE_INIT_FLOAT(23.0), .help_string = TRS("Negative means disable"), .num_digits = 2, }, { .name = "libx264_qp", .long_name = TRS("Force constant QP"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(-1), .val_max = GAVL_VALUE_INIT_INT(69), .val_default = GAVL_VALUE_INIT_INT(-1), .help_string = TRS("Negative means disable, 0 means lossless"), }, { /* End */ }, }; static const bg_parameter_info_t parameters_libvpx[] = { { .name = "rc", .long_name = TRS("Rate control"), .type = BG_PARAMETER_SECTION, }, PARAM_BITRATE_VIDEO, PARAM_RC_MIN_RATE, PARAM_RC_MAX_RATE, PARAM_RC_BUFFER_SIZE, PARAM_RC_INITIAL_BUFFER_OCCUPANCY, { .name = "ff_qcompress", .long_name = TRS("2-Pass VBR/CBR"), .type = BG_PARAMETER_SLIDER_FLOAT, .val_default = GAVL_VALUE_INIT_FLOAT(0.5), .val_min = GAVL_VALUE_INIT_FLOAT(0.0), .val_max = GAVL_VALUE_INIT_FLOAT(1.0), .num_digits = 2, .help_string = TRS("0: CBR, 1: VBR") }, { .name = "ff_qmin", .long_name = TRS("Minimum quantizer scale"), .type = BG_PARAMETER_SLIDER_INT, .val_default = GAVL_VALUE_INIT_INT(2), .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(63), .help_string = TRS("recommended value 0-4") }, { .name = "ff_qmax", .long_name = TRS("Maximum quantizer scale"), .type = BG_PARAMETER_SLIDER_INT, .val_default = GAVL_VALUE_INIT_INT(55), .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(63), .help_string = TRS("Must be larger than minimum, recommended value 50-63") }, { .name = "libvpx_crf", .long_name = TRS("Constant quality"), .type = BG_PARAMETER_SLIDER_INT, .val_default = GAVL_VALUE_INIT_INT(10), .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(63), .help_string = TRS("Set this to 0 for enabling VBR") }, { .name = "speed", .long_name = TRS("Speed"), .type = BG_PARAMETER_SECTION, }, { .name = "libvpx_deadline", .long_name = TRS("Speed"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("good"), .multi_names = (char const *[]){"best", "good", "realtime", (char *)0}, .multi_labels = (char const *[]){TRS("Best quality"), TRS("Good quality"), TRS("Realtime"), (char *)0}, }, { .name = "libvpx_cpu-used", .long_name = TRS("CPU usage modifier"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(1000), // Bogus .val_default = GAVL_VALUE_INIT_INT(0), }, PARAM_THREAD_COUNT, { .name = "frametypes", .long_name = TRS("Frame types"), .type = BG_PARAMETER_SECTION, }, #if 0 // Has no effect?? { .name = "ff_keyint_min", .long_name = TRS("Minimum GOP size"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(1000), // Bogus .val_default = GAVL_VALUE_INIT_INT(0), }, #endif { .name = "ff_gop_size", .long_name = TRS("Maximum GOP size"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(-1), .val_max = GAVL_VALUE_INIT_INT(1000), // Bogus .val_default = GAVL_VALUE_INIT_INT(-1), .help_string = TRS("Maximum keyframe distance, -1 means automatic"), }, { .name = "libvpx_auto-alt-ref", .long_name = TRS("Enable alternate reference frames"), .help_string = TRS("Enable use of alternate reference frames (2-pass only)"), .type = BG_PARAMETER_CHECKBUTTON, }, { .name = "libvpx_lag-in-frames", .long_name = TRS("Lookahead"), .help_string = TRS("Number of frames to look ahead for alternate reference frame selection"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(100), .val_default = GAVL_VALUE_INIT_INT(0), }, { .name = "libvpx_arnr-maxframes", .long_name = TRS("Frame count for noise reduction"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(100), .val_default = GAVL_VALUE_INIT_INT(0), }, { .name = "libvpx_arnr-type", .long_name = TRS("Noise reduction filter"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("backward"), .multi_names = (char const *[]){"$none", "backward", "forward", "centered", (char *)0}, .multi_labels = (char const *[]){TRS("None"), TRS("Backward"), TRS("Forward"), TRS("Centered"), (char *)0}, }, { /* End */ }, }; static const bg_parameter_info_t parameters_tga[] = { { .name = "tga_rle", .long_name = TRS("Use RLE compression"), .type = BG_PARAMETER_CHECKBUTTON, }, { /* */ } }; /* Audio */ static const bg_parameter_info_t parameters_ac3[] = { ENCODE_PARAM_AC3 { /* End of parameters */ } }; static const bg_parameter_info_t parameters_dca[] = { ENCODE_PARAM_DTS { /* End of parameters */ } }; static const bg_parameter_info_t parameters_mp2[] = { ENCODE_PARAM_MP2 { /* End of parameters */ } }; static const bg_parameter_info_t parameters_mp3[] = { ENCODE_PARAM_MP3 { /* End of parameters */ } }; static const bg_parameter_info_t parameters_wma[] = { ENCODE_PARAM_WMA { /* End of parameters */ } }; static const ffmpeg_codec_info_t audio_codecs[] = { { .name = "pcm_s16be", .long_name = TRS("16 bit PCM"), .id = AV_CODEC_ID_PCM_S16BE, }, { .name = "pcm_s16le", .long_name = TRS("16 bit PCM"), .id = AV_CODEC_ID_PCM_S16LE, }, { .name = "pcm_s8", .long_name = TRS("8 bit PCM"), .id = AV_CODEC_ID_PCM_S8, }, { .name = "pcm_u8", .long_name = TRS("8 bit PCM"), .id = AV_CODEC_ID_PCM_U8, }, { .name = "pcm_alaw", .long_name = TRS("alaw"), .id = AV_CODEC_ID_PCM_ALAW, }, { .name = "pcm_mulaw", .long_name = TRS("mulaw"), .id = AV_CODEC_ID_PCM_MULAW, }, { .name = "ac3", .long_name = TRS("AC3"), .id = AV_CODEC_ID_AC3, .parameters = parameters_ac3, }, { .name = "mp2", .long_name = TRS("MPEG audio layer 2"), .id = AV_CODEC_ID_MP2, .parameters = parameters_mp2, }, { .name = "dca", .long_name = TRS("DTS"), .id = AV_CODEC_ID_DTS, .parameters = parameters_dca, }, { .name = "wma1", .long_name = TRS("Windows media Audio 1"), .id = AV_CODEC_ID_WMAV1, .parameters = parameters_wma, }, { .name = "wma2", .long_name = TRS("Windows media Audio 2"), .id = AV_CODEC_ID_WMAV2, .parameters = parameters_wma, }, { .name = "mp3", .long_name = TRS("MPEG audio layer 3"), .id = AV_CODEC_ID_MP3, .parameters = parameters_mp3, }, { .name = "aac", .long_name = TRS("AAC"), .id = AV_CODEC_ID_AAC, // .parameters = parameters_libfaac, // .flags = FLAG_EXTRADATA }, { .name = "libvorbis", .long_name = TRS("Vorbis"), .id = AV_CODEC_ID_VORBIS, .parameters = parameters_libvorbis, }, { /* End of array */ } }; static const ffmpeg_codec_info_t video_codecs[] = { { .name = "mjpeg", .long_name = TRS("Motion JPEG"), .id = AV_CODEC_ID_MJPEG, .parameters = parameters_mjpeg, .flags = FLAG_INTRA_ONLY, }, { .name = "mpeg4", .long_name = TRS("MPEG-4"), .id = AV_CODEC_ID_MPEG4, .parameters = parameters_mpeg4, .flags = FLAG_B_FRAMES, }, { .name = "msmpeg4v3", .long_name = TRS("Divx 3 compatible"), .id = AV_CODEC_ID_MSMPEG4V3, .parameters = parameters_msmpeg4v3, }, { .name = "mpeg1video", .long_name = TRS("MPEG-1 Video"), .id = AV_CODEC_ID_MPEG1VIDEO, .parameters = parameters_mpeg1, .flags = FLAG_CONSTANT_FRAMERATE|FLAG_B_FRAMES, .framerates = bg_ffmpeg_mpeg_framerates, }, { .name = "mpeg2video", .long_name = TRS("MPEG-2 Video"), .id = AV_CODEC_ID_MPEG2VIDEO, .parameters = parameters_mpeg1, .flags = FLAG_CONSTANT_FRAMERATE|FLAG_B_FRAMES, .framerates = bg_ffmpeg_mpeg_framerates, }, { .name = "flv1", .long_name = TRS("Flash 1"), .id = AV_CODEC_ID_FLV1, .parameters = parameters_msmpeg4v3, }, { .name = "wmv1", .long_name = TRS("WMV 1"), .id = AV_CODEC_ID_WMV1, .parameters = parameters_msmpeg4v3, }, { .name = "rv10", .long_name = TRS("Real Video 1"), .id = AV_CODEC_ID_RV10, .parameters = parameters_msmpeg4v3, }, { .name = "libx264", .long_name = TRS("H.264"), .id = AV_CODEC_ID_H264, .parameters = parameters_libx264, .flags = FLAG_B_FRAMES, }, { .name = "tga", .long_name = TRS("Targa"), .id = AV_CODEC_ID_TARGA, .parameters = parameters_tga, .flags = FLAG_INTRA_ONLY, }, { .name = "libvpx", .long_name = TRS("VP8"), .id = AV_CODEC_ID_VP8, .parameters = parameters_libvpx, .flags = 0, }, #if 0 { .name = "wmv2", .long_name = TRS("WMV 2"), .id = AV_CODEC_ID_WMV2, .parameters = parameters_msmpeg4v3 }, #endif { /* End of array */ } }; static const ffmpeg_codec_info_t ** add_codec_info(const ffmpeg_codec_info_t ** info, enum AVCodecID id, int * num) { int i; /* Check if the codec id is already in the array */ for(i = 0; i < *num; i++) { if(info[i]->id == id) return info; } info = realloc(info, ((*num)+1) * sizeof(*info)); info[*num] = NULL; i = 0; while(audio_codecs[i].name) { if(audio_codecs[i].id == id) { info[*num] = &audio_codecs[i]; break; } i++; } if(!info[*num]) { i = 0; while(video_codecs[i].name) { if(video_codecs[i].id == id) { info[*num] = &video_codecs[i]; break; } i++; } } (*num)++; return info; } static const bg_parameter_info_t audio_parameters[] = { { .name = "codec", .long_name = TRS("Codec"), .type = BG_PARAMETER_MULTI_MENU, }, { /* */ } }; static const bg_parameter_info_t video_parameters[] = { { .name = "codec", .long_name = TRS("Codec"), .type = BG_PARAMETER_MULTI_MENU, }, BG_ENCODER_FRAMERATE_PARAMS, { /* */ } }; static void create_codec_parameter(bg_parameter_info_t * parameter_info, const ffmpeg_codec_info_t ** infos, int num_infos) { int i; parameter_info[0].multi_names_nc = calloc(num_infos+1, sizeof(*parameter_info[0].multi_names)); parameter_info[0].multi_labels_nc = calloc(num_infos+1, sizeof(*parameter_info[0].multi_labels)); parameter_info[0].multi_parameters_nc = calloc(num_infos+1, sizeof(*parameter_info[0].multi_parameters)); for(i = 0; i < num_infos; i++) { parameter_info[0].multi_names_nc[i] = gavl_strrep(parameter_info[0].multi_names_nc[i], infos[i]->name); parameter_info[0].multi_labels_nc[i] = gavl_strrep(parameter_info[0].multi_labels_nc[i], infos[i]->long_name); if(infos[i]->parameters) parameter_info[0].multi_parameters_nc[i] = bg_parameter_info_copy_array(infos[i]->parameters); } bg_parameter_info_set_const_ptrs(¶meter_info[0]); } bg_parameter_info_t * bg_ffmpeg_create_audio_parameters(const ffmpeg_format_info_t * format_info) { int j, num_infos = 0; bg_parameter_info_t * ret; const ffmpeg_codec_info_t ** infos = NULL; /* Create codec array */ if(!format_info->audio_codecs) return NULL; j = 0; while(format_info->audio_codecs[j] != AV_CODEC_ID_NONE) { infos = add_codec_info(infos, format_info->audio_codecs[j], &num_infos); j++; } if(!infos) return NULL; /* Create parameters */ ret = bg_parameter_info_copy_array(audio_parameters); create_codec_parameter(&ret[0], infos, num_infos); free(infos); return ret; } bg_parameter_info_t * bg_ffmpeg_create_video_parameters(const ffmpeg_format_info_t * format_info) { int j, num_infos = 0; bg_parameter_info_t * ret; const ffmpeg_codec_info_t ** infos = NULL; /* Create codec array */ if(!format_info->video_codecs) return NULL; j = 0; while(format_info->video_codecs[j] != AV_CODEC_ID_NONE) { infos = add_codec_info(infos, format_info->video_codecs[j], &num_infos); j++; } if(!infos) return NULL; /* Create parameters */ /* Create parameters */ ret = bg_parameter_info_copy_array(video_parameters); create_codec_parameter(&ret[0], infos, num_infos); free(infos); return ret; } enum AVCodecID bg_ffmpeg_find_audio_encoder(const ffmpeg_format_info_t * format, const char * name) { int i = 0, found = 0; enum AVCodecID ret = AV_CODEC_ID_NONE; while(audio_codecs[i].name) { if(!strcmp(name, audio_codecs[i].name)) { ret = audio_codecs[i].id; break; } i++; } if(!format) return ret; i = 0; while(format->audio_codecs[i] != AV_CODEC_ID_NONE) { if(format->audio_codecs[i] == ret) { found = 1; break; } i++; } if(!found) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Audio codec %s is not supported by %s", name, format->name); ret = AV_CODEC_ID_NONE; } return ret; } enum AVCodecID bg_ffmpeg_find_video_encoder(const ffmpeg_format_info_t * format, const char * name) { int i = 0, found = 0; enum AVCodecID ret = AV_CODEC_ID_NONE; while(video_codecs[i].name) { if(!strcmp(name, video_codecs[i].name)) { ret = video_codecs[i].id; break; } i++; } if(!format) return ret; i = 0; while(format->video_codecs[i] != AV_CODEC_ID_NONE) { if(format->video_codecs[i] == ret) { found = 1; break; } i++; } if(!found) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Video codec %s is not supported by %s", name, format->name); ret = AV_CODEC_ID_NONE; } return ret; } static const ffmpeg_codec_info_t * get_codec_info(const ffmpeg_codec_info_t * codecs, enum AVCodecID id) { int i = 0; while(codecs[i].name) { if(id == codecs[i].id) return &codecs[i]; i++; } return NULL; } const ffmpeg_codec_info_t * bg_ffmpeg_get_codec_info(enum AVCodecID id, int type) { if(type == AVMEDIA_TYPE_AUDIO) return get_codec_info(audio_codecs, id); else if(type == AVMEDIA_TYPE_VIDEO) return get_codec_info(video_codecs, id); return NULL; } const bg_parameter_info_t * bg_ffmpeg_get_codec_parameters(enum AVCodecID id, int type) { const ffmpeg_codec_info_t * ci = NULL; if(type == AVMEDIA_TYPE_AUDIO) ci = get_codec_info(audio_codecs, id); else if(type == AVMEDIA_TYPE_VIDEO) ci = get_codec_info(video_codecs, id); if(!ci) return NULL; return ci->parameters; } const char * bg_ffmpeg_get_codec_name(enum AVCodecID id) { const ffmpeg_codec_info_t * info; if(!(info = get_codec_info(audio_codecs, id)) && !(info = get_codec_info(video_codecs, id))) return NULL; return info->name; } typedef struct { const char * s; int i; } enum_t; #define PARAM_INT(n, var) \ if(!strcmp(n, name)) \ { \ ctx->var = val->v.i; \ } #define PARAM_INT_SCALE(n, var, scale) \ if(!strcmp(n, name)) \ { \ ctx->var = val->v.i * scale; \ } #define PARAM_STR_INT_SCALE(n, var, scale) \ if(!strcmp(n, name)) \ { \ ctx->var = atoi(val->v.str) * scale; \ } #define PARAM_QP2LAMBDA(n, var) \ if(!strcmp(n, name)) \ { \ ctx->var = (int)(val->v.d * FF_QP2LAMBDA+0.5); \ } #define PARAM_FLOAT(n, var) \ if(!strcmp(n, name)) \ { \ ctx->var = val->v.d; \ } #define PARAM_CMP_CHROMA(n,var) \ { \ if(!strcmp(n, name)) \ { \ if(val->v.i) \ ctx->var |= FF_CMP_CHROMA; \ else \ ctx->var &= ~FF_CMP_CHROMA; \ \ } \ } #define PARAM_FLAG(n,flag) \ { \ if(!strcmp(n, name)) \ { \ if(val->v.i) \ ctx->flags |= flag; \ else \ ctx->flags &= ~flag; \ \ } \ } #define PARAM_FLAG2(n,flag) \ { \ if(!strcmp(n, name)) \ { \ if(val->v.i) \ ctx->flags2 |= flag; \ else \ ctx->flags2 &= ~flag; \ \ } \ } static const enum_t compare_func[] = { { "SAD", FF_CMP_SAD }, { "SSE", FF_CMP_SSE }, { "SATD", FF_CMP_SATD }, { "DCT", FF_CMP_DCT }, { "PSNR", FF_CMP_PSNR }, { "BIT", FF_CMP_BIT }, { "RD", FF_CMP_RD }, { "ZERO", FF_CMP_ZERO }, { "VSAD", FF_CMP_VSAD }, { "VSSE", FF_CMP_VSSE }, { "NSSE", FF_CMP_NSSE } }; static const enum_t mb_decision[] = { { "Use compare function", FF_MB_DECISION_SIMPLE }, { "Fewest bits", FF_MB_DECISION_BITS }, { "Rate distoration", FF_MB_DECISION_RD } }; static const enum_t faac_profile[] = { #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(62, 0, 0) { "main", FF_PROFILE_AAC_MAIN }, { "lc", FF_PROFILE_AAC_LOW }, { "ssr", FF_PROFILE_AAC_SSR }, { "ltp", FF_PROFILE_AAC_LTP } #else { "main", AV_PROFILE_AAC_MAIN }, { "lc", AV_PROFILE_AAC_LOW }, { "ssr", AV_PROFILE_AAC_SSR }, { "ltp", AV_PROFILE_AAC_LTP } #endif }; #define PARAM_ENUM(n, var, arr) \ if(!strcmp(n, name)) \ { \ for(i = 0; i < sizeof(arr)/sizeof(arr[0]); i++) \ { \ if(!strcmp(val->v.str, arr[i].s)) \ { \ ctx->var = arr[i].i; \ break; \ } \ } \ } #define PARAM_DICT_STRING(n, ffmpeg_key) \ if(!strcmp(n, name)) \ { \ if(val->v.str && (val->v.str[0] != '$')) \ av_dict_set(options, \ ffmpeg_key, val->v.str, 0); \ } #define PARAM_DICT_FLOAT(n, ffmpeg_key) \ if(!strcmp(n, name)) \ { \ char * str; \ str = gavl_sprintf("%f", val->v.d); \ av_dict_set(options, ffmpeg_key, str, 0); \ free(str); \ } #define PARAM_DICT_INT(n, ffmpeg_key) \ if(!strcmp(n, name)) \ { \ char * str; \ str = gavl_sprintf("%d", val->v.i); \ av_dict_set(options, ffmpeg_key, str, 0); \ free(str); \ } void bg_ffmpeg_set_codec_parameter(AVCodecContext * ctx, AVDictionary ** options, const char * name, const gavl_value_t * val) { int i; /* * IMPORTANT: To keep the mess at a reasonable level, * *all* parameters *must* appear in the same order as in * the AVCocecContext structure, except the flags, which come at the very end */ PARAM_INT_SCALE("ff_bit_rate_video",bit_rate,1000); PARAM_INT_SCALE("ff_bit_rate_audio",bit_rate,1000); PARAM_STR_INT_SCALE("ff_bit_rate_str", bit_rate, 1000); PARAM_INT_SCALE("ff_bit_rate_tolerance",bit_rate_tolerance,1000); PARAM_INT("ff_gop_size",gop_size); PARAM_FLOAT("ff_qcompress",qcompress); PARAM_FLOAT("ff_qblur",qblur); PARAM_INT("ff_qmin",qmin); PARAM_INT("ff_qmax",qmax); PARAM_INT("ff_max_qdiff",max_qdiff); PARAM_INT("ff_max_b_frames",max_b_frames); PARAM_FLOAT("ff_b_quant_factor",b_quant_factor); PARAM_INT("ff_strict_std_compliance",strict_std_compliance); PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset); PARAM_INT("ff_rc_min_rate",rc_min_rate); PARAM_INT("ff_rc_max_rate",rc_max_rate); PARAM_INT_SCALE("ff_rc_buffer_size",rc_buffer_size,1000); PARAM_FLOAT("ff_i_quant_factor",i_quant_factor); PARAM_QP2LAMBDA("ff_i_quant_offset",i_quant_offset); PARAM_FLOAT("ff_lumi_masking",lumi_masking); PARAM_FLOAT("ff_temporal_cplx_masking",temporal_cplx_masking); PARAM_FLOAT("ff_spatial_cplx_masking",spatial_cplx_masking); PARAM_FLOAT("ff_p_masking",p_masking); PARAM_FLOAT("ff_dark_masking",dark_masking); PARAM_ENUM("ff_me_cmp",me_cmp,compare_func); PARAM_CMP_CHROMA("ff_me_cmp_chroma",me_cmp); PARAM_ENUM("ff_me_sub_cmp",me_sub_cmp,compare_func); PARAM_CMP_CHROMA("ff_me_sub_cmp_chroma",me_sub_cmp); PARAM_ENUM("ff_mb_cmp",mb_cmp,compare_func); PARAM_CMP_CHROMA("ff_mb_cmp_chroma",mb_cmp); PARAM_ENUM("ff_ildct_cmp",ildct_cmp,compare_func); PARAM_CMP_CHROMA("ff_ildct_cmp_chroma",ildct_cmp); PARAM_INT("ff_dia_size",dia_size); PARAM_INT("ff_last_predictor_count",last_predictor_count); PARAM_ENUM("ff_me_pre_cmp",me_pre_cmp,compare_func); PARAM_CMP_CHROMA("ff_pre_me_cmp_chroma",me_pre_cmp); PARAM_INT("ff_pre_dia_size",pre_dia_size); PARAM_INT("ff_me_subpel_quality",me_subpel_quality); PARAM_INT("ff_me_range",me_range); PARAM_ENUM("ff_mb_decision",mb_decision,mb_decision); PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000); PARAM_INT("ff_nsse_weight",nsse_weight); PARAM_QP2LAMBDA("ff_mb_lmin", mb_lmin); PARAM_QP2LAMBDA("ff_mb_lmax", mb_lmax); PARAM_INT("ff_bidir_refine",bidir_refine); PARAM_INT("ff_keyint_min",keyint_min); PARAM_FLAG("ff_flag_qscale",AV_CODEC_FLAG_QSCALE); PARAM_FLAG("ff_flag_4mv",AV_CODEC_FLAG_4MV); PARAM_FLAG("ff_flag_qpel",AV_CODEC_FLAG_QPEL); // PARAM_FLAG("ff_flag_part",CODEC_FLAG_PART); PARAM_FLAG("ff_flag_gray",AV_CODEC_FLAG_GRAY); // PARAM_FLAG("ff_flag_alt_scan",CODEC_FLAG_ALT_SCAN); PARAM_INT("ff_trellis",trellis); PARAM_FLAG("ff_flag_bitexact",AV_CODEC_FLAG_BITEXACT); PARAM_FLAG("ff_flag_ac_pred",AV_CODEC_FLAG_AC_PRED); // PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD); // PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD); // PARAM_FLAG("ff_flag_h263p_aiv",CODEC_FLAG_H263P_AIV); // PARAM_FLAG("ffx_flag_obmc",CODEC_FLAG_OBMC); PARAM_FLAG("ff_flag_loop_filter",AV_CODEC_FLAG_LOOP_FILTER); // PARAM_FLAG("ff_flag_h263p_slice_struct",CODEC_FLAG_H263P_SLICE_STRUCT); PARAM_FLAG("ff_flag_closed_gop",AV_CODEC_FLAG_CLOSED_GOP); PARAM_FLAG2("ff_flag2_fast",AV_CODEC_FLAG2_FAST); // PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP); PARAM_INT("ff_thread_count",thread_count); PARAM_DICT_STRING("libx264_preset", "preset"); PARAM_DICT_STRING("libx264_tune", "tune"); PARAM_DICT_FLOAT("libx264_crf", "crf"); PARAM_DICT_FLOAT("libx264_qp", "qp"); PARAM_ENUM("faac_profile", profile, faac_profile); if(!strcmp(name, "faac_quality")) ctx->global_quality = FF_QP2LAMBDA * val->v.i; else if(!strcmp(name, "vorbis_quality")) ctx->global_quality = FF_QP2LAMBDA * val->v.i; if(!strcmp(name, "tga_rle")) { av_opt_set_int(ctx->priv_data, "rle", !!(val->v.i), 0); } PARAM_DICT_STRING("libvpx_deadline", "deadline"); PARAM_DICT_INT("libvpx_cpu-used", "cpu-used"); PARAM_DICT_INT("libvpx_auto-alt-ref", "alt-ref"); PARAM_DICT_INT("libvpx_lag-in-frames", "lag-in-frames"); PARAM_DICT_INT("libvpx_arnr-max-frames", "arnr-max-frames"); PARAM_DICT_INT("libvpx_crf", "crf"); PARAM_DICT_STRING("libvpx_arnr-type", "arnr-type"); } /* Type conversion */ const bg_encoder_framerate_t bg_ffmpeg_mpeg_framerates[] = { { 24000, 1001 }, { 24, 1 }, { 25, 1 }, { 30000, 1001 }, { 30, 1 }, { 50, 1 }, { 60000, 1001 }, { 60, 1 }, { /* End of framerates */ } }; #ifdef WORDS_BIGENDIAN #define PIX_FMT_LE CONVERT_ENDIAN #define PIX_FMT_BE 0 #else #define PIX_FMT_LE 0 #define PIX_FMT_BE CONVERT_ENDIAN #endif static const struct { enum AVPixelFormat ffmpeg_csp; gavl_pixelformat_t gavl_csp; int convert_flags; } pixelformats[] = { { AV_PIX_FMT_YUV420P, GAVL_YUV_420_P }, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples) { AV_PIX_FMT_YUYV422, GAVL_YUY2 }, { AV_PIX_FMT_YUV422P, GAVL_YUV_422_P }, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) { AV_PIX_FMT_YUV444P, GAVL_YUV_444_P }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples) { AV_PIX_FMT_YUV411P, GAVL_YUV_411_P }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples) { AV_PIX_FMT_YUVJ420P, GAVL_YUVJ_420_P }, ///< Planar YUV 4:2:0 full scale (jpeg) { AV_PIX_FMT_YUVJ422P, GAVL_YUVJ_422_P }, ///< Planar YUV 4:2:2 full scale (jpeg) { AV_PIX_FMT_YUVJ444P, GAVL_YUVJ_444_P }, ///< Planar YUV 4:4:4 full scale (jpeg) { AV_PIX_FMT_GRAY8, GAVL_GRAY_8 }, { AV_PIX_FMT_RGB565BE, GAVL_RGB_16, PIX_FMT_BE }, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian { AV_PIX_FMT_RGB565LE, GAVL_RGB_16, PIX_FMT_LE }, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian { AV_PIX_FMT_RGB555BE, GAVL_RGB_15, PIX_FMT_BE }, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 { AV_PIX_FMT_RGB555LE, GAVL_RGB_15, PIX_FMT_LE }, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 { AV_PIX_FMT_BGR565BE, GAVL_BGR_16, PIX_FMT_BE }, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian { AV_PIX_FMT_BGR565LE, GAVL_BGR_16, PIX_FMT_LE }, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian { AV_PIX_FMT_BGR555BE, GAVL_BGR_15, PIX_FMT_BE }, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 { AV_PIX_FMT_BGR555LE, GAVL_BGR_15, PIX_FMT_LE }, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 { AV_PIX_FMT_RGB24, GAVL_RGB_24 }, ///< Packed pixel, 3 bytes per pixel, RGBRGB... { AV_PIX_FMT_BGR24, GAVL_BGR_24 }, ///< Packed pixel, 3 bytes per pixel, BGRBGR... { AV_PIX_FMT_BGRA, GAVL_RGBA_32, CONVERT_OTHER }, #if 0 // Not needed in the forseeable future #if LIBAVUTIL_VERSION_INT < (50<<16) { AV_PIX_FMT_RGBA32, GAVL_RGBA_32 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness #else { AV_PIX_FMT_RGB32, GAVL_RGBA_32 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA..., stored in cpu endianness #endif { AV_PIX_FMT_YUV410P, GAVL_YUV_410_P }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples) #endif // Not needed }; static gavl_pixelformat_t bg_pixelformat_ffmpeg_2_gavl(enum AVPixelFormat p) { int i; for(i = 0; i < sizeof(pixelformats)/sizeof(pixelformats[0]); i++) { if(pixelformats[i].ffmpeg_csp == p) return pixelformats[i].gavl_csp; } return GAVL_PIXELFORMAT_NONE; } static enum AVPixelFormat bg_pixelformat_gavl_2_ffmpeg(gavl_pixelformat_t p, int * do_convert, const enum AVPixelFormat * supported) { int i, j; for(i = 0; i < sizeof(pixelformats)/sizeof(pixelformats[0]); i++) { if(pixelformats[i].gavl_csp == p) { j = 0; while(supported[j] != AV_PIX_FMT_NONE) { if(pixelformats[i].ffmpeg_csp == supported[j]) { if(do_convert) *do_convert = pixelformats[i].convert_flags; return pixelformats[i].ffmpeg_csp; } j++; } } } return AV_PIX_FMT_NONE; } void bg_ffmpeg_choose_pixelformat(const enum AVPixelFormat * supported, enum AVPixelFormat * ffmpeg_fmt, gavl_pixelformat_t * gavl_fmt, int * do_convert) { int i, num; gavl_pixelformat_t * gavl_fmts; /* Count pixelformats */ i = 0; num = 0; while(supported[i] != AV_PIX_FMT_NONE) { if(bg_pixelformat_ffmpeg_2_gavl(supported[i]) != GAVL_PIXELFORMAT_NONE) num++; i++; } gavl_fmts = malloc((num+1) * sizeof(gavl_fmts)); i = 0; num = 0; while(supported[i] != AV_PIX_FMT_NONE) { if((gavl_fmts[num] = bg_pixelformat_ffmpeg_2_gavl(supported[i])) != GAVL_PIXELFORMAT_NONE) num++; i++; } gavl_fmts[num] = GAVL_PIXELFORMAT_NONE; *gavl_fmt = gavl_pixelformat_get_best(*gavl_fmt, gavl_fmts, NULL); *ffmpeg_fmt = bg_pixelformat_gavl_2_ffmpeg(*gavl_fmt, do_convert, supported); free(gavl_fmts); } static const struct { enum AVSampleFormat ffmpeg_fmt; gavl_sample_format_t gavl_fmt; int planar; } sampleformats[] = { { AV_SAMPLE_FMT_U8, GAVL_SAMPLE_U8, 0 }, { AV_SAMPLE_FMT_S16, GAVL_SAMPLE_S16, 0 }, ///< signed 16 bits { AV_SAMPLE_FMT_S32, GAVL_SAMPLE_S32, 0 }, ///< signed 32 bits { AV_SAMPLE_FMT_FLT, GAVL_SAMPLE_FLOAT, 0 }, ///< float { AV_SAMPLE_FMT_DBL, GAVL_SAMPLE_DOUBLE, 0 }, ///< double { AV_SAMPLE_FMT_U8P, GAVL_SAMPLE_U8, 1 }, { AV_SAMPLE_FMT_S16P, GAVL_SAMPLE_S16, 1 }, ///< signed 16 bits { AV_SAMPLE_FMT_S32P, GAVL_SAMPLE_S32, 1 }, ///< signed 32 bits { AV_SAMPLE_FMT_FLTP, GAVL_SAMPLE_FLOAT, 1 }, ///< float { AV_SAMPLE_FMT_DBLP, GAVL_SAMPLE_DOUBLE, 1 }, ///< double }; gavl_sample_format_t bg_sample_format_ffmpeg_2_gavl(enum AVSampleFormat p, gavl_interleave_mode_t * il) { int i; for(i = 0; i < sizeof(sampleformats)/sizeof(sampleformats[0]); i++) { if(sampleformats[i].ffmpeg_fmt == p) { if(il) { if(sampleformats[i].planar) *il = GAVL_INTERLEAVE_NONE; else *il = GAVL_INTERLEAVE_ALL; } return sampleformats[i].gavl_fmt; } } return GAVL_SAMPLE_NONE; } /* Compressed stream support */ static const struct { gavl_codec_id_t gavl; enum AVCodecID ffmpeg; } codec_ids[] = { /* Audio */ { GAVL_CODEC_ID_ALAW, AV_CODEC_ID_PCM_ALAW }, //!< alaw 2:1 { GAVL_CODEC_ID_ULAW, AV_CODEC_ID_PCM_MULAW }, //!< mu-law 2:1 { GAVL_CODEC_ID_MP2, AV_CODEC_ID_MP2 }, //!< MPEG-1 audio layer II { GAVL_CODEC_ID_MP3, AV_CODEC_ID_MP3 }, //!< MPEG-1/2 audio layer 3 CBR/VBR { GAVL_CODEC_ID_AC3, AV_CODEC_ID_AC3 }, //!< AC3 { GAVL_CODEC_ID_AAC, AV_CODEC_ID_AAC }, //!< AAC as stored in quicktime/mp4 { GAVL_CODEC_ID_VORBIS, AV_CODEC_ID_VORBIS }, //!< Vorbis (segmented extradata and packets) { GAVL_CODEC_ID_AAC, AV_CODEC_ID_AAC }, //!< AAC { GAVL_CODEC_ID_DTS, AV_CODEC_ID_DTS }, //!< /* Video */ { GAVL_CODEC_ID_JPEG, AV_CODEC_ID_MJPEG }, //!< JPEG image { GAVL_CODEC_ID_PNG, AV_CODEC_ID_PNG }, //!< PNG image { GAVL_CODEC_ID_TIFF, AV_CODEC_ID_TIFF }, //!< TIFF image { GAVL_CODEC_ID_TGA, AV_CODEC_ID_TARGA }, //!< TGA image { GAVL_CODEC_ID_MPEG1, AV_CODEC_ID_MPEG1VIDEO }, //!< MPEG-1 video { GAVL_CODEC_ID_MPEG2, AV_CODEC_ID_MPEG2VIDEO }, //!< MPEG-2 video { GAVL_CODEC_ID_MPEG4_ASP, AV_CODEC_ID_MPEG4 }, //!< MPEG-4 ASP (a.k.a. Divx4) { GAVL_CODEC_ID_H264, AV_CODEC_ID_H264 }, //!< H.264 (Annex B) { GAVL_CODEC_ID_THEORA, AV_CODEC_ID_THEORA }, //!< Theora (segmented extradata { GAVL_CODEC_ID_DIRAC, AV_CODEC_ID_DIRAC }, //!< Complete DIRAC frames, sequence end code appended to last packet { GAVL_CODEC_ID_DV, AV_CODEC_ID_DVVIDEO }, //!< DV (several variants) { GAVL_CODEC_ID_VP8, AV_CODEC_ID_VP8 }, //!< VP8 (as in webm) { GAVL_CODEC_ID_DIV3, AV_CODEC_ID_MSMPEG4V3 }, //!< Old style Divx { GAVL_CODEC_ID_NONE, AV_CODEC_ID_NONE }, }; enum AVCodecID bg_codec_id_gavl_2_ffmpeg(gavl_codec_id_t gavl) { int i = 0; while(codec_ids[i].gavl != GAVL_CODEC_ID_NONE) { if(codec_ids[i].gavl == gavl) return codec_ids[i].ffmpeg; i++; } return AV_CODEC_ID_NONE; } gavl_codec_id_t bg_codec_id_ffmpeg_2_gavl(enum AVCodecID ffmpeg) { int i = 0; while(codec_ids[i].gavl != GAVL_CODEC_ID_NONE) { if(codec_ids[i].ffmpeg == ffmpeg) return codec_ids[i].gavl; i++; } return GAVL_CODEC_ID_NONE; } /* Channel layout */ struct { gavl_channel_id_t gavl_id; uint64_t ffmpeg_id; } channel_ids[] = { { GAVL_CHID_FRONT_CENTER, AV_CH_FRONT_CENTER }, { GAVL_CHID_FRONT_LEFT, AV_CH_FRONT_LEFT }, { GAVL_CHID_FRONT_RIGHT, AV_CH_FRONT_RIGHT }, { GAVL_CHID_FRONT_CENTER_LEFT, AV_CH_FRONT_LEFT_OF_CENTER }, { GAVL_CHID_FRONT_CENTER_RIGHT, AV_CH_FRONT_RIGHT_OF_CENTER }, { GAVL_CHID_REAR_LEFT, AV_CH_BACK_LEFT }, { GAVL_CHID_REAR_RIGHT, AV_CH_BACK_RIGHT }, { GAVL_CHID_REAR_CENTER, AV_CH_BACK_CENTER }, { GAVL_CHID_SIDE_LEFT, AV_CH_SIDE_LEFT }, { GAVL_CHID_SIDE_RIGHT, AV_CH_SIDE_RIGHT }, { GAVL_CHID_LFE, AV_CH_LOW_FREQUENCY }, // { GAVL_CHID_AUX, 0 } { GAVL_CHID_NONE, 0 }, }; static uint64_t chid_gavl_2_ffmpeg(gavl_channel_id_t gavl_id) { int i = 0; while(channel_ids[i].gavl_id != GAVL_CHID_NONE) { if(channel_ids[i].gavl_id == gavl_id) return channel_ids[i].ffmpeg_id; i++; } return 0; } static gavl_channel_id_t chid_ffmpeg_2_gavl(uint64_t ffmpeg_id) { int i = 0; while(channel_ids[i].gavl_id != GAVL_CHID_NONE) { if(channel_ids[i].ffmpeg_id == ffmpeg_id) return channel_ids[i].gavl_id; i++; } return GAVL_CHID_NONE; } uint64_t bg_ffmpeg_get_channel_mask(gavl_audio_format_t * format) { int i, idx; uint64_t mask = 1; uint64_t ret = 0; for(i = 0; i < format->num_channels; i++) ret |= chid_gavl_2_ffmpeg(format->channel_locations[i]); idx = 0; for(i = 0; i < 64; i++) { if(ret & mask) { format->channel_locations[idx] = chid_ffmpeg_2_gavl(mask); idx++; } mask <<= 1; } return ret; } bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_ac3.c000066400000000000000000000017201513225514200225470ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_AC3 #include "_e_ffmpeg_audio.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_adts.c000066400000000000000000000017211513225514200230350ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_ADTS #include "_e_ffmpeg_audio.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_aiff.c000066400000000000000000000017211513225514200230070ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_AIFF #include "_e_ffmpeg_audio.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_asf.c000066400000000000000000000017131513225514200226540ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_ASF #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_au.c000066400000000000000000000017171513225514200225140ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_AU #include "_e_ffmpeg_audio.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_avi.c000066400000000000000000000017131513225514200226620ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_AVI #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_dvd.c000066400000000000000000000017131513225514200226600ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_DVD #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_matroska.c000066400000000000000000000017201513225514200237220ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_MATROSKA #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_mp2.c000066400000000000000000000017201513225514200225770ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_MP2 #include "_e_ffmpeg_audio.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_mp4.c000066400000000000000000000017131513225514200226030ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_MP4 #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_mpeg.c000066400000000000000000000017141513225514200230340ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_MPEG #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_mpeg1video.c000066400000000000000000000017271513225514200241500ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_MPEG1VIDEO #include "_e_ffmpeg_video.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_mpeg2video.c000066400000000000000000000017271513225514200241510ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_MPEG2VIDEO #include "_e_ffmpeg_video.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_mpegts.c000066400000000000000000000017161513225514200234050ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_MPEGTS #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_vob.c000066400000000000000000000017131513225514200226710ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_VOB #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_webm.c000066400000000000000000000017141513225514200230360ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_WEBM #include "_e_ffmpeg.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/e_wma.c000066400000000000000000000017201513225514200226650ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #define FORMAT_WMA #include "_e_ffmpeg_audio.c" bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/ffmpeg_common.c000066400000000000000000000741271513225514200244240ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include "ffmpeg_common.h" #include #include #include #include #define LOG_DOMAIN "ffmpeg" //#define DUMP_AUDIO_PACKETS // #define DUMP_VIDEO_PACKETS // #define DUMP_TEXT_PACKETS static void copy_extradata(AVCodecParameters * avctx, const gavl_compression_info_t * ci); static void set_audio_compression(AVCodecParameters * avctx, const gavl_compression_info_t * ci) { if(ci->bitrate > 0) avctx->bit_rate = ci->bitrate; if(ci->block_align > 0) avctx->block_align = ci->block_align; copy_extradata(avctx, ci); } static void set_video_compression(AVCodecParameters * avctx, const gavl_compression_info_t * ci) { copy_extradata(avctx, ci); } void * bg_ffmpeg_create(const ffmpeg_format_info_t * format) { ffmpeg_priv_t * ret; ret = calloc(1, sizeof(*ret)); ret->format = format; ret->audio_parameters = bg_ffmpeg_create_audio_parameters(format); ret->video_parameters = bg_ffmpeg_create_video_parameters(format); return ret; } void bg_ffmpeg_set_callbacks(void * data, bg_encoder_callbacks_t * cb) { ffmpeg_priv_t * f = data; f->cb = cb; } void bg_ffmpeg_destroy(void * data) { ffmpeg_priv_t * priv; priv = data; if(priv->parameters) bg_parameter_info_destroy_array(priv->parameters); if(priv->audio_parameters) bg_parameter_info_destroy_array(priv->audio_parameters); if(priv->video_parameters) bg_parameter_info_destroy_array(priv->video_parameters); if(priv->audio_streams) free(priv->audio_streams); if(priv->video_streams) free(priv->video_streams); free(priv); } const bg_parameter_info_t * bg_ffmpeg_get_parameters(void * data) { ffmpeg_priv_t * priv; priv = data; return priv->parameters; } const bg_parameter_info_t * bg_ffmpeg_get_audio_parameters(void * data) { ffmpeg_priv_t * priv; priv = data; return priv->audio_parameters; } const bg_parameter_info_t * bg_ffmpeg_get_video_parameters(void * data) { ffmpeg_priv_t * priv; priv = data; return priv->video_parameters; } void bg_ffmpeg_set_parameter(void * data, const char * name, const gavl_value_t * v) { // ffmpeg_priv_t * priv = data; if(!name) { return; } } static void set_metadata(ffmpeg_priv_t * priv, const gavl_dictionary_t * m) { const char * val; if((val = gavl_dictionary_get_string(m, GAVL_META_TITLE))) av_dict_set(&priv->ctx->metadata, "title", val, 0); if((val = gavl_dictionary_get_string(m, GAVL_META_AUTHOR))) av_dict_set(&priv->ctx->metadata, "composer", val, 0); if((val = gavl_dictionary_get_string(m, GAVL_META_ALBUM))) av_dict_set(&priv->ctx->metadata, "album", val, 0); if((val = gavl_dictionary_get_string(m, GAVL_META_COPYRIGHT))) av_dict_set(&priv->ctx->metadata, "copyright", val, 0); if((val = gavl_dictionary_get_string(m, GAVL_META_COMMENT))) av_dict_set(&priv->ctx->metadata, "comment", val, 0); if((val = gavl_dictionary_get_string(m, GAVL_META_GENRE))) av_dict_set(&priv->ctx->metadata, "genre", val, 0); if((val = gavl_dictionary_get_string(m, GAVL_META_DATE))) av_dict_set(&priv->ctx->metadata, "date", val, 0); if((val = gavl_dictionary_get_string(m, GAVL_META_TRACKNUMBER))) av_dict_set(&priv->ctx->metadata, "track", val, 0); } static void set_chapters(AVFormatContext * ctx, const gavl_chapter_list_t * chapter_list, const gavl_dictionary_t * m) { #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,5,0) int i; gavl_time_t dur; int num_chapters; int timescale; const char * name; if(!chapter_list || !gavl_chapter_list_is_valid(chapter_list)) return; num_chapters = gavl_chapter_list_get_num(chapter_list); timescale = gavl_chapter_list_get_timescale(chapter_list); ctx->chapters = av_malloc(num_chapters * sizeof(*ctx->chapters)); ctx->nb_chapters = num_chapters; for(i = 0; i < num_chapters; i++) { ctx->chapters[i] = av_mallocz(sizeof(*(ctx->chapters[i]))); ctx->chapters[i]->time_base.num = 1; ctx->chapters[i]->time_base.den = timescale; ctx->chapters[i]->start = gavl_chapter_list_get_time(chapter_list, i); if(i < num_chapters - 1) ctx->chapters[i]->end = gavl_chapter_list_get_time(chapter_list, i+1); else { if(gavl_dictionary_get_long(m, GAVL_META_APPROX_DURATION, &dur)) ctx->chapters[i]->end = gavl_time_scale(timescale, dur); } if((name = gavl_chapter_list_get_label(chapter_list, i))) av_dict_set(&ctx->chapters[i]->metadata, "title", name, 0); } #else if(!chapter_list || !chapter_list->num_chapters) return; gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Not writing chapters (ffmpeg version too old)"); #endif } static char*ffmpeg_string(char*instr) { size_t len = strlen(instr); char*outstr = av_malloc(len+1); if(outstr) { strcpy(outstr, instr); outstr[len] = 0; } return outstr; } static int ffmpeg_open(void * data, const char * filename, gavl_io_t * io, const gavl_dictionary_t * metadata) { const gavl_dictionary_t * cl; ffmpeg_priv_t * priv; const AVOutputFormat *fmt; priv = data; if(!priv->format) return 0; /* Initialize format context */ fmt = bg_ffmpeg_guess_format(priv->format); if(!fmt) return 0; priv->ctx = avformat_alloc_context(); if(filename) { if(!strcmp(filename, "-")) { if(!(priv->format->flags & FLAG_PIPE)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "%s cannot be written to a pipe", priv->format->name); return 0; } priv->ctx->url = ffmpeg_string("pipe:"); } else { char * tmp_string = gavl_filename_ensure_extension(filename, priv->format->extension); if(!bg_encoder_cb_create_output_file(priv->cb, tmp_string)) { free(tmp_string); return 0; } priv->ctx->url = ffmpeg_string(tmp_string); free(tmp_string); } } else if(io) { if(!(priv->format->flags & FLAG_PIPE) && !gavl_io_can_seek(io)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "%s cannot be written to a pipe", priv->format->name); return 0; } priv->io = io; priv->ctx->flags |= AVFMT_FLAG_CUSTOM_IO; } else return 0; priv->ctx->max_delay = (int)(0.7 * (float)AV_TIME_BASE); priv->ctx->oformat = fmt; /* Add metadata */ if(metadata) { set_metadata(priv, metadata); if((cl = gavl_dictionary_get_chapter_list(metadata))) set_chapters(priv->ctx, cl, metadata); } return 1; } int bg_ffmpeg_open(void * data, const char * filename, const gavl_dictionary_t * metadata) { return ffmpeg_open(data, filename, NULL, metadata); } int bg_ffmpeg_open_io(void * data, gavl_io_t * io, const gavl_dictionary_t * metadata) { return ffmpeg_open(data, NULL, io, metadata); } static void init_stream(ffmpeg_priv_t * priv, bg_ffmpeg_stream_common_t * com) { com->pkt = av_packet_alloc(); com->stream = avformat_new_stream(priv->ctx, NULL); com->m = gavl_stream_get_metadata_nc(&com->s); com->ffmpeg = priv; } int bg_ffmpeg_add_audio_stream(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format) { ffmpeg_priv_t * priv; bg_ffmpeg_audio_stream_t * st; const char *lang; priv = data; priv->audio_streams = realloc(priv->audio_streams, (priv->num_audio_streams+1)*sizeof(*priv->audio_streams)); st = priv->audio_streams + priv->num_audio_streams; memset(st, 0, sizeof(*st)); gavl_init_audio_stream(&st->com.s); init_stream(priv, &st->com); st->format = gavl_stream_get_audio_format_nc(&st->com.s); gavl_audio_format_copy(st->format, format); bg_ffmpeg_set_audio_format_params(st->com.stream->codecpar, st->format); st->com.stream->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; /* Set language */ lang = gavl_dictionary_get_string(m, GAVL_META_LANGUAGE); if(lang) av_dict_set(&st->com.stream->metadata, "language", lang, 0); priv->num_audio_streams++; return priv->num_audio_streams-1; } int bg_ffmpeg_add_video_stream(void * data, const gavl_dictionary_t * m, const gavl_video_format_t * format) { ffmpeg_priv_t * priv; bg_ffmpeg_video_stream_t * st; priv = data; priv->video_streams = realloc(priv->video_streams, (priv->num_video_streams+1)*sizeof(*priv->video_streams)); st = priv->video_streams + priv->num_video_streams; memset(st, 0, sizeof(*st)); gavl_init_video_stream(&st->com.s); init_stream(priv, &st->com); st->format = gavl_stream_get_video_format_nc(&st->com.s); gavl_video_format_copy(st->format, format); st->com.stream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; bg_ffmpeg_set_video_dimensions_params(st->com.stream->codecpar, format); st->dts = GAVL_TIME_UNDEFINED; priv->num_video_streams++; return priv->num_video_streams-1; } /* int bg_ffmpeg_write_subtitle_text(void * data,const char * text, int64_t start, int64_t duration, int stream) */ static gavl_sink_status_t write_text_packet_func(void * data, gavl_packet_t * p) { bg_ffmpeg_text_stream_t * st = data; ffmpeg_priv_t * priv = st->com.ffmpeg; #ifdef DUMP_TEXT_PACKETS bg_dprintf("write_text_packet\n"); gavl_packet_dump(p); #endif st->pkt->data = p->buf.buf; st->pkt->size = p->buf.len + 1; // Let's hope the packet got padded!!! #if 1 st->pkt->pts= av_rescale_q(p->pts, st->time_base, st->com.stream->time_base); st->pkt->duration= av_rescale_q(p->duration, st->time_base, st->com.stream->time_base); #endif // pkt.convergence_duration = pkt.duration; st->pkt->dts = st->pkt->pts; st->pkt->stream_index = st->com.stream->index; if(av_interleaved_write_frame(priv->ctx, st->pkt) != 0) { priv->got_error = 1; return GAVL_SINK_ERROR; } st->pkt->data = NULL; return GAVL_SINK_OK; } int bg_ffmpeg_add_text_stream(void * data, const gavl_dictionary_t * m, uint32_t * timescale) { ffmpeg_priv_t * priv; bg_ffmpeg_text_stream_t * st; const char * lang; priv = data; priv->text_streams = realloc(priv->text_streams, (priv->num_text_streams+1)*sizeof(*priv->text_streams)); st = priv->text_streams + priv->num_text_streams; memset(st, 0, sizeof(*st)); init_stream(priv, &st->com); st->com.stream->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; if((lang = gavl_dictionary_get_string(m, GAVL_META_LANGUAGE))) av_dict_set(&st->com.stream->metadata, "language", lang, 0); st->com.stream->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; st->com.stream->codecpar->codec_id = AV_CODEC_ID_TEXT; st->time_base.num = 1; st->time_base.den = *timescale; /* Might get changed */ st->com.stream->time_base.num = 1; st->com.stream->time_base.den = *timescale; priv->num_text_streams++; return priv->num_text_streams-1; } void bg_ffmpeg_set_audio_parameter(void * data, int stream, const char * name, const gavl_value_t * v) { bg_ffmpeg_audio_stream_t * st; ffmpeg_priv_t * priv = data; st = priv->audio_streams + stream; if(name && !strcmp(name, "codec") && !st->com.codec) { enum AVCodecID id; const gavl_dictionary_t * codec; const char * codec_name; codec = gavl_value_get_dictionary(v); codec_name = gavl_dictionary_get_string(codec, BG_CFG_TAG_NAME); if((id = bg_ffmpeg_find_audio_encoder(st->com.ffmpeg->format, codec_name))) { st->com.codec = bg_ffmpeg_codec_create(AVMEDIA_TYPE_AUDIO, st->com.stream->codecpar, id, st->com.ffmpeg->format); } } bg_ffmpeg_codec_set_parameter(st->com.codec, name, v); } void bg_ffmpeg_set_video_parameter(void * data, int stream, const char * name, const gavl_value_t * v) { bg_ffmpeg_video_stream_t * st; ffmpeg_priv_t * priv = data; st = priv->video_streams + stream; if(name && !strcmp(name, "codec") && !st->com.codec) { enum AVCodecID id; const gavl_dictionary_t * codec = gavl_value_get_dictionary(v); const char * codec_name = gavl_dictionary_get_string(codec, BG_CFG_TAG_NAME); if((id = bg_ffmpeg_find_video_encoder(st->com.ffmpeg->format, codec_name))) { st->com.codec = bg_ffmpeg_codec_create(AVMEDIA_TYPE_VIDEO, st->com.stream->codecpar, id, st->com.ffmpeg->format); } } bg_ffmpeg_codec_set_parameter(st->com.codec, name, v); } int bg_ffmpeg_set_video_pass(void * data, int stream, int pass, int total_passes, const char * stats_filename) { ffmpeg_priv_t * priv; bg_ffmpeg_video_stream_t * st; priv = data; st = &priv->video_streams[stream]; bg_ffmpeg_codec_set_video_pass(st->com.codec, pass, total_passes, stats_filename); return 1; } static int64_t rescale_video_timestamp(bg_ffmpeg_video_stream_t * st, int64_t ts) { AVRational framerate; if(st->format->framerate_mode == GAVL_FRAMERATE_CONSTANT) { framerate.num = st->format->frame_duration; framerate.den = st->format->timescale; return av_rescale_q(ts / st->format->frame_duration, framerate, st->com.stream->time_base); } else { framerate.num = 1; framerate.den = st->format->timescale; return av_rescale_q(ts, framerate, st->com.stream->time_base); } } static gavl_sink_status_t write_video_packet_func(void * priv, gavl_packet_t * packet) { bg_ffmpeg_video_stream_t * st = priv; ffmpeg_priv_t * f = st->com.ffmpeg; #ifdef DUMP_VIDEO_PACKETS bg_dprintf("\nwrite_video_packet\n"); gavl_packet_dump(packet); #endif if(packet->pts == GAVL_TIME_UNDEFINED) return 1; // Drop undecodable packet st->com.pkt->data = packet->buf.buf; st->com.pkt->size = packet->buf.len; st->com.pkt->pts = rescale_video_timestamp(st, packet->pts); st->com.pkt->dts = rescale_video_timestamp(st, packet->dts); st->com.pkt->duration = rescale_video_timestamp(st, packet->duration); // fprintf(stderr, "Video PTS: %"PRId64" Duration: %"PRId64"\n", st->com.pkt->pts, st->com.pkt->duration); if(st->com.ci.flags & GAVL_COMPRESSION_HAS_B_FRAMES) { if(st->dts == GAVL_TIME_UNDEFINED) st->dts = packet->pts - 3*packet->duration; st->com.pkt->dts= rescale_video_timestamp(st, st->dts); st->dts += packet->duration; } else st->com.pkt->dts = st->com.pkt->pts; if(packet->flags & GAVL_PACKET_KEYFRAME) st->com.pkt->flags |= AV_PKT_FLAG_KEY; else st->com.pkt->flags &= ~AV_PKT_FLAG_KEY; st->com.pkt->stream_index= st->com.stream->index; /* write the compressed frame in the media file */ if(av_interleaved_write_frame(f->ctx, st->com.pkt) != 0) { f->got_error = 1; return GAVL_SINK_ERROR; } st->com.pkt->data = NULL; return GAVL_SINK_OK; } static gavl_sink_status_t write_audio_packet_func(void * data, gavl_packet_t * packet) { ffmpeg_priv_t * f; bg_ffmpeg_audio_stream_t * st = data; AVRational time_base; f = st->com.ffmpeg; #ifdef DUMP_AUDIO_PACKETS bg_dprintf("write_audio_packet\n"); gavl_packet_dump(packet); #endif if(packet->pts == GAVL_TIME_UNDEFINED) return 1; // Drop undecodable packet st->com.pkt->data = packet->buf.buf; st->com.pkt->size = packet->buf.len; time_base.num = 1; time_base.den = st->format->samplerate; // fprintf(stderr, "AUDIO 1 PTS: %"PRId64" Duration: %"PRId64"\n", packet->pts, packet->duration); st->com.pkt->pts= av_rescale_q(packet->pts, time_base, st->com.stream->time_base); st->com.pkt->duration= av_rescale_q(packet->duration, time_base, st->com.stream->time_base); st->com.pkt->dts = st->com.pkt->pts; // fprintf(stderr, "AUDIO 2 PTS: %"PRId64" Duration: %"PRId64"\n", st->com.pkt->pts, st->com.pkt->duration); if(st->com.ci.flags & GAVL_COMPRESSION_SBR) { st->com.pkt->pts /= 2; st->com.pkt->dts /= 2; st->com.pkt->duration /= 2; } st->com.pkt->flags |= AV_PKT_FLAG_KEY; st->com.pkt->stream_index= st->com.stream->index; /* write the compressed frame in the media file */ if(av_interleaved_write_frame(f->ctx, st->com.pkt) != 0) { f->got_error = 1; return GAVL_SINK_ERROR; } st->com.pkt->data = NULL; return GAVL_SINK_OK; } static int open_audio_encoder(bg_ffmpeg_audio_stream_t * st) { st->com.psink = gavl_packet_sink_create(NULL, write_audio_packet_func, st); if(st->com.flags & STREAM_IS_COMPRESSED) { bg_ffmpeg_set_audio_format_params(st->com.stream->codecpar, st->format); if(st->com.ci.flags & GAVL_COMPRESSION_SBR) st->com.stream->codecpar->sample_rate /= 2; return 1; } st->sink = bg_ffmpeg_codec_open_audio(st->com.codec, &st->com.s); if(!st->sink) return 0; gavl_stream_get_compression_info(&st->com.s, &st->com.ci); set_audio_compression(st->com.stream->codecpar, &st->com.ci); st->com.stream->codecpar->codec_id = st->com.codec->id; bg_ffmpeg_codec_set_packet_sink(st->com.codec, st->com.psink); st->com.flags |= STREAM_ENCODER_INITIALIZED; return 1; } static void set_framerate(bg_ffmpeg_video_stream_t * st) { if(st->format->framerate_mode == GAVL_FRAMERATE_CONSTANT) { st->com.stream->time_base.den = st->format->timescale; st->com.stream->time_base.num = st->format->frame_duration; } else { st->com.stream->time_base.den = st->format->timescale; st->com.stream->time_base.num = 1; } } static int open_video_encoder(bg_ffmpeg_video_stream_t * st) { st->com.psink = gavl_packet_sink_create(NULL, write_video_packet_func, st); if(st->com.flags & STREAM_IS_COMPRESSED) { set_framerate(st); bg_ffmpeg_set_video_dimensions_params(st->com.stream->codecpar, st->format); st->com.stream->sample_aspect_ratio.num = st->com.stream->codecpar->sample_aspect_ratio.num; st->com.stream->sample_aspect_ratio.den = st->com.stream->codecpar->sample_aspect_ratio.den; return 1; } st->sink = bg_ffmpeg_codec_open_video(st->com.codec, &st->com.s); if(!st->sink) return 0; gavl_stream_get_compression_info(&st->com.s, &st->com.ci); set_video_compression(st->com.stream->codecpar, &st->com.ci); st->com.stream->codecpar->codec_id = st->com.codec->id; bg_ffmpeg_codec_set_packet_sink(st->com.codec, st->com.psink); st->com.stream->sample_aspect_ratio.num = st->com.stream->codecpar->sample_aspect_ratio.num; st->com.stream->sample_aspect_ratio.den = st->com.stream->codecpar->sample_aspect_ratio.den; // fprintf(stderr, "Opened video encoder\n"); // gavl_compression_info_dump(&st->com.ci); st->com.flags |= STREAM_ENCODER_INITIALIZED; return 1; } #define IO_BUFFER_SIZE 2048 // Too large values increase the latency #if LIBAVFORMAT_VERSION_MAJOR < 61 static int io_write(void * opaque, uint8_t * buf, int size) #else static int io_write(void * opaque, const uint8_t * buf, int size) #endif { return gavl_io_write_data(opaque, buf, size); } static int64_t io_seek(void * opaque, int64_t off, int whence) { return gavl_io_seek(opaque, off, whence); } int bg_ffmpeg_start(void * data) { ffmpeg_priv_t * priv; int i; priv = data; #if LIBAVFORMAT_VERSION_MAJOR < 54 /* set the output parameters (must be done even if no parameters). */ if(av_set_parameters(priv->ctx, NULL) < 0) { return 0; } #endif /* Open encoders */ for(i = 0; i < priv->num_audio_streams; i++) { if(!open_audio_encoder(&priv->audio_streams[i])) return 0; } for(i = 0; i < priv->num_video_streams; i++) { if(!open_video_encoder(&priv->video_streams[i])) return 0; } for(i = 0; i < priv->num_text_streams ; i++) { priv->text_streams[i].com.psink = gavl_packet_sink_create(NULL, write_text_packet_func, &priv->text_streams[i]); } if(priv->io) { priv->io_buffer = av_malloc(IO_BUFFER_SIZE); priv->ctx->pb = avio_alloc_context(priv->io_buffer, IO_BUFFER_SIZE, 1, // write_flag priv->io, NULL, io_write, gavl_io_can_seek(priv->io) ? io_seek : NULL); } else if(avio_open(&priv->ctx->pb, priv->ctx->url, AVIO_FLAG_WRITE) < 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "avio_open failed"); return 0; } #if LIBAVFORMAT_VERSION_MAJOR < 54 if(av_write_header(priv->ctx)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "av_write_header failed"); return 0; } #else if(avformat_write_header(priv->ctx, NULL)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "avformat_write_header failed"); return 0; } #endif priv->initialized = 1; return 1; } void bg_ffmpeg_get_audio_format(void * data, int stream, gavl_audio_format_t*ret) { ffmpeg_priv_t * priv; priv = data; gavl_audio_format_copy(ret, priv->audio_streams[stream].format); } gavl_audio_sink_t * bg_ffmpeg_get_audio_sink(void * data, int stream) { ffmpeg_priv_t * priv; priv = data; return priv->audio_streams[stream].sink; } gavl_video_sink_t * bg_ffmpeg_get_video_sink(void * data, int stream) { ffmpeg_priv_t * priv; priv = data; return priv->video_streams[stream].sink; } static void close_common(bg_ffmpeg_stream_common_t * com) { if(com->codec) { bg_ffmpeg_codec_destroy(com->codec); com->codec = NULL; } if(com->pkt) av_packet_free(&com->pkt); gavl_compression_info_free(&com->ci); } static int close_audio_encoder(ffmpeg_priv_t * priv, bg_ffmpeg_audio_stream_t * st) { close_common(&st->com); return 1; } static int close_text_encoder(ffmpeg_priv_t * priv, bg_ffmpeg_text_stream_t * st) { close_common(&st->com); return 1; } static int close_video_encoder(ffmpeg_priv_t * priv, bg_ffmpeg_video_stream_t * st) { close_common(&st->com); return 1; } int bg_ffmpeg_close(void * data, int do_delete) { ffmpeg_priv_t * priv; int i; priv = data; // Flush the streams for(i = 0; i < priv->num_audio_streams; i++) { bg_ffmpeg_audio_stream_t * st = &priv->audio_streams[i]; if(!(st->com.flags & STREAM_IS_COMPRESSED)) bg_ffmpeg_codec_flush(st->com.codec); } for(i = 0; i < priv->num_video_streams; i++) { bg_ffmpeg_video_stream_t * st = &priv->video_streams[i]; if(!(st->com.flags & STREAM_IS_COMPRESSED)) bg_ffmpeg_codec_flush(st->com.codec); } if(priv->initialized) { av_write_trailer(priv->ctx); if(priv->io) av_free(priv->ctx->pb); else avio_close(priv->ctx->pb); } // Close the encoders for(i = 0; i < priv->num_audio_streams; i++) { bg_ffmpeg_audio_stream_t * st = &priv->audio_streams[i]; close_audio_encoder(priv, st); if(st->com.psink) gavl_packet_sink_destroy(st->com.psink); } for(i = 0; i < priv->num_video_streams; i++) { bg_ffmpeg_video_stream_t * st = &priv->video_streams[i]; close_video_encoder(priv, st); if(st->com.psink) gavl_packet_sink_destroy(st->com.psink); } for(i = 0; i < priv->num_text_streams; i++) { bg_ffmpeg_text_stream_t * st = &priv->text_streams[i]; close_text_encoder(priv, st); if(st->com.psink) gavl_packet_sink_destroy(st->com.psink); if(st->pkt) av_packet_free(&st->pkt); } if(do_delete && !priv->io) remove(priv->ctx->url); if(priv->io_buffer) av_free(priv->io_buffer); avformat_free_context(priv->ctx); priv->ctx = NULL; return 1; } int bg_ffmpeg_writes_compressed_audio(void * priv, const gavl_audio_format_t * format, const gavl_compression_info_t * info) { int i; enum AVCodecID ffmpeg_id; ffmpeg_priv_t * f = priv; ffmpeg_id = bg_codec_id_gavl_2_ffmpeg(info->id); i = 0; while(f->format->audio_codecs[i] != AV_CODEC_ID_NONE) { if(f->format->audio_codecs[i] == ffmpeg_id) return 1; i++; } return 0; } int bg_ffmpeg_writes_compressed_video(void * priv, const gavl_video_format_t * format, const gavl_compression_info_t * info) { int i; enum AVCodecID ffmpeg_id; ffmpeg_priv_t * f = priv; ffmpeg_id = bg_codec_id_gavl_2_ffmpeg(info->id); i = 0; while(f->format->video_codecs[i] != AV_CODEC_ID_NONE) { if(f->format->video_codecs[i] == ffmpeg_id) return 1; i++; } return 0; } static void copy_extradata(AVCodecParameters * avctx, const gavl_compression_info_t * ci) { // fprintf(stderr, "Copying extradata %d bytes\n", ci->global_header_len); if(ci->codec_header.len) { avctx->extradata_size = ci->codec_header.len; avctx->extradata = av_malloc(avctx->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); memcpy(avctx->extradata, ci->codec_header.buf, ci->codec_header.len); memset(avctx->extradata + avctx->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); // avctx->flags |= CODEC_FLAG_GLOBAL_HEADER; } } int bg_ffmpeg_add_audio_stream_compressed(void * priv, const gavl_dictionary_t * m, const gavl_audio_format_t * format, const gavl_compression_info_t * info) { int ret; bg_ffmpeg_audio_stream_t * st; ffmpeg_priv_t * f = priv; ret = bg_ffmpeg_add_audio_stream(priv, m, format); st = f->audio_streams + ret; gavl_compression_info_copy(&st->com.ci, info); st->com.flags |= STREAM_IS_COMPRESSED; st->com.stream->codecpar->codec_id = bg_codec_id_gavl_2_ffmpeg(st->com.ci.id); st->com.stream->time_base.num = 1; st->com.stream->time_base.den = st->format->samplerate; if(st->com.ci.bitrate) { st->com.stream->codecpar->bit_rate = st->com.ci.bitrate; // st->com.stream->codecpar->rc_max_rate = st->com.ci.bitrate; } /* Set compression data */ set_audio_compression(st->com.stream->codecpar, &st->com.ci); return ret; } int bg_ffmpeg_add_video_stream_compressed(void * priv, const gavl_dictionary_t * m, const gavl_video_format_t * format, const gavl_compression_info_t * info) { int ret; bg_ffmpeg_video_stream_t * st; ffmpeg_priv_t * f = priv; ret = bg_ffmpeg_add_video_stream(priv, m, format); st = f->video_streams + ret; gavl_compression_info_copy(&st->com.ci, info); st->com.flags |= STREAM_IS_COMPRESSED; st->com.stream->codecpar->codec_id = bg_codec_id_gavl_2_ffmpeg(st->com.ci.id); st->dts = GAVL_TIME_UNDEFINED; if(st->com.ci.bitrate) st->com.stream->codecpar->bit_rate = st->com.ci.bitrate; if(st->com.ci.block_align) st->com.stream->codecpar->block_align = st->com.ci.block_align; // if(st->com.ci.video_buffer_size) // st->com.stream->codecpar->rc_buffer_size = st->com.ci.video_buffer_size * 8; /* Set compression data */ set_video_compression(st->com.stream->codecpar, &st->com.ci); return ret; } gavl_packet_sink_t * bg_ffmpeg_get_audio_packet_sink(void * data, int stream) { ffmpeg_priv_t * f = data; return f->audio_streams[stream].com.psink; } gavl_packet_sink_t * bg_ffmpeg_get_video_packet_sink(void * data, int stream) { ffmpeg_priv_t * f = data; return f->video_streams[stream].com.psink; } gavl_packet_sink_t * bg_ffmpeg_get_text_packet_sink(void * data, int stream) { ffmpeg_priv_t * f = data; return f->text_streams[stream].com.psink; } const AVOutputFormat * bg_ffmpeg_guess_format(const ffmpeg_format_info_t * format) { if(format->ffmpeg_name) return av_guess_format(format->ffmpeg_name, NULL, NULL); else return av_guess_format(format->name, NULL, NULL); } bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/ffmpeg_common.h000066400000000000000000000302461513225514200244230ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #if LIBAVCODEC_VERSION_MAJOR >= 61 #include #endif #ifdef HAVE_LIBAVCORE_AVCORE_H #include #endif #if LIBAVCODEC_VERSION_MAJOR >= 53 #define guess_format(a, b, c) av_guess_format(a, b, c) #endif #define FLAG_CONSTANT_FRAMERATE (1<<0) #define FLAG_INTRA_ONLY (1<<1) #define FLAG_B_FRAMES (1<<2) #define FLAG_PIPE (1<<3) // Format can be written savely to pipes #define FLAG_EXTRADATA (1<<4) // Encoder has extradata typedef struct { const char * name; const char * long_name; enum AVCodecID id; const bg_parameter_info_t * parameters; int flags; const bg_encoder_framerate_t * framerates; } ffmpeg_codec_info_t; typedef struct { char * label; const char * name; const char * ffmpeg_name; const char * extension; int max_audio_streams; int max_video_streams; const enum AVCodecID * audio_codecs; const enum AVCodecID * video_codecs; int flags; } ffmpeg_format_info_t; /* codecs.c */ const AVOutputFormat * bg_ffmpeg_guess_format(const ffmpeg_format_info_t * format); bg_parameter_info_t * bg_ffmpeg_create_audio_parameters(const ffmpeg_format_info_t * format_info); bg_parameter_info_t * bg_ffmpeg_create_video_parameters(const ffmpeg_format_info_t * format_info); bg_parameter_info_t * bg_ffmpeg_create_parameters(const ffmpeg_format_info_t * format_info); void bg_ffmpeg_set_codec_parameter(AVCodecContext * ctx, AVDictionary ** options, const char * name, const gavl_value_t * val); enum AVCodecID bg_ffmpeg_find_audio_encoder(const ffmpeg_format_info_t * format, const char * name); enum AVCodecID bg_ffmpeg_find_video_encoder(const ffmpeg_format_info_t * format, const char * name); const char * bg_ffmpeg_get_codec_name(enum AVCodecID id); const bg_parameter_info_t * bg_ffmpeg_get_codec_parameters(enum AVCodecID id, int type); const ffmpeg_codec_info_t * bg_ffmpeg_get_codec_info(enum AVCodecID id, int type); /* * Standalone codecs */ /* * Create a codec context. * If avctx is NULL, it will be created and destroyed. * If id is CODEC_ID_NONE, a "codec" parameter will be supported * * Type is one of CODEC_TYPE_VIDEO or CODEC_TYPE_AUDIO */ typedef struct bg_ffmpeg_codec_context_s bg_ffmpeg_codec_context_t; struct bg_ffmpeg_codec_context_s { const AVCodec * codec; AVCodecContext * avctx; gavl_packet_sink_t * psink; gavl_audio_sink_t * asink; gavl_video_sink_t * vsink; AVDictionary * options; gavl_packet_t gp; AVPacket * pkt; int type; /* Multipass stuff */ char * stats_filename; int pass; int total_passes; FILE * stats_file; /* Only non-null within the format writer */ const ffmpeg_format_info_t * format; enum AVCodecID id; int flags; gavl_audio_format_t afmt; gavl_video_format_t vfmt; /* * ffmpeg frame (same for audio and video) */ AVFrame * frame; /* Audio frame to encode */ gavl_audio_frame_t * aframe; int block_align; /* * Video frame to encode. * Used only when we need to convert formats. */ gavl_video_frame_t * vframe; int64_t in_pts; int64_t out_pts; bg_encoder_framerate_t fr; bg_encoder_pts_cache_t * pc; /* Trivial pixelformat conversions because we are too lazy to support all variants in gavl */ void (*convert_frame)(bg_ffmpeg_codec_context_t * ctx, gavl_video_frame_t * f); }; void bg_ffmpeg_set_video_dimensions_avctx(AVCodecContext * avctx, const gavl_video_format_t * fmt); void bg_ffmpeg_set_video_dimensions_params(AVCodecParameters * avctx, const gavl_video_format_t * fmt); int bg_ffmpeg_set_audio_format_avctx(AVCodecContext * avctx, const AVCodec * codec, gavl_audio_format_t * fmt); void bg_ffmpeg_set_audio_format_params(AVCodecParameters * avctx, gavl_audio_format_t * fmt); bg_ffmpeg_codec_context_t * bg_ffmpeg_codec_create(int type, AVCodecParameters * avctx, enum AVCodecID id, const ffmpeg_format_info_t * format); const bg_parameter_info_t * bg_ffmpeg_codec_get_parameters(bg_ffmpeg_codec_context_t * ctx); void bg_ffmpeg_codec_set_parameter(bg_ffmpeg_codec_context_t * ctx, const char * name, const gavl_value_t * val); int bg_ffmpeg_codec_set_video_pass(bg_ffmpeg_codec_context_t * ctx, int pass, int total_passes, const char * stats_filename); gavl_audio_sink_t * bg_ffmpeg_codec_open_audio(bg_ffmpeg_codec_context_t * ctx, gavl_dictionary_t * s); gavl_video_sink_t * bg_ffmpeg_codec_open_video(bg_ffmpeg_codec_context_t * ctx, gavl_dictionary_t * s); void bg_ffmpeg_codec_destroy(bg_ffmpeg_codec_context_t * ctx); void bg_ffmpeg_codec_set_packet_sink(bg_ffmpeg_codec_context_t * ctx, gavl_packet_sink_t * psink); void bg_ffmpeg_codec_flush(bg_ffmpeg_codec_context_t * ctx); /* ffmpeg_common.c */ typedef struct ffmpeg_priv_s ffmpeg_priv_t; #define STREAM_ENCODER_INITIALIZED (1<<0) #define STREAM_IS_COMPRESSED (1<<1) typedef struct { AVStream * stream; AVPacket * pkt; bg_ffmpeg_codec_context_t * codec; int flags; gavl_packet_sink_t * psink; ffmpeg_priv_t * ffmpeg; gavl_compression_info_t ci; AVDictionary * options; enum AVCodecID codec_id; // Set after initializaiton gavl_dictionary_t s; gavl_dictionary_t * m; } bg_ffmpeg_stream_common_t; typedef struct { bg_ffmpeg_stream_common_t com; gavl_audio_sink_t * sink; gavl_audio_format_t * format; } bg_ffmpeg_audio_stream_t; typedef struct { bg_ffmpeg_stream_common_t com; gavl_video_sink_t * sink; gavl_video_format_t * format; int64_t dts; } bg_ffmpeg_video_stream_t; typedef struct { bg_ffmpeg_stream_common_t com; AVRational time_base; AVPacket * pkt; } bg_ffmpeg_text_stream_t; struct ffmpeg_priv_s { int num_audio_streams; int num_video_streams; int num_text_streams; bg_ffmpeg_audio_stream_t * audio_streams; bg_ffmpeg_video_stream_t * video_streams; bg_ffmpeg_text_stream_t * text_streams; AVFormatContext * ctx; bg_parameter_info_t * audio_parameters; bg_parameter_info_t * video_parameters; bg_parameter_info_t * parameters; const ffmpeg_format_info_t * format; int initialized; int got_error; // Needed when we write compressed video packets with B-frames int need_pts_offset; bg_encoder_callbacks_t * cb; gavl_io_t * io; unsigned char * io_buffer; }; extern const bg_encoder_framerate_t bg_ffmpeg_mpeg_framerates[]; void * bg_ffmpeg_create(const ffmpeg_format_info_t * format); void bg_ffmpeg_destroy(void*); void bg_ffmpeg_set_callbacks(void * data, bg_encoder_callbacks_t * cb); const bg_parameter_info_t * bg_ffmpeg_get_parameters(void * data); void bg_ffmpeg_set_parameter(void * data, const char * name, const gavl_value_t * v); int bg_ffmpeg_open(void * data, const char * filename, const gavl_dictionary_t * metadata); int bg_ffmpeg_open_io(void * data, gavl_io_t * io, const gavl_dictionary_t * metadata); const bg_parameter_info_t * bg_ffmpeg_get_audio_parameters(void * data); const bg_parameter_info_t * bg_ffmpeg_get_video_parameters(void * data); int bg_ffmpeg_add_audio_stream(void * data, const gavl_dictionary_t * metadata, const gavl_audio_format_t * format); int bg_ffmpeg_add_video_stream(void * data, const gavl_dictionary_t * metadata, const gavl_video_format_t * format); int bg_ffmpeg_add_text_stream(void * data, const gavl_dictionary_t * metadata, uint32_t * timescale); void bg_ffmpeg_set_audio_parameter(void * data, int stream, const char * name, const gavl_value_t * v); void bg_ffmpeg_set_video_parameter(void * data, int stream, const char * name, const gavl_value_t * v); int bg_ffmpeg_set_video_pass(void * data, int stream, int pass, int total_passes, const char * stats_file); int bg_ffmpeg_start(void * data); void bg_ffmpeg_get_audio_format(void * data, int stream, gavl_audio_format_t*ret); gavl_audio_sink_t * bg_ffmpeg_get_audio_sink(void * data, int stream); gavl_video_sink_t * bg_ffmpeg_get_video_sink(void * data, int stream); gavl_packet_sink_t * bg_ffmpeg_get_audio_packet_sink(void * data, int stream); gavl_packet_sink_t * bg_ffmpeg_get_video_packet_sink(void * data, int stream); gavl_packet_sink_t * bg_ffmpeg_get_text_packet_sink(void * data, int stream); int bg_ffmpeg_write_subtitle_text(void * data,const char * text, int64_t start, int64_t duration, int stream); int bg_ffmpeg_close(void * data, int do_delete); #define CONVERT_ENDIAN (1<<8) #define CONVERT_OTHER (1<<9) void bg_ffmpeg_choose_pixelformat(const enum AVPixelFormat * supported, enum AVPixelFormat * ffmpeg_fmt, gavl_pixelformat_t * gavl_fmt, int * do_convert); gavl_sample_format_t bg_sample_format_ffmpeg_2_gavl(enum AVSampleFormat p, gavl_interleave_mode_t * il); enum AVCodecID bg_codec_id_gavl_2_ffmpeg(gavl_codec_id_t gavl); gavl_codec_id_t bg_codec_id_ffmpeg_2_gavl(enum AVCodecID ffmpeg); uint64_t bg_ffmpeg_get_channel_mask(gavl_audio_format_t * format); /* Compressed stream support */ int bg_ffmpeg_writes_compressed_audio(void * priv, const gavl_audio_format_t * format, const gavl_compression_info_t * info); int bg_ffmpeg_writes_compressed_video(void * priv, const gavl_video_format_t * format, const gavl_compression_info_t * info); int bg_ffmpeg_add_audio_stream_compressed(void * priv, const gavl_dictionary_t * metadata, const gavl_audio_format_t * format, const gavl_compression_info_t * info); int bg_ffmpeg_add_video_stream_compressed(void * priv, const gavl_dictionary_t * metadata, const gavl_video_format_t * format, const gavl_compression_info_t * info); bplaum-gmerlin-encoders-172394d/plugins/ffmpeg/params.h000066400000000000000000001123151513225514200230700ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ /* * IMPORTANT: To keep the mess at a reasonable level, * *all* parameters *must* appear in the same order as in * the AVCocecContext structure, except the flags, which come at the very end */ /** Rate control */ #define PARAM_BITRATE_AUDIO \ { \ .name = "ff_bit_rate_audio", \ .long_name = TRS("Bit rate (kbps)"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } /** Rate control */ #define PARAM_BITRATE_VIDEO \ { \ .name = "ff_bit_rate_video", \ .long_name = TRS("Bit rate (kbps)"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(800), \ } /** Rate control */ #define PARAM_BITRATE_TOLERANCE \ { \ .name = "ff_bit_rate_tolerance", \ .long_name = TRS("Bitrate tolerance (kbps)"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(8000), \ .help_string = TRS("Number of bits the bitstream is allowed to diverge from the reference.\ Unused for constant quantizer encoding") \ } /** Motion estimation */ #define PARAM_ME_METHOD \ {\ .name = "ff_me_method",\ .long_name = TRS("Motion estimation method"),\ .type = BG_PARAMETER_STRINGLIST,\ .val_default = GAVL_VALUE_INIT_STRING("Zero"), \ .multi_names = (char const *[]){"Zero", "Phods", "Log", "X1", "Epzs", "Full", (char *)0}, \ .multi_labels = (char const *[]){TRS("Zero"), TRS("Phods"), TRS("Log"), \ TRS("X1"), TRS("Epzs"), TRS("Full"), (char *)0} \ } /** Frame types */ #define PARAM_GOP_SIZE \ { \ .name = "gop_size", \ .long_name = TRS("GOP size (0 = intra only)"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(250), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(300), \ } \ /** Quantizer */ #define PARAM_QCOMPRESS \ { \ .name = "ff_qcompress", \ .long_name = TRS("Quantizer compression"),\ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.5), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(1.0), \ .num_digits = 2, \ .help_string = TRS("Amount of qscale change between easy & hard scenes") \ } /** Quantizer */ #define PARAM_QBLUR \ { \ .name = "ff_qblur", \ .long_name = TRS("Quantizer blur"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(1.0), \ .num_digits = 2, \ .help_string = TRS("Amount of qscale smoothing over time"), \ } /** Quantizer */ #define PARAM_QMIN \ {\ .name = "ff_qmin", \ .long_name = TRS("Minimum quantizer scale"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(2), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(31), \ } /** Quantizer */ #define PARAM_QMAX \ {\ .name = "ff_qmax", \ .long_name = TRS("Maximum quantizer scale"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(31), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(31), \ } \ /** Quantizer */ #define PARAM_MAX_QDIFF \ { \ .name = "ff_max_qdiff", \ .long_name = TRS("Maximum quantizer difference"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(3), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(31), \ .help_string = TRS("Maximum quantizer difference between frames") \ } /** Frame types */ #define PARAM_MAX_B_FRAMES \ { \ .name = "ff_max_b_frames", \ .long_name = TRS("Max B-Frames"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Maximum number of B-frames between non B-frames") \ } /** Quantizer */ #define PARAM_B_QUANT_FACTOR \ { \ .name = "ff_b_quant_factor", \ .long_name = TRS("B quantizer factor"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(1.25), \ .val_min = GAVL_VALUE_INIT_FLOAT(-31.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(31.0), \ .num_digits = 2, \ .help_string = TRS("Quantizer factor between B-frames and non-B-frames"), \ } /** Frame types */ #define PARAM_B_FRAME_STRATEGY \ { \ .name = "ff_b_frame_strategy", \ .long_name = TRS("Avoid B-frames in high motion scenes"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } #define PARAM_STRICT_STANDARD_COMPLIANCE \ { \ .name = "ff_strict_std_compliance", \ .long_name = TRS("Standards compliance"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(-2), \ .val_max = GAVL_VALUE_INIT_INT(2), \ .help_string = TRS("2: Strictly conform to a older more strict version\ of the spec or reference software\n\ 1: Strictly conform to all the things in the spec no matter what \ consequences\n\ 0: Default\n\ -1: Allow unofficial extensions\n\ -2: Allow non standarized experimental things") \ } /** Quantizer */ #define PARAM_B_QUANT_OFFSET \ { \ .name = "ff_b_quant_offset", \ .long_name = TRS("B quantizer offset"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(1.25), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(31.0), \ .num_digits = 2, \ .help_string = TRS("Quantizer offset between B-frames and non-B-frames\n"\ "if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset)\n"\ "if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)")\ } /** Rate control */ #define PARAM_RC_MIN_RATE \ { \ .name = "ff_rc_min_rate",\ .long_name = TRS("Minimum bitrate (kbps)"),\ .type = BG_PARAMETER_INT,\ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Minimum bitrate (0 means arbitrary)"), \ } /** Rate control */ #define PARAM_RC_MAX_RATE \ { \ .name = "ff_rc_max_rate",\ .long_name = TRS("Maximum bitrate (kbps)"),\ .type = BG_PARAMETER_INT,\ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Maximum bitrate (0 means arbitrary)"), \ } /** Rate control */ #define PARAM_RC_BUFFER_SIZE \ { \ .name = "ff_rc_buffer_size", \ .long_name = TRS("RC buffer size"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Decoder bitstream buffer size in kbits. When encoding " \ "with max and/or min bitrate, this must be specified.") \ } /** Rate control */ #define PARAM_RC_BUFFER_AGGRESSIVITY \ { \ .name = "ff_rc_buffer_aggressivity", \ .long_name = TRS("RC buffer aggressivity"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(1.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.01), \ .val_max = GAVL_VALUE_INIT_FLOAT(99.0), \ .num_digits = 2, \ } /** Quantizer */ #define PARAM_I_QUANT_FACTOR \ { \ .name = "ff_i_quant_factor", \ .long_name = TRS("I quantizer factor"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(-0.8), \ .val_min = GAVL_VALUE_INIT_FLOAT(-31.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(31.0), \ .num_digits = 1, \ .help_string = TRS("Quantizer factor between P-frames and I-frames.\n"\ "If > 0 then the last P frame quantizer will be used (q= lastp_q*factor+offset).\n"\ "If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)"), \ } /** Quantizer */ #define PARAM_I_QUANT_OFFSET \ { \ .name = "ff_i_quant_offset", \ .long_name = TRS("I quantizer offset"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(31.0), \ .num_digits = 1, \ .help_string = TRS("Quantizer offset between P-frames and I-frames"), \ } /** Rate control */ #define PARAM_RC_INITIAL_COMPLEX \ { \ .name = "ff_rc_initial_cplx", \ .long_name = TRS("Initial RC complexity"), \ .type = BG_PARAMETER_SLIDER_FLOAT,\ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(99.0), \ .num_digits = 1, \ } /** Masking */ #define PARAM_LUMI_MASKING \ { \ .name = "ff_lumi_masking", \ .long_name = TRS("Luminance masking"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(1.0), \ .num_digits = 2, \ .help_string = TRS("Encode very bright image parts with reduced quality."\ " 0 means disabled, 0-0.3 is a sane range."), \ } /** Masking */ #define PARAM_TEMPORAL_CPLX_MASKING \ { \ .name = "ff_temporal_cplx_masking", \ .long_name = TRS("Temporary complexity masking"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(1.0), \ .num_digits = 2, \ .help_string = TRS("Encode very fast moving image parts with reduced quality."\ " 0 means disabled."), \ } /** Masking */ #define PARAM_SPATIAL_CPLX_MASKING \ { \ .name = "ff_spatial_cplx_masking", \ .long_name = TRS("Spatial complexity masking"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(1.0), \ .num_digits = 2, \ .help_string = TRS("Encode very complex image parts with reduced quality."\ " 0 means disabled, 0-0.5 is a sane range."), \ } /** Masking */ #define PARAM_P_MASKING \ { \ .name = "ff_p_masking", \ .long_name = TRS("Inter block masking"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(1.0), \ .num_digits = 2, \ .help_string = TRS("Encode inter blocks with reduced quality (increases the quality of intra blocks). "\ " 0 means disabled, 1 will double the bits allocated for intra blocks."), \ } /** Masking */ #define PARAM_DARK_MASKING \ { \ .name = "ff_dark_masking", \ .long_name = TRS("Darkness masking"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(1.0), \ .num_digits = 2, \ .help_string = TRS("Encode very dark image parts with reduced quality. " \ "0 means disabled, 0-0.3 is a sane range."), \ } #define PARAM_PREDICTION_METHOD \ { \ .name = "ff_prediction_method", \ .long_name = TRS("Precition method"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("Left"),\ multi_names: (char const *[]){ "Left", "Plane", "Median", (char*)0 }, \ multi_labels: (char const *[]){ TRS("Left"), TRS("Plane"), TRS("Median"), (char*)0 }, \ } /** Quantizer */ #define PARAM_MB_QMIN \ { \ .name = "ff_mb_qmin", \ .long_name = TRS("Minimum MB quantizer"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(2),\ .val_min = GAVL_VALUE_INIT_INT(0),\ .val_max = GAVL_VALUE_INIT_INT(31),\ } /** Quantizer */ #define PARAM_MB_QMAX \ { \ .name = "ff_mb_qmax", \ .long_name = TRS("Maximum MB quantizer"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(31),\ .val_min = GAVL_VALUE_INIT_INT(0),\ .val_max = GAVL_VALUE_INIT_INT(31),\ } #define COMPARE_FUNCS (char const *[]){ "SAD", "SSE", "SATD", "DCT", "PSNR", \ "BIT", "RD", "ZERO", "VSAD", "VSSE", "NSSE", (char*)0 } #define COMPARE_FUNCS_HELP TRS("SAD: Sum of absolute differences\n"\ "SSE: Sum of squared errors\n"\ "SATD: Sum of absolute Hadamard transformed differences\n"\ "DCT: Sum of absolute DCT transformed differences\n"\ "PSNR: Sum of squared quantization errors (low quality)\n"\ "BIT: Number of bits needed for the block\n"\ "RD: Rate distortion optimal (slow)\n"\ "ZERO: 0\n"\ "VSAD: Sum of absolute vertical differences\n"\ "VSSE: Sum of squared vertical differences\n"\ "NSSE: Noise preserving sum of squared differences") /** Motion estimation */ #define PARAM_ME_CMP \ {\ .name = "ff_me_cmp", \ .long_name = "ME compare function", \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("SAD"), \ .multi_names = COMPARE_FUNCS, \ .help_string = TRS("Motion estimation compare function.") COMPARE_FUNCS_HELP \ } /** Motion estimation */ #define PARAM_ME_CMP_CHROMA \ { \ .name = "ff_me_cmp_chroma", \ .long_name = TRS("Enable chroma ME compare"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } /** Motion estimation */ #define PARAM_ME_SUB_CMP \ {\ .name = "ff_me_sub_cmp", \ .long_name = TRS("Subpixel ME compare function"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("SAD"), \ .multi_names = COMPARE_FUNCS, \ .help_string = TRS("Subpixel motion estimation compare function.\n")COMPARE_FUNCS_HELP \ } /** Motion estimation */ #define PARAM_ME_SUB_CMP_CHROMA \ { \ .name = "ff_me_sub_cmp_chroma", \ .long_name = TRS("Enable chroma subpixel ME compare"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } #define PARAM_MB_CMP \ {\ .name = "ff_mb_cmp", \ .long_name = TRS("MB compare function"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("SAD"), \ .multi_names = COMPARE_FUNCS, \ .help_string = TRS("Macroblock compare function.\n")COMPARE_FUNCS_HELP \ } #define PARAM_MB_CMP_CHROMA \ { \ .name = "ff_mb_cmp_chroma", \ .long_name = TRS("Enable chroma macroblock ME compare"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } #define PARAM_ILDCT_CMP \ {\ .name = "ff_ildct_cmp", \ .long_name = TRS("ILDCT compare function"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("SAD"), \ .multi_names = COMPARE_FUNCS, \ .help_string = TRS("Interlaced dct compare function.\n")COMPARE_FUNCS_HELP \ } #define PARAM_ICDCT_CMP_CHROMA \ { \ .name = "ff_ildct_cmp_chroma", \ .long_name = TRS("Enable chroma ILDCT ME compare"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } /** Motion estimation */ #define PARAM_DIA_SIZE \ { \ .name = "ff_dia_size", \ .long_name = TRS("ME diamond size & shape"),\ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(-9), \ .val_max = GAVL_VALUE_INIT_INT(9), \ .help_string = TRS("Motion estimation diamond size. Negative means shape adaptive.") \ } #define PARAM_LAST_PREDICTOR_COUNT \ { \ .name = "ff_last_predictor_count", \ .long_name = TRS("Last predictor count"),\ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(99), \ .help_string = TRS("Amount of motion predictors from the previous frame.\n"\ "0 (default)\n"\ "a Will use 2a+1 x 2a+1 macroblock square of motion vector predictors " \ "from the previous frame.")\ } /** Motion estimation */ #define PARAM_PRE_ME \ { \ .name = "ff_pre_me", \ .long_name = TRS("ME pre-pass"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(2), \ .help_string = TRS("Motion estimation pre-pass\n"\ "0: disabled\n"\ "1: only after I-frames\n"\ "2: always") \ } /** Motion estimation */ #define PARAM_ME_PRE_CMP \ {\ .name = "ff_me_pre_cmp", \ .long_name = TRS("ME pre-pass compare function"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("SAD"), \ .multi_names = COMPARE_FUNCS, \ .help_string = TRS("Motion estimation pre-pass compare function.\n")COMPARE_FUNCS_HELP\ } /** Motion estimation */ #define PARAM_ME_PRE_CMP_CHROMA \ { \ .name = "ff_me_pre_cmp_chroma", \ .long_name = TRS("Enable chroma ME pre-pass compare"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(1), \ } /** Motion estimation */ #define PARAM_PRE_DIA_SIZE \ { \ .name = "ff_pre_dia_size", \ .long_name = TRS("ME pre-pass diamond size & shape"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(-9), \ .val_max = GAVL_VALUE_INIT_INT(9), \ .help_string = TRS("Motion estimation pre-pass diamond size. Negative means shape adaptive.") \ } /** Motion estimation */ #define PARAM_ME_SUBPEL_QUALITY \ { \ .name = "ff_me_subpel_quality", \ .long_name = TRS("Subpel ME quality"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(8), \ .val_min = GAVL_VALUE_INIT_INT(1), \ .val_max = GAVL_VALUE_INIT_INT(8), \ .help_string = TRS("Subpel motion estimation refinement quality (for qpel). Higher values "\ "mean higher quality but slower encoding.") \ } /** Motion estimation */ #define PARAM_ME_RANGE \ { \ .name = "ff_me_range", \ .long_name = TRS("Motion estimation range"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(1000), \ .help_string = TRS("Motion estimation search range (0 means unlimited)"), \ } /** Motion estimation */ #define PARAM_MB_DECISION \ { \ .name = "ff_mb_decision", \ .long_name = TRS("MB decision mode"), \ .type = BG_PARAMETER_STRINGLIST, \ .val_default = GAVL_VALUE_INIT_STRING("Use compare function"), \ .multi_names = (char const *[]){ "Use compare function", \ "Fewest bits", "Rate distoration", (char*)0 },\ .multi_labels = (char const *[]){ TRS("Use compare function"), \ TRS("Fewest bits"), TRS("Rate distoration"), (char*)0 },\ } /** Frame types */ #define PARAM_SCENE_CHANGE_THRESHOLD \ { \ .name = "ff_scenechange_threshold", \ .long_name = TRS("Scenechange threshold"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(-1000000000), \ .val_max = GAVL_VALUE_INIT_INT(1000000000), \ .help_string = TRS("Threshold for scene change detection.\n\ Negative values mean more sensitivity (more keyframes)") \ } /** Rate control */ #define PARAM_LMIN \ { \ .name = "ff_lmin", \ .long_name = TRS("Minimum lagrange multiplier"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(2.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(1.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(31.0), \ .num_digits = 1, \ .help_string = TRS("Minimum Lagrange multiplier for ratecontrol. "\ "Should possibly be the same as minimum quantizer scale.")\ } /** Rate control */ #define PARAM_LMAX \ { \ .name = "ff_lmax", \ .long_name = TRS("Maximum lagrange multipler"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(31.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(1.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(31.0), \ .num_digits = 1, \ .help_string = TRS("Maximum Lagrange multiplier for ratecontrol. "\ "Should possibly be the same as maximum quantizer scale.")\ } #define PARAM_NOISE_REDUCTION \ { \ .name = "ff_noise_reduction", \ .long_name = TRS("Noise reduction"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(2000), \ } /** Rate control */ #define PARAM_RC_INITIAL_BUFFER_OCCUPANCY \ { \ .name = "ff_rc_initial_buffer_occupancy", \ .long_name = TRS("Initial RC buffer occupancy"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Number of kilobits which should be loaded into \ the rc buffer before encoding starts. Must not be larger than \ RC buffer size") \ } /* Does nothing */ /** Frame types */ /** Quantizer */ /** Motion estimation */ #define PARAM_ME_THRESHOLD \ { \ .name = "ff_me_threshold", \ .long_name = TRS("ME Theshold"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0),\ .val_min = GAVL_VALUE_INIT_INT(0),\ .val_max = GAVL_VALUE_INIT_INT(4000000),\ .help_string = TRS("Motion estimation threshold. under which no motion estimation is performed, but instead the user specified motion vectors are used") \ } #define PARAM_MB_THRESHOLD \ { \ .name = "ff_mb_threshold", \ .long_name = TRS("MB Theshold"),\ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0),\ .val_min = GAVL_VALUE_INIT_INT(0),\ .val_max = GAVL_VALUE_INIT_INT(4000000),\ .help_string = TRS("Macroblock threshold. under which the user specified macroblock types will be used") \ } #define PARAM_NSSE_WEIGHT \ { \ .name = "ff_nsse_weight", \ .long_name = TRS("NSSE weight"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(8),\ .help_string = TRS("Noise vs. SSE weight for the NSSE comparsion function. "\ "0 is identical to SSE")\ } /** Masking */ #define PARAM_BORDER_MASKING \ { \ .name = "ff_border_masking", \ .long_name = TRS("Border masking"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(0.0), \ .val_max = GAVL_VALUE_INIT_FLOAT(1.0), \ .num_digits = 2, \ .help_string = TRS("Encode image parts near the border with reduced quality."\ " 0 means disabled")\ } #define PARAM_MB_LMIN \ { \ .name = "ff_mb_lmin", \ .long_name = TRS("Minimum MB lagrange multipler"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(2.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(1.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(31.0), \ .num_digits = 1, \ .help_string = TRS("Minimum macroblock Lagrange multiplier.") \ } #define PARAM_MB_LMAX \ { \ .name = "ff_mb_lmax", \ .long_name = TRS("Maximum MB lagrange multipler"), \ .type = BG_PARAMETER_SLIDER_FLOAT, \ .val_default = GAVL_VALUE_INIT_FLOAT(31.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(1.0), \ .val_min = GAVL_VALUE_INIT_FLOAT(31.0), \ .num_digits = 1, \ .help_string = TRS("Maximum macroblock Lagrange multiplier.") \ } /** Motion estimation */ #define PARAM_ME_PENALTY_COMPENSATION \ { \ .name = "ff_me_penalty_compensation", \ .long_name = TRS("ME penalty compensation"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(256), \ } #define PARAM_BIDIR_REFINE \ { \ .name = "ff_bidir_refine", \ .long_name = TRS("Bidir refine"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(4), \ } #define PARAM_BRD_SCALE \ { \ .name = "ff_brd_scale", \ .long_name = TRS("BRD scale"), \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .val_min = GAVL_VALUE_INIT_INT(0), \ .val_max = GAVL_VALUE_INIT_INT(10), \ } /** Frame types */ /** Quantizer */ #define PARAM_QSCALE \ { \ .name = "ff_qscale", \ .long_name = "Fixed quantizer", \ .type = BG_PARAMETER_SLIDER_INT, \ .val_default = GAVL_VALUE_INIT_INT(10), \ .val_min = GAVL_VALUE_INIT_INT(1), \ .val_max = GAVL_VALUE_INIT_INT(31), \ .help_string = TRS("Quantizer for fixed quality encoding. Lower means better, 1 is not recommended")\ } /* Flags */ /** Quantizer */ #define PARAM_FLAG_QSCALE \ { \ .name = "ff_flag_qscale", \ .long_name = TRS("Use fixed quantizer"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Use fixed quality encoding"),\ } /** Motion estimation */ #define PARAM_FLAG_4MV \ { \ .name = "ff_flag_4mv", \ .long_name = TRS("4 MV per MB allowed"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Allow 4 motion vectors per macroblock (slightly better quality). Works better if MB decision mode is \"Fewest bits\" or \"Rate distoration\".") \ } /** Motion estimation */ #define PARAM_FLAG_QPEL \ { \ .name = "ff_flag_qpel", \ .long_name = TRS("Use qpel MC"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Use 1/4 pixel motion compensation. Warning: QPEL is not supported by all decoders.") \ } #define PARAM_FLAG_PART \ { \ .name = "ff_flag_part", \ .long_name = TRS("Use data partitioning"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Use data partitioning for more robustness if the video is "\ "for transmitting over unreliable channels") \ } #define PARAM_FLAG_GRAY \ { \ .name = "ff_flag_gray", \ .long_name = TRS("Grayscale mode"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } /** Masking */ #define PARAM_FLAG_ALT_SCAN \ { \ .name = "ff_flag_alt_scan", \ .long_name = TRS("Use alternative scantable"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } /** Quantizer */ #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) #define PARAM_TRELLIS \ { \ .name = "ff_flag_trellis_quant", \ .long_name = TRS("Use trellis quantization"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Use trellis quantization (improves quality)") \ } #else #define PARAM_TRELLIS \ { \ .name = "ff_trellis", \ .long_name = TRS("Use trellis quantization"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Use trellis quantization (improves quality)") \ } #endif #define PARAM_FLAG_BITEXACT \ { \ .name = "ff_flag_bitexact", \ .long_name = TRS("Use only bitexact stuff"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Use only bitexact stuff (except (i)dct)") \ } #define PARAM_FLAG_AC_PRED_H263 \ { \ .name = "ff_flag_ac_pred", \ .long_name = TRS("Advanced intra coding"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } #define PARAM_FLAG_AC_PRED_MPEG4 \ { \ .name = "ff_flag_ac_pred", \ .long_name = TRS("MPEG-4 AC prediction"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } #define PARAM_FLAG_H263P_UMV \ { \ .name = "ff_flag_h263p_umv", \ .long_name = TRS("Unlimited motion vector"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } #define PARAM_FLAG_CBP_RD \ { \ .name = "ff_flag_cbp_rd", \ .long_name = TRS("CBP RD"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Use rate distortion optimization for cbp"),\ } #define PARAM_FLAG_QP_RD \ { \ .name = "ff_flag_qp_rd", \ .long_name = TRS("QP RD"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Use rate distortion optimization for qp selection"),\ } #define PARAM_FLAG_H263P_AIV \ { \ .name = "ff_flag_h263p_aiv", \ .long_name = TRS("Alternative inter vlc"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } /* H.263(+) */ #define PARAM_FLAG_OBMC \ { \ .name = "ff_flag_obmc", \ .long_name = TRS("OBMC"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Overlapped block motion compensation (only supported with with simple MB decision)") \ } #define PARAM_FLAG_LOOP_FILTER \ { \ .name = "ff_flag_loop_filter", \ .long_name = TRS("Loop filter"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } #define PARAM_FLAG_H263P_SLICE_STRUCT \ { \ .name = "ff_flag_h263p_slice_struct", \ .long_name = TRS("H263P slice struct"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } /** Frame types */ #define PARAM_FLAG_CLOSED_GOP \ { \ .name = "ff_flag_closed_gop", \ .long_name = TRS("Close all GOPs"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } #define PARAM_FLAG2_FAST \ { \ .name = "ff_flag2_fast", \ .long_name = TRS("Allow fast encoding"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Allow non spec compliant speedup tricks") \ } /** Frame types */ #define PARAM_FLAG2_STRICT_GOP \ { \ .name = "ff_flag2_strict_gop", \ .long_name = TRS("Strictly enforce GOP size"), \ .type = BG_PARAMETER_CHECKBUTTON, \ .val_default = GAVL_VALUE_INIT_INT(0), \ } /** */ #define PARAM_THREAD_COUNT \ { \ .name = "ff_thread_count", \ .long_name = TRS("Thread count"), \ .type = BG_PARAMETER_INT, \ .val_default = GAVL_VALUE_INIT_INT(0), \ .help_string = TRS("Number of threads to use") \ } bplaum-gmerlin-encoders-172394d/plugins/flac/000077500000000000000000000000001513225514200210725ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/plugins/flac/Makefile.am000066400000000000000000000005701513225514200231300ustar00rootroot00000000000000gmerlin_plugindir = @gmerlin_plugindir@ AM_CPPFLAGS = -I$(top_srcdir)/include AM_LDFLAGS = @GMERLIN_PLUGIN_LDFLAGS@ -avoid-version -module AM_CFLAGS = @FLAC_CFLAGS@ -DLOCALE_DIR=\"$(localedir)\" gmerlin_plugin_LTLIBRARIES = \ e_flac.la e_flac_la_SOURCES = e_flac.c e_flac_la_LIBADD = $(top_builddir)/lib/libgmerlin_encoders.la $(top_builddir)/lib/libbgflac.la @FLAC_LIBS@ bplaum-gmerlin-encoders-172394d/plugins/flac/e_flac.c000066400000000000000000000422011513225514200224460ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include #include #define LOG_DOMAIN "e_flac" #include #include #include #include typedef struct { bg_flac_t * enc; char * filename; /* Configuration stuff */ int use_vorbis_comment; int use_seektable; int num_seektable_entries; int add_cover; // From config const gavl_dictionary_t * cover; int compressed; int64_t samples_written; bg_encoder_callbacks_t * cb; int64_t data_start; int64_t seektable_start; int64_t bytes_written; /* Table with *all* frames */ FLAC__StreamMetadata_SeekPoint * frame_table; uint32_t frame_table_len; uint32_t frame_table_alloc; /* Generated seek table */ FLAC__StreamMetadata_SeekPoint * seektable; // gavl_compression_info_t ci; // gavl_dictionary_t m_stream; // gavl_audio_format_t format; gavl_dictionary_t stream; int fixed_blocksize; gavl_audio_sink_t * sink; gavl_packet_sink_t * psink_int; gavl_packet_sink_t * psink_ext; const gavl_dictionary_t * m_global; int write_seektable; gavl_io_t * io; int streaming; } flac_t; static int write_data(flac_t * f, const uint8_t * data, int len) { if(gavl_io_write_data(f->io, data, len) < len) return 0; f->bytes_written += len; return 1; } static int write_comment(flac_t * f, int last) { int ret = 0; uint8_t * buf; uint8_t * ptr; uint8_t * comment_ptr; gavl_io_t * io; int len; io = gavl_io_create_mem_write(); bg_vorbis_comment_write(io, gavl_stream_get_metadata(&f->stream), f->m_global, 0); comment_ptr = gavl_io_mem_get_buf(io, &len); buf = malloc(4 + len); ptr = buf; ptr[0] = 0x04; if(last) ptr[0] |= 0x80; ptr++; GAVL_24BE_2_PTR(len, ptr); ptr += 3; memcpy(ptr, comment_ptr, len); write_data(f, buf, len+4); free(buf); free(comment_ptr); gavl_io_destroy(io); return ret; } static int write_seektable(FLAC__StreamMetadata_SeekPoint * index, int len, flac_t * f, int last) { int i; int len_bytes; uint8_t buf[18]; int ret = 0; uint8_t * ptr; ptr = buf; ptr[0] = 3; if(last) ptr[0] |= 0x80; ptr++; len_bytes = len * 18; GAVL_24BE_2_PTR(len_bytes, ptr); write_data(f, buf, 4); for(i = 0; i < len; i++) { ptr = buf; GAVL_64BE_2_PTR(index[i].sample_number, ptr); ptr += 8; GAVL_64BE_2_PTR(index[i].stream_offset, ptr); ptr += 8; GAVL_16BE_2_PTR(index[i].frame_samples, ptr); ptr += 2; write_data(f, buf, 18); } return ret; } static void * create_flac() { flac_t * ret; ret = calloc(1, sizeof(*ret)); return ret; } static void set_callbacks_flac(void * data, bg_encoder_callbacks_t * cb) { flac_t * flac = data; flac->cb = cb; } static const bg_parameter_info_t parameters[] = { { .name = "use_vorbis_comment", .long_name = TRS("Write vorbis comment"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(1), .help_string = TRS("Write Vorbis comment containing metadata to the file") }, { .name = "add_cover", .long_name = TRS("Add cover"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(0), .help_string = TRS("Write the album cover to the flac file if available") }, { .name = "use_seektable", .long_name = TRS("Write seek table"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(1), .help_string = TRS("Write seektable (strongly recommended)") }, { .name = "num_seektable_entries", .long_name = TRS("Entries in the seektable"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(1), .val_max = GAVL_VALUE_INIT_INT(1000000), .val_default = GAVL_VALUE_INIT_INT(100), .help_string = TRS("Maximum number of entries in the seek table. Default is 100, larger numbers result in\ shorter seeking times but also in larger files.") }, { /* End of parameters */ } }; static const bg_parameter_info_t * get_parameters_flac(void * data) { return parameters; } static void set_parameter_flac(void * data, const char * name, const gavl_value_t * v) { flac_t * flac; flac = data; if(!name) return; else if(!strcmp(name, "use_vorbis_comment")) flac->use_vorbis_comment = v->v.i; else if(!strcmp(name, "add_cover")) flac->add_cover = v->v.i; else if(!strcmp(name, "use_seektable")) flac->use_seektable = v->v.i; else if(!strcmp(name, "num_seektable_entries")) flac->num_seektable_entries = v->v.i; } static int streaminfo_callback(void * data, uint8_t * si, int len) { int first; flac_t * flac = data; int last = 0; if(flac->bytes_written) first = 0; else first = 1; if(first) { /* Set or clear the "last metadata packet" flag */ if(flac->write_seektable || flac->use_vorbis_comment || flac->cover) last = 0; else last = 1; if(last) si[4] |= 0x80; else si[4] &= 0x7f; /* Write stream info */ if(!write_data(flac, si, len)) return 0; if(flac->use_vorbis_comment) { if(flac->write_seektable || flac->cover) last = 0; else last = 1; write_comment(flac, last); } if(flac->write_seektable) { if(flac->cover) last = 0; else last = 1; flac->seektable_start = flac->bytes_written; write_seektable(flac->seektable, flac->num_seektable_entries, flac, last); } if(flac->cover) { /* Write cover */ uint8_t * buf; int len; gavl_io_t * io_mem = gavl_io_create_mem_write(); bg_flac_cover_tag_write(io_mem, flac->cover, 1); buf = gavl_io_mem_get_buf(io_mem, &len); write_data(flac, buf, len); free(buf); gavl_io_destroy(io_mem); } } else if(!flac->streaming) { gavl_io_seek(flac->io, 0, SEEK_SET); if(!write_data(flac, si, len)) return 0; } return 1; } static int open_io_flac(void * data, gavl_io_t * io, const gavl_dictionary_t * m) { int result = 1; flac_t * flac = data; flac->enc = bg_flac_create(); flac->io = io; if(!gavl_io_can_seek(flac->io)) flac->streaming = 1; bg_flac_set_callbacks(flac->enc, streaminfo_callback, flac); /* Create seektable */ flac->write_seektable = flac->use_seektable; if(flac->streaming) flac->write_seektable = 0; /* Check if we have a cover */ if(flac->add_cover) { const char * var; fprintf(stderr, "Cover:\n"); gavl_value_dump(gavl_dictionary_get(m, GAVL_META_COVER_URL), 2); fprintf(stderr, "\n"); flac->cover = gavl_dictionary_get_image_max(m, GAVL_META_COVER_URL, 600, 600, "image/jpeg"); if(flac->cover && (!(var = gavl_dictionary_get_string(flac->cover, GAVL_META_URI)) || gavl_string_starts_with(var, "http://"))) flac->cover = NULL; } if(flac->write_seektable) { int i; flac->seektable = calloc(flac->num_seektable_entries, sizeof(*flac->seektable)); for(i = 0; i < flac->num_seektable_entries; i++) flac->seektable[i].sample_number = 0xFFFFFFFFFFFFFFFFLL; } flac->m_global = m; return result; } static int open_flac(void * data, const char * filename, const gavl_dictionary_t * m) { gavl_io_t * io; flac_t * flac = data; if(!strcmp(filename, "-")) { io = gavl_io_create_file(stdout, 1, 0, 0); } else { FILE * out; flac->filename = gavl_filename_ensure_extension(filename, "flac"); if(!bg_encoder_cb_create_output_file(flac->cb, flac->filename)) return 0; if(!(out = fopen(flac->filename, "wb"))) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Cannot open %s: %s", flac->filename, strerror(errno)); } io = gavl_io_create_file(out, 1, 1, 1); } return open_io_flac(data, io, m); } static int add_audio_stream_flac(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format) { flac_t * flac; flac = data; /* Copy and adjust format */ gavl_init_audio_stream(&flac->stream); gavl_audio_format_copy(gavl_stream_get_audio_format_nc(&flac->stream), format); gavl_dictionary_copy(gavl_stream_get_metadata_nc(&flac->stream), m); return 0; } static void append_packet(flac_t * f, int samples) { if(f->streaming) return; if(f->frame_table_len + 1 > f->frame_table_alloc) { f->frame_table_alloc += 10000; f->frame_table = realloc(f->frame_table, f->frame_table_alloc * sizeof(*f->frame_table)); } f->frame_table[f->frame_table_len].sample_number = f->samples_written; f->frame_table[f->frame_table_len].frame_samples = samples; f->frame_table[f->frame_table_len].stream_offset = f->bytes_written - f->data_start; f->frame_table_len++; // fprintf(stderr, "Append packet %ld %d -> %ld\n", f->samples_written, samples, // f->samples_written + samples); f->samples_written += samples; } static gavl_sink_status_t write_audio_packet_func_flac(void * priv, gavl_packet_t * packet) { flac_t * flac = priv; if(flac->data_start < 0) flac->data_start = flac->bytes_written; append_packet(flac, packet->duration); if(write_data(flac, packet->buf.buf, packet->buf.len)) return GAVL_SINK_OK; else return GAVL_SINK_ERROR; } static int start_flac(void * data) { flac_t * flac; flac = data; if(flac->compressed) { if(!(flac->psink_ext = bg_flac_start_compressed(flac->enc, &flac->stream))) return 0; } else { if(!(flac->sink = bg_flac_start_uncompressed(flac->enc, &flac->stream))) return 0; } flac->psink_int = gavl_packet_sink_create(NULL, write_audio_packet_func_flac, flac); bg_flac_set_sink(flac->enc, flac->psink_int); flac->data_start = -1; return 1; } static gavl_audio_sink_t * get_audio_sink_flac(void * data, int stream) { flac_t * flac; flac = data; return flac->sink; } static gavl_packet_sink_t * get_audio_packet_sink_flac(void * data, int stream) { flac_t * flac; flac = data; return flac->psink_ext; } static void build_seek_table(flac_t * flac) { int i; /* We encoded fewer frames than we have in the seektable: Placeholders will remain there */ if(flac->frame_table_len <= flac->num_seektable_entries) { memcpy(flac->seektable, flac->frame_table, flac->frame_table_len * sizeof(*flac->seektable)); } /* More common case: We have more frames than we will have in the seek table */ else { int index = 0; int64_t next_seek_sample; /* First entry is always copied */ memcpy(flac->seektable, flac->frame_table, sizeof(*flac->seektable)); index = 1; next_seek_sample = (flac->samples_written * index) / flac->num_seektable_entries; for(i = 1; i < flac->frame_table_len; i++) { if(flac->frame_table[i].sample_number >= next_seek_sample) { memcpy(flac->seektable + index, flac->frame_table + i, sizeof(*flac->seektable)); index++; next_seek_sample = (flac->samples_written * index) / flac->num_seektable_entries; if(index >= flac->num_seektable_entries) break; } } } } static void finalize(flac_t * flac) { int last = 0; if(!flac->io) return; /* Update stream info */ /* Seek table */ if(flac->write_seektable) // Build seek table { if(!flac->cover) last = 1; build_seek_table(flac); gavl_io_seek(flac->io, flac->seektable_start, SEEK_SET); write_seektable(flac->seektable, flac->num_seektable_entries, flac, last); } } static int close_flac(void * data, int do_delete) { flac_t * flac; flac = data; /* Flush and free the codec */ if(flac->enc) { bg_flac_free(flac->enc); flac->enc = NULL; } /* Finalize output file */ if(flac->io) { if(do_delete && flac->filename) { gavl_io_destroy(flac->io); flac->io = NULL; remove(flac->filename); } else { finalize(flac); gavl_io_destroy(flac->io); flac->io = NULL; } } if(flac->filename) { free(flac->filename); flac->filename = NULL; } if(flac->seektable) { free(flac->seektable); flac->seektable = NULL; } if(flac->frame_table) { free(flac->frame_table); flac->frame_table = NULL; } if(flac->psink_int) { gavl_packet_sink_destroy(flac->psink_int); flac->psink_int = NULL; } if(flac->psink_ext) { gavl_packet_sink_destroy(flac->psink_ext); flac->psink_ext = NULL; } if(flac->sink) { gavl_audio_sink_destroy(flac->sink); flac->sink = NULL; } gavl_dictionary_reset(&flac->stream); return 1; } static void destroy_flac(void * priv) { flac_t * flac; flac = priv; close_flac(priv, 1); free(flac); } static void set_audio_parameter_flac(void * data, int stream, const char * name, const gavl_value_t * val) { flac_t * flac; flac = data; bg_flac_set_parameter(flac->enc, name, val); } /* Compressed packet support */ static int writes_compressed_audio_flac(void * priv, const gavl_audio_format_t * format, const gavl_compression_info_t * info) { if((info->id == GAVL_CODEC_ID_FLAC) && (info->codec_header.len == 42)) return 1; return 0; } static int add_audio_stream_compressed_flac(void * priv, const gavl_dictionary_t * m, const gavl_audio_format_t * format, const gavl_compression_info_t * info) { flac_t * flac = priv; gavl_init_audio_stream(&flac->stream); gavl_stream_set_compression_info(&flac->stream, info); gavl_audio_format_copy(gavl_stream_get_audio_format_nc(&flac->stream), format); gavl_dictionary_copy(gavl_stream_get_metadata_nc(&flac->stream), m); flac->compressed = 1; return 0; } static const bg_parameter_info_t * get_audio_parameters_flac(void * priv) { return bg_flac_get_parameters(); } static const char * get_extensions_flac(void * data) { return "flac"; } const bg_encoder_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "e_flac", /* Unique short name */ .long_name = TRS("Flac"), .description = TRS("Encoder for flac files. Based on libflac (http://flac.sourceforge.net)"), .type = BG_PLUGIN_ENCODER_AUDIO, .flags = BG_PLUGIN_FILE, .priority = 5, .create = create_flac, .destroy = destroy_flac, .get_parameters = get_parameters_flac, .set_parameter = set_parameter_flac, .get_extensions = get_extensions_flac, }, .max_audio_streams = 1, .max_video_streams = 0, .set_callbacks = set_callbacks_flac, .open = open_flac, .open_io = open_io_flac, .get_audio_parameters = get_audio_parameters_flac, .writes_compressed_audio = writes_compressed_audio_flac, .add_audio_stream = add_audio_stream_flac, .add_audio_stream_compressed = add_audio_stream_compressed_flac, .set_audio_parameter = set_audio_parameter_flac, .get_audio_sink = get_audio_sink_flac, .get_audio_packet_sink = get_audio_packet_sink_flac, .start = start_flac, .close = close_flac }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/lame/000077500000000000000000000000001513225514200211035ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/plugins/lame/Makefile.am000066400000000000000000000007331513225514200231420ustar00rootroot00000000000000gmerlin_plugindir = @gmerlin_plugindir@ AM_CPPFLAGS = -I$(top_srcdir)/include AM_LDFLAGS = @GMERLIN_PLUGIN_LDFLAGS@ -avoid-version -module AM_CFLAGS = @LAME_CFLAGS@ -DLOCALE_DIR=\"$(localedir)\" gmerlin_plugin_LTLIBRARIES = \ c_lame.la \ e_lame.la e_lame_la_SOURCES = e_lame.c xing.c bglame.c e_lame_la_LIBADD = $(top_builddir)/lib/libgmerlin_encoders.la @LAME_LIBS@ c_lame_la_SOURCES = c_lame.c bglame.c c_lame_la_LIBADD = @LAME_LIBS@ noinst_HEADERS = xing.h bglame.h bplaum-gmerlin-encoders-172394d/plugins/lame/bglame.c000066400000000000000000000431771513225514200225120ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #define LOG_DOMAIN "lame" #include #include #include /* MPEG header detection: lame outputs incomplete frames, so we need to assemble them to packets */ /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */ /* MPEG Audio header parsing code */ static int mpeg_bitrates[5][16] = { /* MPEG-1 */ { 0, 32000, 64000, 96000, 128000, 160000, 192000, 224000, // I 256000, 288000, 320000, 352000, 384000, 416000, 448000, 0}, { 0, 32000, 48000, 56000, 64000, 80000, 96000, 112000, // II 128000, 160000, 192000, 224000, 256000, 320000, 384000, 0 }, { 0, 32000, 40000, 48000, 56000, 64000, 80000, 96000, // III 112000, 128000, 160000, 192000, 224000, 256000, 320000, 0 }, /* MPEG-2 LSF */ { 0, 32000, 48000, 56000, 64000, 80000, 96000, 112000, // I 128000, 144000, 160000, 176000, 192000, 224000, 256000, 0 }, { 0, 8000, 16000, 24000, 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 144000, 160000, 0 } // II & III }; static int mpeg_samplerates[3][3] = { { 44100, 48000, 32000 }, // MPEG1 { 22050, 24000, 16000 }, // MPEG2 { 11025, 12000, 8000 } // MPEG2.5 }; #define MPEG_ID_MASK 0x00180000 #define MPEG_MPEG1 0x00180000 #define MPEG_MPEG2 0x00100000 #define MPEG_MPEG2_5 0x00000000 #define MPEG_LAYER_MASK 0x00060000 #define MPEG_LAYER_III 0x00020000 #define MPEG_LAYER_II 0x00040000 #define MPEG_LAYER_I 0x00060000 #define MPEG_PROTECTION 0x00010000 #define MPEG_BITRATE_MASK 0x0000F000 #define MPEG_FREQUENCY_MASK 0x00000C00 #define MPEG_PAD_MASK 0x00000200 #define MPEG_PRIVATE_MASK 0x00000100 #define MPEG_MODE_MASK 0x000000C0 #define MPEG_MODE_EXT_MASK 0x00000030 #define MPEG_COPYRIGHT_MASK 0x00000008 #define MPEG_HOME_MASK 0x00000004 #define MPEG_EMPHASIS_MASK 0x00000003 #define LAYER_I_SAMPLES 384 #define LAYER_II_III_SAMPLES 1152 /* Header detection stolen from the mpg123 plugin of xmms */ static int header_check(uint32_t head) { if ((head & 0xffe00000) != 0xffe00000) return 0; if (!((head >> 17) & 3)) return 0; if (((head >> 12) & 0xf) == 0xf) return 0; if (!((head >> 12) & 0xf)) return 0; if (((head >> 10) & 0x3) == 0x3) return 0; if (((head >> 19) & 1) == 1 && ((head >> 17) & 3) == 3 && ((head >> 16) & 1) == 1) return 0; if ((head & 0xffff0000) == 0xfffe0000) return 0; return 1; } typedef enum { MPEG_VERSION_NONE = 0, MPEG_VERSION_1 = 1, MPEG_VERSION_2 = 2, MPEG_VERSION_2_5 } mpeg_version_t; #define CHANNEL_STEREO 0 #define CHANNEL_JSTEREO 1 #define CHANNEL_DUAL 2 #define CHANNEL_MONO 3 typedef struct { mpeg_version_t version; int layer; int bitrate_mode; int bitrate; int min_bitrate; /* ABR only */ int max_bitrate; /* ABR only */ int samplerate; int frame_bytes; int channel_mode; int mode; int samples_per_frame; } mpeg_header; static int decode_header(mpeg_header * h, uint8_t * ptr) { uint32_t header; int index; /* For calculation of the byte length of a frame */ int pad; int slots_per_frame; h->frame_bytes = 0; header = ptr[3] | (ptr[2] << 8) | (ptr[1] << 16) | (ptr[0] << 24); if(!header_check(header)) return 0; index = (header & MPEG_MODE_MASK) >> 6; switch(index) { case 0: h->channel_mode = CHANNEL_STEREO; break; case 1: h->channel_mode = CHANNEL_JSTEREO; break; case 2: h->channel_mode = CHANNEL_DUAL; break; case 3: h->channel_mode = CHANNEL_MONO; break; } /* Get Version */ switch(header & MPEG_ID_MASK) { case MPEG_MPEG1: h->version = MPEG_VERSION_1; break; case MPEG_MPEG2: h->version = MPEG_VERSION_2; break; case MPEG_MPEG2_5: h->version = MPEG_VERSION_2_5; break; default: return 0; } /* Get Layer */ switch(header & MPEG_LAYER_MASK) { case MPEG_LAYER_I: h->layer = 1; break; case MPEG_LAYER_II: h->layer = 2; break; case MPEG_LAYER_III: h->layer = 3; break; } index = (header & MPEG_BITRATE_MASK) >> 12; switch(h->version) { case MPEG_VERSION_1: switch(h->layer) { case 1: h->bitrate = mpeg_bitrates[0][index]; break; case 2: h->bitrate = mpeg_bitrates[1][index]; break; case 3: h->bitrate = mpeg_bitrates[2][index]; break; } break; case MPEG_VERSION_2: case MPEG_VERSION_2_5: switch(h->layer) { case 1: h->bitrate = mpeg_bitrates[3][index]; break; case 2: case 3: h->bitrate = mpeg_bitrates[4][index]; break; } break; default: // This won't happen, but keeps gcc quiet return 0; } index = (header & MPEG_FREQUENCY_MASK) >> 10; switch(h->version) { case MPEG_VERSION_1: h->samplerate = mpeg_samplerates[0][index]; break; case MPEG_VERSION_2: h->samplerate = mpeg_samplerates[1][index]; break; case MPEG_VERSION_2_5: h->samplerate = mpeg_samplerates[2][index]; break; default: // This won't happen, but keeps gcc quiet return 0; } pad = (header & MPEG_PAD_MASK) ? 1 : 0; if(h->layer == 1) { h->frame_bytes = ((12 * h->bitrate / h->samplerate) + pad) * 4; } else { slots_per_frame = ((h->layer == 3) && ((h->version == MPEG_VERSION_2) || (h->version == MPEG_VERSION_2_5))) ? 72 : 144; h->frame_bytes = (slots_per_frame * h->bitrate) / h->samplerate + pad; } // h->mode = (ptr[3] >> 6) & 3; h->samples_per_frame = (h->layer == 1) ? LAYER_I_SAMPLES : LAYER_II_III_SAMPLES; if(h->version != MPEG_VERSION_1) h->samples_per_frame /= 2; // dump_header(h); return 1; } /* Actual codec starts here */ struct bg_lame_s { gavl_packet_t gp; uint8_t * buffer; int buffer_alloc; int buffer_size; enum vbr_mode_e vbr_mode; /* Config stuff */ int abr_min_bitrate; int abr_max_bitrate; int abr_bitrate; int cbr_bitrate; int vbr_quality; lame_t lame; gavl_audio_format_t format; gavl_audio_sink_t * sink; gavl_packet_sink_t * psink; int64_t in_pts; int64_t out_pts; int64_t delay; }; /* Supported samplerates for MPEG-1/2/2.5 */ static const int samplerates[] = { /* MPEG-2.5 */ 8000, 11025, 12000, /* MPEG-2 */ 16000, 22050, 24000, /* MPEG-1 */ 32000, 44100, 48000, /* End */ 0 }; /* Find the correct bitrate */ static const int mpeg1_bitrates[] = { 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 }; static const int mpeg2_bitrates[] = { 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 }; static int get_bitrate(int bitrate, int samplerate) { int i; int const * bitrates; int diff; int min_diff = 1000000; int min_i = -1; if(samplerate >= 32000) bitrates = mpeg1_bitrates; else bitrates = mpeg2_bitrates; for(i = 0; i < sizeof(mpeg1_bitrates) / sizeof(mpeg1_bitrates[0]); i++) { if(bitrate == bitrates[i]) return bitrate; diff = abs(bitrate - bitrates[i]); if(diff < min_diff) { min_diff = diff; min_i = i; } } if(min_i >= 0) return bitrates[min_i]; return 128; } bg_lame_t * bg_lame_create() { bg_lame_t * ret; ret = calloc(1, sizeof(*ret)); ret->vbr_mode = vbr_off; ret->lame = lame_init(); ret->in_pts = GAVL_TIME_UNDEFINED; ret->out_pts = GAVL_TIME_UNDEFINED; return ret; } void bg_lame_set_packet_sink(bg_lame_t * lame, gavl_packet_sink_t * sink) { lame->psink = sink; } void bg_lame_set_parameter(bg_lame_t * lame, const char * name, const gavl_value_t * v) { int i; if(!name) return; if(!strcmp(name, "bitrate_mode")) { if(!strcmp(v->v.str, "ABR")) { lame->vbr_mode = vbr_abr; } else if(!strcmp(v->v.str, "VBR")) { lame->vbr_mode = vbr_default; } else { lame->vbr_mode = vbr_off; } if(lame_set_VBR(lame->lame, lame->vbr_mode)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_VBR failed"); } else if(!strcmp(name, "stereo_mode")) { if(lame->format.num_channels == 1) return; i = NOT_SET; if(!strcmp(v->v.str, "Stereo")) { i = STEREO; } else if(!strcmp(v->v.str, "Joint stereo")) { i = JOINT_STEREO; } if(i != NOT_SET) { if(lame_set_mode(lame->lame, JOINT_STEREO)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_mode failed"); } } else if(!strcmp(name, "quality")) { if(lame_set_quality(lame->lame, v->v.i)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_quality failed"); } else if(!strcmp(name, "cbr_bitrate")) { lame->cbr_bitrate = v->v.i; } else if(!strcmp(name, "vbr_quality")) { lame->vbr_quality = v->v.i; } else if(!strcmp(name, "abr_bitrate")) { lame->abr_bitrate = v->v.i; } else if(!strcmp(name, "abr_min_bitrate")) { lame->abr_min_bitrate = v->v.i; } else if(!strcmp(name, "abr_max_bitrate")) { lame->abr_max_bitrate = v->v.i; } } static int flush_packets(bg_lame_t * lame, int flush_all) { mpeg_header h; int ret = 0; memset(&h, 0, sizeof(h)); while(1) { if(lame->buffer_size < 4) break; /* Got no header -> Things are screwed up */ if(!decode_header(&h, lame->buffer)) return -1; /* Output the last (possibly incomplete) packet */ if((lame->buffer_size < h.frame_bytes) && flush_all) { h.frame_bytes = lame->buffer_size; } if(lame->buffer_size >= h.frame_bytes) { /* Output packet */ gavl_packet_alloc(&lame->gp, h.frame_bytes); memcpy(lame->gp.buf.buf, lame->buffer, h.frame_bytes); lame->gp.buf.len = h.frame_bytes; /* PTS */ lame->gp.pts = lame->out_pts; lame->gp.duration = lame->format.samples_per_frame; if(lame->gp.pts + lame->gp.duration > lame->in_pts) lame->gp.duration = lame->in_pts - lame->gp.pts; lame->out_pts += lame->gp.duration; /* Output packet */ if(gavl_packet_sink_put_packet(lame->psink, &lame->gp) != GAVL_SINK_OK) return -1; /* Remove packet from buffer */ lame->buffer_size -= h.frame_bytes; if(lame->buffer_size > 0) memmove(lame->buffer, lame->buffer + h.frame_bytes, lame->buffer_size); ret++; } else break; } return ret; } static gavl_sink_status_t write_audio_func(void * data, gavl_audio_frame_t * frame) { int bytes_encoded; bg_lame_t * lame = data; if(lame->in_pts == GAVL_TIME_UNDEFINED) { lame->in_pts = frame->timestamp; lame->out_pts = lame->in_pts - lame->delay; } bytes_encoded = lame_encode_buffer_float(lame->lame, frame->channels.f[0], (lame->format.num_channels > 1) ? frame->channels.f[1] : frame->channels.f[0], frame->valid_samples, lame->buffer + lame->buffer_size, lame->buffer_alloc - lame->buffer_size); lame->buffer_size += bytes_encoded; lame->in_pts += frame->valid_samples; if((bytes_encoded > 0) && (flush_packets(lame, 0) < 0)) return GAVL_SINK_ERROR; else return GAVL_SINK_OK; } gavl_audio_sink_t * bg_lame_open(bg_lame_t * lame, gavl_dictionary_t * s) { /* gavl_compression_info_t * ci, gavl_dictionary_t * m */ gavl_audio_format_t * fmt; gavl_compression_info_t ci; gavl_compression_info_init(&ci); fmt = gavl_stream_get_audio_format_nc(s); /* Copy and adjust format */ fmt->sample_format = GAVL_SAMPLE_FLOAT; fmt->interleave_mode = GAVL_INTERLEAVE_NONE; fmt->samplerate = gavl_nearest_samplerate(fmt->samplerate, samplerates); if(fmt->num_channels > 2) { fmt->num_channels = 2; fmt->channel_locations[0] = GAVL_CHID_NONE; gavl_set_channel_setup(fmt); } if(lame_set_in_samplerate(lame->lame, fmt->samplerate)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_in_samplerate failed"); if(lame_set_num_channels(lame->lame, fmt->num_channels)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_num_channels failed"); if(lame_set_scale(lame->lame, 32767.0)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_scale failed"); /* Finalize configuration and do some sanity checks */ switch(lame->vbr_mode) { case vbr_abr: /* Average bitrate */ if(lame_set_VBR_q(lame->lame, lame->vbr_quality)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_VBR_q failed"); if(lame_set_VBR_mean_bitrate_kbps(lame->lame, lame->abr_bitrate)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_VBR_mean_bitrate_kbps failed"); if(lame->abr_min_bitrate) { lame->abr_min_bitrate = get_bitrate(lame->abr_min_bitrate, fmt->samplerate); if(lame->abr_min_bitrate > lame->abr_bitrate) { lame->abr_min_bitrate = get_bitrate(8, fmt->samplerate); } if(lame_set_VBR_min_bitrate_kbps(lame->lame, lame->abr_min_bitrate)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_VBR_min_bitrate_kbps failed"); } if(lame->abr_max_bitrate) { lame->abr_max_bitrate = get_bitrate(lame->abr_max_bitrate, fmt->samplerate); if(lame->abr_max_bitrate < lame->abr_bitrate) { lame->abr_max_bitrate = get_bitrate(320, fmt->samplerate); } if(lame_set_VBR_max_bitrate_kbps(lame->lame, lame->abr_max_bitrate)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_VBR_max_bitrate_kbps failed"); } break; case vbr_default: if(lame_set_VBR_q(lame->lame, lame->vbr_quality)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_VBR_q failed"); break; case vbr_off: lame->cbr_bitrate = get_bitrate(lame->cbr_bitrate, fmt->samplerate); if(lame_set_brate(lame->lame, lame->cbr_bitrate)) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_set_brate failed"); break; default: break; } /* Write no xing header */ lame_set_bWriteVbrTag(lame->lame, 0); if(lame_init_params(lame->lame) < 0) gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "lame_init_params failed"); fmt->samples_per_frame = lame_get_framesize(lame->lame); gavl_audio_format_copy(&lame->format, fmt); lame->sink = gavl_audio_sink_create(NULL, write_audio_func, lame, &lame->format); /* Allocate output buffer */ lame->buffer_alloc = (5 * fmt->samples_per_frame) / 4 + 7200 + 4096; lame->buffer = malloc(lame->buffer_alloc); ci.id = GAVL_CODEC_ID_MP3; if(lame->vbr_mode == vbr_off) ci.bitrate = lame->cbr_bitrate * 1000; else ci.bitrate = GAVL_BITRATE_VBR; /* Set software */ gavl_dictionary_set_string_nocopy(gavl_dictionary_get_dictionary_create(s, GAVL_META_METADATA), GAVL_META_SOFTWARE, gavl_sprintf("lame %s", get_lame_version())); /* Delay taken from ffmpeg */ lame->delay = lame_get_encoder_delay(lame->lame) + 528 + 1; ci.pre_skip = lame->delay; gavl_stream_set_compression_info(s, &ci); return lame->sink; } void bg_lame_destroy(bg_lame_t * lame) { int bytes_encoded; /* Flush */ if(lame->in_pts != GAVL_TIME_UNDEFINED) { bytes_encoded = lame_encode_flush(lame->lame, lame->buffer + lame->buffer_size, lame->buffer_alloc - lame->buffer_size); lame->buffer_size += bytes_encoded; if(lame->buffer_size) flush_packets(lame, 1); } /* Destroy */ if(lame->lame) { lame_close(lame->lame); lame->lame = NULL; } if(lame->buffer) { free(lame->buffer); lame->buffer = NULL; } if(lame->sink) { gavl_audio_sink_destroy(lame->sink); lame->sink = NULL; } gavl_packet_free(&lame->gp); free(lame); } bplaum-gmerlin-encoders-172394d/plugins/lame/bglame.h000066400000000000000000000122411513225514200225030ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include typedef struct bg_lame_s bg_lame_t; bg_lame_t * bg_lame_create(void); void bg_lame_destroy(bg_lame_t *); void bg_lame_set_parameter(bg_lame_t *, const char * name, const gavl_value_t * v); gavl_audio_sink_t * bg_lame_open(bg_lame_t * lame, gavl_dictionary_t * s); void bg_lame_set_packet_sink(bg_lame_t * lame, gavl_packet_sink_t * sink); /* Audio parameters */ static const bg_parameter_info_t audio_parameters[] = { #ifdef USE_VBR { .name = "bitrate_mode", .long_name = TRS("Bitrate mode"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("CBR"), .multi_names = (char const *[]){ "CBR", "ABR", "VBR", NULL }, .multi_labels = (char const *[]){ TRS("Constant"), TRS("Average"), TRS("Variable"), NULL }, }, #endif // LAME_FILE { .name = "stereo_mode", .long_name = TRS("Stereo mode"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("Auto"), .multi_names = (char const *[]){ "Stereo", "Joint stereo", "Auto", NULL }, .multi_labels = (char const *[]){ TRS("Stereo"), TRS("Joint stereo"), TRS("Auto"), NULL }, .help_string = TRS("Stereo: Completely independent channels\n\ Joint stereo: Improve quality (save bits) by using similarities of the channels\n\ Auto (recommended): Select one of the above depending on quality or bitrate setting") }, { .name = "quality", .long_name = TRS("Encoding speed"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(9), .val_default = GAVL_VALUE_INIT_INT(2), .help_string = TRS("0: Slowest encoding, best quality\n\ 9: Fastest encoding, worst quality") }, { .name = "cbr_bitrate", .long_name = TRS("Bitrate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(8), .val_max = GAVL_VALUE_INIT_INT(320), .val_default = GAVL_VALUE_INIT_INT(128), .help_string = TRS("Bitrate in kbps. If your selection is no \ valid mp3 bitrate, we'll choose the closest value.") }, #ifdef LAME_FILE { .name = "vbr_quality", .long_name = TRS("VBR Quality"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(9), .val_default = GAVL_VALUE_INIT_INT(4), .help_string = TRS("VBR Quality level. 0: best, 9: worst") }, { .name = "abr_bitrate", .long_name = TRS("ABR overall bitrate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(8), .val_max = GAVL_VALUE_INIT_INT(320), .val_default = GAVL_VALUE_INIT_INT(128), .help_string = TRS("Average bitrate for ABR mode") }, { .name = "abr_min_bitrate", .long_name = TRS("ABR min bitrate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(320), .val_default = GAVL_VALUE_INIT_INT(0), .help_string = TRS("Minimum bitrate for ABR mode. 0 means let lame decide. \ If your selection is no valid mp3 bitrate, we'll choose the closest value.") }, { .name = "abr_max_bitrate", .long_name = TRS("ABR max bitrate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(320), .val_default = GAVL_VALUE_INIT_INT(0), .help_string = TRS("Maximum bitrate for ABR mode. 0 means let lame decide. \ If your selection is no valid mp3 bitrate, we'll choose the closest value.") }, #endif // LAME_FILE { /* End of parameters */ } }; bplaum-gmerlin-encoders-172394d/plugins/lame/c_lame.c000066400000000000000000000052661513225514200225000ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include // #include #include #include #include #define USE_VBR #include "bglame.h" static void * create_codec() { return bg_lame_create(); } static void destroy_codec(void * priv) { bg_lame_destroy(priv); } static const bg_parameter_info_t * get_parameters(void * priv) { return audio_parameters; } static void set_parameter(void * priv, const char * name, const gavl_value_t * val) { bg_lame_set_parameter(priv, name, val); } static gavl_audio_sink_t * open_audio(void * priv, gavl_dictionary_t * s) { return bg_lame_open(priv, s); } static void set_packet_sink(void * priv, gavl_packet_sink_t * s) { bg_lame_set_packet_sink(priv, s); } gavl_codec_id_t compressions[] = { GAVL_CODEC_ID_MP3, GAVL_CODEC_ID_NONE }; static const gavl_codec_id_t * get_compressions(void * priv) { return compressions; } const bg_codec_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "c_lame", /* Unique short name */ .long_name = TRS("MP3"), .description = TRS("lame based MP3 encoder"), .type = BG_PLUGIN_COMPRESSOR_AUDIO, .priority = 5, .create = create_codec, .destroy = destroy_codec, .get_parameters = get_parameters, .set_parameter = set_parameter, }, .open_encode_audio = open_audio, .set_packet_sink = set_packet_sink, .get_compressions = get_compressions, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/lame/e_lame.c000066400000000000000000000261061513225514200224760ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #define USE_VBR #include "bglame.h" #include #include #define LOG_DOMAIN "e_lame" #include typedef struct { bg_lame_t * codec; gavl_dictionary_t s; char * filename; gavl_io_t * output; int do_id3v1; int do_id3v2; int id3v2_charset; int add_cover; bgen_id3v1_t * id3v1; bg_encoder_callbacks_t * cb; gavl_compression_info_t ci; gavl_packet_sink_t * psink; gavl_audio_sink_t * asink; bg_xing_t * xing; uint32_t xing_pos; int compressed; gavl_audio_format_t * fmt; } lame_priv_t; static void * create_lame() { lame_priv_t * ret; ret = calloc(1, sizeof(*ret)); ret->codec = bg_lame_create(); return ret; } static void destroy_lame(void * priv) { lame_priv_t * lame; lame = priv; if(lame->codec) bg_lame_destroy(lame->codec); free(lame); } static void set_callbacks_lame(void * data, bg_encoder_callbacks_t * cb) { lame_priv_t * lame = data; lame->cb = cb; } static const bg_parameter_info_t * get_audio_parameters_lame(void * data) { return audio_parameters; } static gavl_audio_sink_t * get_audio_sink_lame(void * data, int stream) { lame_priv_t * lame = data; return lame->asink; } /* Global parameters */ static const bg_parameter_info_t parameters[] = { { .name = "do_id3v1", .long_name = TRS("Write ID3V1.1 tag"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(1), }, { .name = "do_id3v2", .long_name = TRS("Write ID3V2 tag"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(1), }, { .name = "id3v2_charset", .long_name = TRS("ID3V2 Encoding"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("3"), .multi_names = (char const *[]){ "0", "3", NULL }, .multi_labels = (char const *[]){ TRS("ISO-8859-1"), TRS("UTF-8"), NULL }, }, { .name = "add_cover", .long_name = TRS("Add cover to ID3V2 tag if available"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(0), }, { /* End of parameters */ } }; static const bg_parameter_info_t * get_parameters_lame(void * data) { return parameters; } static void set_parameter_lame(void * data, const char * name, const gavl_value_t * v) { lame_priv_t * lame; lame = data; if(!name) return; else if(!strcmp(name, "do_id3v1")) lame->do_id3v1 = v->v.i; else if(!strcmp(name, "do_id3v2")) lame->do_id3v2 = v->v.i; else if(!strcmp(name, "add_cover")) lame->add_cover = v->v.i; else if(!strcmp(name, "id3v2_charset")) lame->id3v2_charset = atoi(v->v.str); } static int open_io_lame(void * data, gavl_io_t * io, const gavl_dictionary_t * metadata) { lame_priv_t * lame; bg_id3v2_t * id3v2; lame = data; lame->output = io; gavl_dictionary_reset(&lame->s); gavl_init_audio_stream(&lame->s); if(!gavl_io_can_seek(io)) { if(lame->do_id3v1) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Disabling ID3V1 tags for streaming output"); lame->do_id3v1 = 0; } if(lame->do_id3v2) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Disabling ID3V2 tags for streaming output"); lame->do_id3v2 = 0; } } if(lame->do_id3v1 && metadata) lame->id3v1 = bgen_id3v1_create(metadata); if(lame->do_id3v2 && metadata) { id3v2 = bg_id3v2_create(metadata, lame->add_cover); bg_id3v2_write(lame->output, id3v2, lame->id3v2_charset); bg_id3v2_destroy(id3v2); } return 1; } static int open_lame(void * data, const char * filename, const gavl_dictionary_t * metadata) { lame_priv_t * lame; gavl_io_t * io; lame = data; // bg_lame_open(&lame->com); // id3tag_init(lame->lame); if(!strcmp(filename, "-")) { io = gavl_io_create_file(stdout, 1, 0, 0); } else { FILE * f; lame->filename = gavl_filename_ensure_extension(filename, "mp3"); if(!bg_encoder_cb_create_output_file(lame->cb, lame->filename)) return 0; f = fopen(lame->filename, "wb+"); if(!f) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Cannot open %s: %s", lame->filename, strerror(errno)); return 0; } io = gavl_io_create_file(f, 1, 1, 1); } return open_io_lame(data, io, metadata); } static int writes_compressed_audio_lame(void * data, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { if(ci->id != GAVL_CODEC_ID_MP3) return 0; #if 0 if((ci->bitrate == GAVL_BITRATE_VBR) && (!gavl_io_can_seek(lame->output))) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "VBR mp3 cannot be written to streaming output"); return 0; } #endif return 1; } static gavl_sink_status_t write_audio_packet_func_lame(void * data, gavl_packet_t * p) { lame_priv_t * lame; lame = data; if((lame->ci.bitrate == GAVL_BITRATE_VBR) && !lame->xing) { lame->xing = bg_xing_create(p->buf.buf, p->buf.len); lame->xing_pos = gavl_io_position(lame->output); if(!bg_xing_write(lame->xing, lame->output)) return GAVL_SINK_ERROR; } if(lame->xing) bg_xing_update(lame->xing, p->buf.len); if(gavl_io_write_data(lame->output, p->buf.buf, p->buf.len) < p->buf.len) return GAVL_SINK_ERROR; return GAVL_SINK_OK; } static gavl_packet_sink_t * get_packet_sink_lame(void * data, int stream) { lame_priv_t * lame = data; return lame->psink; } static int add_audio_stream_lame(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format) { lame_priv_t * lame = data; gavl_audio_format_copy(gavl_stream_get_audio_format_nc(&lame->s), format); return 0; } static int add_audio_stream_compressed_lame(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { lame_priv_t * lame = data; add_audio_stream_lame(data, m, format); gavl_compression_info_copy(&lame->ci, ci); lame->compressed = 1; return 0; } static void set_audio_parameter_lame(void * data, int stream, const char * name, const gavl_value_t * val) { lame_priv_t * lame = data; bg_lame_set_parameter(lame->codec, name, val); } static int start_lame(void * data) { lame_priv_t * lame = data; /* Create sink */ lame->psink = gavl_packet_sink_create(NULL, write_audio_packet_func_lame, lame); if(!lame->compressed) { lame->asink = bg_lame_open(lame->codec, &lame->s); if((lame->ci.bitrate == GAVL_BITRATE_VBR) && (!gavl_io_can_seek(lame->output))) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Won't write VBR mp3 to streaming output"); return 0; } bg_lame_set_packet_sink(lame->codec, lame->psink); } return 1; } static int close_lame(void * data, int do_delete) { int ret = 1; lame_priv_t * lame = data; bg_lame_destroy(lame->codec); lame->codec = NULL; /* Write xing tag */ if(lame->xing) { uint64_t pos = gavl_io_position(lame->output); gavl_io_seek(lame->output, lame->xing_pos, SEEK_SET); bg_xing_write(lame->xing, lame->output); gavl_io_seek(lame->output, pos, SEEK_SET); } /* Write ID3V1 tag */ if(lame->output) { if(!gavl_io_can_seek(lame->output)) { gavl_io_flush(lame->output); } else { if(ret && lame->id3v1) { gavl_io_seek(lame->output, 0, SEEK_END); if(!bgen_id3v1_write(lame->output, lame->id3v1)) ret = 0; bgen_id3v1_destroy(lame->id3v1); lame->id3v1 = NULL; } } /* 4. Close output file */ gavl_io_destroy(lame->output); lame->output = NULL; } /* Clean up */ // bg_lame_close(&lame->com); if(lame->filename) { /* Remove if necessary */ if(do_delete) remove(lame->filename); free(lame->filename); lame->filename = NULL; } if(lame->psink) gavl_packet_sink_destroy(lame->psink); return 1; } static const char * get_extensions_lame(void * priv) { return "mp3"; } const bg_encoder_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "e_mp3", /* Unique short name */ .long_name = TRS("MP3"), .description = TRS("Encoder for mp3 files. Based on lame (http://www.mp3dev.org). Supports CBR, ABR and VBR as well as ID3V1 and ID3V2 tags."), .type = BG_PLUGIN_ENCODER_AUDIO, .flags = BG_PLUGIN_FILE | BG_PLUGIN_PIPE | BG_PLUGIN_GAVF_IO, .priority = 5, .create = create_lame, .destroy = destroy_lame, .get_parameters = get_parameters_lame, .set_parameter = set_parameter_lame, .get_extensions = get_extensions_lame, }, .max_audio_streams = 1, .max_video_streams = 0, .set_callbacks = set_callbacks_lame, .open = open_lame, .writes_compressed_audio = writes_compressed_audio_lame, .get_audio_parameters = get_audio_parameters_lame, .add_audio_stream = add_audio_stream_lame, .add_audio_stream_compressed = add_audio_stream_compressed_lame, .set_audio_parameter = set_audio_parameter_lame, .start = start_lame, .get_audio_sink = get_audio_sink_lame, .get_audio_packet_sink = get_packet_sink_lame, .close = close_lame }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/lame/xing.c000066400000000000000000000144221513225514200222170ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include /* * Lots of the stuff here was taken from gstxingmux.c from * gstreamer */ #define MAXFRAMESIZE 2881 struct bg_xing_s { /* Frame sizes */ uint32_t * frame_positions; int frame_positions_alloc; int num_frames; uint32_t total_bytes; uint32_t header; int tag_bytes; int samples_per_frame; uint8_t buffer[MAXFRAMESIZE]; }; #define PTR_2_32BE(p) \ ((*(p) << 24) | \ (*(p+1) << 16) | \ (*(p+2) << 8) | \ *(p+3)) #define INT_32BE_2_PTR(i, p) \ (p)[3] = (i) & 0xff; \ (p)[2] = ((i)>>8) & 0xff; \ (p)[1] = ((i)>>16) & 0xff; \ (p)[0] = ((i)>>24) & 0xff; static int get_xing_offset (uint32_t header) { uint32_t mpeg_version = (header >> 19) & 0x3; uint32_t channel_mode = (header >> 6) & 0x3; if (mpeg_version == 0x3) { if (channel_mode == 0x3) { return 0x11; } else { return 0x20; } } else { if (channel_mode == 0x3) { return 0x09; } else { return 0x11; } } } static const int mp3types_bitrates[2][3][16] = { { {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448,}, {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384,}, {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,} }, { {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256,}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160,}, {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160,} }, }; static const int mp3types_freqs[3][3] = { {44100, 48000, 32000}, {22050, 24000, 16000}, {11025, 12000, 8000} }; static int parse_header(uint32_t header, int * ret_size, int * ret_spf, int * ret_rate) { int length, spf; int samplerate, bitrate, layer, padding; int lsf, mpg25; /* No need for sanity checks, the input module should already do this */ if (header & (1 << 20)) { lsf = (header & (1 << 19)) ? 0 : 1; mpg25 = 0; } else { lsf = 1; mpg25 = 1; } layer = 4 - ((header >> 17) & 0x3); bitrate = (header >> 12) & 0xF; bitrate = mp3types_bitrates[lsf][layer - 1][bitrate] * 1000; if (bitrate == 0) return 0; samplerate = (header >> 10) & 0x3; samplerate = mp3types_freqs[lsf + mpg25][samplerate]; padding = (header >> 9) & 0x1; switch (layer) { case 1: length = 4 * ((bitrate * 12) / samplerate + padding); break; case 2: length = (bitrate * 144) / samplerate + padding; break; default: case 3: length = (bitrate * 144) / (samplerate << lsf) + padding; break; } if (layer == 1) spf = 384; else if (layer == 2 || lsf == 0) spf = 1152; else spf = 576; if (ret_size) *ret_size = length; if (ret_spf) *ret_spf = spf; if (ret_rate) *ret_rate = samplerate; return 1; } bg_xing_t * bg_xing_create(uint8_t * first_frame, int first_frame_len) { bg_xing_t * ret; int bitrate_index = 0; int xing_offset; ret = calloc(1, sizeof(*ret)); /* Get final header */ ret->header = PTR_2_32BE(first_frame); /* Switch off crc */ ret->header |= 0x00010000; /* Get bitrate */ do{ bitrate_index++; ret->header &= 0xffff0fff; ret->header |= bitrate_index << 12; parse_header (ret->header, &ret->tag_bytes, &ret->samples_per_frame, NULL); xing_offset = get_xing_offset(ret->header); } while (ret->tag_bytes < (4 + xing_offset + 4 + 4 + 4 + 4 + 100) && bitrate_index < 0xe); return ret; } void bg_xing_update(bg_xing_t * xing, int bytes) { if(xing->frame_positions_alloc < xing->num_frames + 1) { xing->frame_positions_alloc += 1024; xing->frame_positions = realloc(xing->frame_positions, xing->frame_positions_alloc * sizeof(*xing->frame_positions)); } xing->frame_positions[xing->num_frames] = xing->total_bytes; xing->num_frames++; xing->total_bytes+= bytes; } static const char xing_sig[4] = "Xing"; int bg_xing_write(bg_xing_t * xing, gavl_io_t * out) { uint32_t tmp; uint64_t tmp_64; int i; uint8_t * ptr; if(xing->num_frames) { /* Finalize tag */ ptr = xing->buffer; INT_32BE_2_PTR(xing->header, ptr); ptr += 4; ptr += get_xing_offset(xing->header); memcpy(ptr, xing_sig, 4); ptr += 4; /* Flags */ tmp = 7; // FRAMES_FLAG | BYTES_FLAG | TOC_FLAG INT_32BE_2_PTR(tmp, ptr); ptr += 4; /* Num frames */ tmp = xing->num_frames; INT_32BE_2_PTR(tmp, ptr); ptr += 4; /* Num bytes */ tmp = xing->total_bytes; INT_32BE_2_PTR(tmp, ptr); ptr += 4; /* Seek table */ for(i = 0; i < 100; i++) { tmp_64 = xing->frame_positions[(i * xing->num_frames) / 100]; // fprintf(stderr, "Seek entry %d: %ld ", i, tmp_64); tmp_64 *= 256; tmp_64 /= xing->total_bytes; // fprintf(stderr, "%ld\n",tmp_64); *ptr = tmp_64; ptr++; } } if(gavl_io_write_data(out, xing->buffer, xing->tag_bytes) < xing->tag_bytes) return 0; return 1; } void bg_xing_destroy(bg_xing_t * xing) { if(xing->frame_positions) free(xing->frame_positions); free(xing); } bplaum-gmerlin-encoders-172394d/plugins/lame/xing.h000066400000000000000000000022431513225514200222220ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ typedef struct bg_xing_s bg_xing_t; bg_xing_t * bg_xing_create(uint8_t * first_frame, int first_frame_len); void bg_xing_update(bg_xing_t * xing, int bytes); int bg_xing_write(bg_xing_t * xing, gavl_io_t * out); void bg_xing_destroy(bg_xing_t * xing); bplaum-gmerlin-encoders-172394d/plugins/ogg/000077500000000000000000000000001513225514200207415ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/plugins/ogg/Makefile.am000066400000000000000000000047271513225514200230070ustar00rootroot00000000000000gmerlin_plugindir = @gmerlin_plugindir@ AM_CPPFLAGS = -I$(top_srcdir)/include AM_LDFLAGS = @GMERLIN_PLUGIN_LDFLAGS@ -avoid-version -module if HAVE_THEORAENC theoraenc_plugins = c_theoraenc.la theora_sources = theora.c else theoraenc_plugins = theora_sources = endif if HAVE_OPUS opus_plugins = e_opus.la c_opusenc.la opus_sources = opus.c else opus_plugins = opus_sources = endif if HAVE_FLAC flac_plugins = c_flacenc.la flac_sources = flac.c bgflac_libs = $(top_builddir)/lib/libbgflac.la @FLAC_LIBS@ else flac_plugins = flac_sources = endif if HAVE_OGG_VIDEO oggvideo_plugins = e_oggvideo.la else oggvideo_plugins = endif gmerlin_plugin_LTLIBRARIES = \ e_vorbis.la \ c_vorbisenc.la \ $(theoraenc_plugins) \ $(opus_plugins) \ $(flac_plugins) \ $(oggvideo_plugins) AM_CFLAGS = -DLOCALE_DIR=\"$(localedir)\" e_vorbis_la_CFLAGS = @VORBISENC_CFLAGS@ $(AM_CFLAGS) e_vorbis_la_SOURCES = e_vorbis.c vorbis.c ogg_common.c e_vorbis_la_LIBADD = $(top_builddir)/lib/libgmerlin_encoders.la @VORBISENC_LIBS@ e_oggvideo_la_CFLAGS = \ @THEORAENC_CFLAGS@ \ @VORBISENC_CFLAGS@ \ @FLAC_CFLAGS@ \ @OPUS_CFLAGS@ \ $(AM_CFLAGS) e_oggvideo_la_SOURCES = \ e_oggvideo.c \ vorbis.c \ $(flac_sources) \ $(opus_sources) \ $(theora_sources) \ ogg_common.c e_oggvideo_la_LIBADD = \ $(top_builddir)/lib/libgmerlin_encoders.la \ @VORBISENC_LIBS@ \ @THEORAENC_LIBS@ \ @OPUS_LIBS@ \ $(bgflac_libs) e_opus_la_CFLAGS = @OPUS_CFLAGS@ $(AM_CFLAGS) e_opus_la_SOURCES = e_opus.c opus.c ogg_common.c e_opus_la_LIBADD = $(top_builddir)/lib/libgmerlin_encoders.la @OPUS_LIBS@ @OGG_LIBS@ noinst_HEADERS = ogg_common.h c_theoraenc_la_CFLAGS = \ @THEORAENC_CFLAGS@ \ $(AM_CFLAGS) c_theoraenc_la_SOURCES = \ theora.c \ c_theoraenc.c \ ogg_common.c c_theoraenc_la_LIBADD = \ $(top_builddir)/lib/libgmerlin_encoders.la \ @THEORAENC_LIBS@ c_vorbisenc_la_CFLAGS = \ @VORBISENC_CFLAGS@ $(AM_CFLAGS) c_vorbisenc_la_SOURCES = \ vorbis.c \ c_vorbisenc.c \ ogg_common.c c_vorbisenc_la_LIBADD = \ $(top_builddir)/lib/libgmerlin_encoders.la \ @VORBISENC_LIBS@ c_opusenc_la_CFLAGS = \ @OPUS_CFLAGS@ $(AM_CFLAGS) c_opusenc_la_SOURCES = \ opus.c \ c_opusenc.c \ ogg_common.c c_opusenc_la_LIBADD = \ $(top_builddir)/lib/libgmerlin_encoders.la \ @OPUS_LIBS@ \ @OGG_LIBS@ # c_flacenc_la_CFLAGS = \ @FLAC_CFLAGS@ $(AM_CFLAGS) c_flacenc_la_SOURCES = \ flac.c \ c_flacenc.c \ ogg_common.c c_flacenc_la_LIBADD = \ $(top_builddir)/lib/libgmerlin_encoders.la \ $(bgflac_libs) \ @FLAC_LIBS@ \ @OGG_LIBS@ EXTRA_c_vorbisenc_la_SOURCES = \ _codec_plugin.c bplaum-gmerlin-encoders-172394d/plugins/ogg/_codec_plugin.c000066400000000000000000000061661513225514200237100ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ typedef struct { void * priv; const bg_ogg_codec_t * codec; } stream_codec_t; static void * create_codec() { stream_codec_t * ret = calloc(1, sizeof(*ret)); ret->codec = &CODEC; ret->priv = ret->codec->create(); return ret; } static void destroy_codec(void * priv) { stream_codec_t * c = priv; c->codec->close(c->priv); free(c); } static const bg_parameter_info_t * get_parameters(void * priv) { stream_codec_t * c = priv; return c->codec->get_parameters(); } static void set_parameter(void * priv, const char * name, const gavl_value_t * val) { stream_codec_t * c = priv; c->codec->set_parameter(c->priv, name, val); } #ifdef IS_AUDIO static gavl_audio_sink_t * open_audio(void * priv, gavl_dictionary_t * s) { stream_codec_t * c = priv; return c->codec->init_audio(c->priv, s); } #else static gavl_video_sink_t * open_video(void * priv, gavl_dictionary_t * s) { stream_codec_t * c = priv; return c->codec->init_video(c->priv, s); } #endif static void set_packet_sink(void * priv, gavl_packet_sink_t * s) { stream_codec_t * c = priv; return c->codec->set_packet_sink(c->priv, s); } gavl_codec_id_t compressions[] = { COMPRESSION, GAVL_CODEC_ID_NONE }; static const gavl_codec_id_t * get_compressions(void * priv) { return compressions; } const bg_codec_plugin_t the_plugin = { .common = { BG_LOCALE, .name = CODEC_NAME, /* Unique short name */ .long_name = CODEC_LONG_NAME, .description = CODEC_DESC, #ifdef IS_AUDIO .type = BG_PLUGIN_COMPRESSOR_AUDIO, #else .type = BG_PLUGIN_COMPRESSOR_VIDEO, #endif .priority = 5, .create = create_codec, .destroy = destroy_codec, .get_parameters = get_parameters, .set_parameter = set_parameter, }, #ifdef IS_AUDIO .open_encode_audio = open_audio, #else .open_encode_video = open_video, #endif .set_packet_sink = set_packet_sink, .get_compressions = get_compressions, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/ogg/c_flacenc.c000066400000000000000000000024701513225514200230050ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ogg_common.h" extern const bg_ogg_codec_t bg_flacogg_codec; #define IS_AUDIO #define CODEC_NAME "c_flacenc" #define CODEC_LONG_NAME TRS("Flac") #define CODEC bg_flacogg_codec #define COMPRESSION GAVL_CODEC_ID_FLAC #define CODEC_DESC TRS("Libflac based encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ogg/c_opusenc.c000066400000000000000000000024631513225514200230700ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ogg_common.h" extern const bg_ogg_codec_t bg_opus_codec; #define IS_AUDIO #define CODEC_NAME "c_opusenc" #define CODEC_LONG_NAME TRS("Opus") #define CODEC bg_opus_codec #define COMPRESSION GAVL_CODEC_ID_OPUS #define CODEC_DESC TRS("Libopus based encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ogg/c_theoraenc.c000066400000000000000000000024561513225514200233660ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ogg_common.h" extern const bg_ogg_codec_t bg_theora_codec; #define CODEC_NAME "c_theoraenc" #define CODEC_LONG_NAME TRS("Theora") #define CODEC bg_theora_codec #define COMPRESSION GAVL_CODEC_ID_THEORA #define CODEC_DESC TRS("Libtheora based encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ogg/c_vorbisenc.c000066400000000000000000000024771513225514200234130ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include "ogg_common.h" extern const bg_ogg_codec_t bg_vorbis_codec; #define IS_AUDIO #define CODEC_NAME "c_vorbisenc" #define CODEC_LONG_NAME TRS("Vorbis") #define CODEC bg_vorbis_codec #define COMPRESSION GAVL_CODEC_ID_VORBIS #define CODEC_DESC TRS("Libvorbis based encoder") #include "_codec_plugin.c" bplaum-gmerlin-encoders-172394d/plugins/ogg/e_oggvideo.c000066400000000000000000000223451513225514200232220ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include #include "ogg_common.h" #ifdef HAVE_THEORAENC extern const bg_ogg_codec_t bg_theora_codec; #endif extern const bg_ogg_codec_t bg_vorbis_codec; #ifdef HAVE_FLAC extern const bg_ogg_codec_t bg_flacogg_codec; #endif #ifdef HAVE_OPUS extern const bg_ogg_codec_t bg_opus_codec; #endif static bg_ogg_codec_t const * const audio_codecs[] = { &bg_vorbis_codec, #ifdef HAVE_FLAC &bg_flacogg_codec, #endif #ifdef HAVE_OPUS &bg_opus_codec, #endif NULL, }; static bg_ogg_codec_t const * const video_codecs[] = { #ifdef HAVE_THEORAENC &bg_theora_codec, #endif NULL, }; static const bg_parameter_info_t * get_audio_parameters_oggvideo(void * data) { return bg_ogg_encoder_get_audio_parameters(data, audio_codecs); } static const bg_parameter_info_t * get_video_parameters_oggvideo(void * data) { return bg_ogg_encoder_get_video_parameters(data, video_codecs); } static int add_audio_stream_oggvideo(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format) { bg_ogg_stream_t * s; s = bg_ogg_encoder_add_audio_stream(data, m, format); return s->index; } static int add_audio_stream_compressed_oggvideo(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { bg_ogg_stream_t * s; s = bg_ogg_encoder_add_audio_stream_compressed(data, m, format, ci); if(ci->id == GAVL_CODEC_ID_VORBIS) bg_ogg_encoder_init_stream(data, s, &bg_vorbis_codec); #ifdef HAVE_OPUS else if(ci->id == GAVL_CODEC_ID_OPUS) bg_ogg_encoder_init_stream(data, s, &bg_opus_codec); #endif #ifdef HAVE_FLAC else if(ci->id == GAVL_CODEC_ID_FLAC) bg_ogg_encoder_init_stream(data, s, &bg_flacogg_codec); #endif #ifdef HAVE_SPEEX else if(ci->id == GAVL_CODEC_ID_SPEEX) bg_ogg_encoder_init_stream(data, s, &bg_speex_codec); #endif return s->index; } static int add_video_stream_oggvideo(void * data, const gavl_dictionary_t * m, const gavl_video_format_t * format) { bg_ogg_stream_t * s; s = bg_ogg_encoder_add_video_stream(data, m, format); return s->index; } static int add_video_stream_compressed_oggvideo(void * data, const gavl_dictionary_t * m, const gavl_video_format_t * format, const gavl_compression_info_t * ci) { bg_ogg_stream_t * s; s = bg_ogg_encoder_add_video_stream_compressed(data, m, format, ci); #ifdef HAVE_THEORAENC if(ci->id == GAVL_CODEC_ID_THEORA) bg_ogg_encoder_init_stream(data, s, &bg_theora_codec); #endif #ifdef HAVE_SCHROEDINGER if(ci->id == GAVL_CODEC_ID_DIRAC) bg_ogg_encoder_init_stream(data, s, &bg_schroedinger_codec); #endif return s->index; } static void set_audio_parameter_oggvideo(void * data, int stream, const char * name, const gavl_value_t * val) { int i; const char * codec_name; const gavl_dictionary_t * codec; bg_ogg_encoder_t * enc = data; bg_ogg_stream_t * s = &enc->audio_streams[stream]; if(!name) return; if(!strcmp(name, "codec")) { i = 0; codec = gavl_value_get_dictionary(val); codec_name = gavl_dictionary_get_string(codec, BG_CFG_TAG_NAME); while(audio_codecs[i]) { if(!strcmp(audio_codecs[i]->name, codec_name)) { bg_ogg_encoder_init_stream(data, enc->audio_streams + stream, audio_codecs[i]); break; } i++; } bg_cfg_section_apply(codec, NULL, s->codec->set_parameter, s->codec_priv); } } static void set_video_parameter_oggvideo(void * data, int stream, const char * name, const gavl_value_t * val) { int i; const char * codec_name; const gavl_dictionary_t * codec; bg_ogg_encoder_t * enc = data; bg_ogg_stream_t * s = &enc->video_streams[stream]; if(!name) return; if(!strcmp(name, "codec")) { i = 0; codec = gavl_value_get_dictionary(val); codec_name = gavl_dictionary_get_string(codec, BG_CFG_TAG_NAME); while(video_codecs[i]) { if(!strcmp(video_codecs[i]->name, codec_name)) { bg_ogg_encoder_init_stream(data, enc->video_streams + stream, video_codecs[i]); break; } i++; } bg_cfg_section_apply(codec, NULL, s->codec->set_parameter, s->codec_priv); } else bg_ogg_encoder_set_video_parameter(data, stream, name, val); } static int open_oggvideo(void * data, const char * file, const gavl_dictionary_t * metadata) { return bg_ogg_encoder_open(data, file, NULL, metadata, "ogv"); } static int open_io_oggvideo(void * data, gavl_io_t * io, const gavl_dictionary_t * metadata) { return bg_ogg_encoder_open(data, NULL, io, metadata, "ogv"); } static int writes_compressed_audio_oggvideo(void* data, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { if((ci->id == GAVL_CODEC_ID_VORBIS) #ifdef HAVE_FLAC || (ci->id == GAVL_CODEC_ID_FLAC) #endif #ifdef HAVE_SPEEX || (ci->id == GAVL_CODEC_ID_SPEEX) #endif #ifdef HAVE_OPUS || (ci->id == GAVL_CODEC_ID_OPUS) #endif ) return 1; else return 0; } static int writes_compressed_video_oggvideo(void * data, const gavl_video_format_t * format, const gavl_compression_info_t * ci) { if((ci->id == GAVL_CODEC_ID_THEORA) || (ci->id == GAVL_CODEC_ID_DIRAC)) return 1; else return 0; } static const char * get_extensions_oggvideo(void * priv) { return "ogv"; } const bg_encoder_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "e_oggvideo", /* Unique short name */ .long_name = TRS("OGG Video"), .description = TRS("Encoder for Ogg A/V files."), .type = BG_PLUGIN_ENCODER, .flags = BG_PLUGIN_FILE | BG_PLUGIN_PIPE, .priority = 5, .create = bg_ogg_encoder_create, .destroy = bg_ogg_encoder_destroy, #if 0 .get_parameters = get_parameters_oggvideo, .set_parameter = set_parameter_oggvideo, #endif .get_extensions = get_extensions_oggvideo, }, .max_audio_streams = -1, .max_video_streams = -1, .set_callbacks = bg_ogg_encoder_set_callbacks, .writes_compressed_audio = writes_compressed_audio_oggvideo, .writes_compressed_video = writes_compressed_video_oggvideo, .open = open_oggvideo, .open_io = open_io_oggvideo, .get_audio_parameters = get_audio_parameters_oggvideo, .get_video_parameters = get_video_parameters_oggvideo, .add_audio_stream = add_audio_stream_oggvideo, .add_video_stream = add_video_stream_oggvideo, .add_audio_stream_compressed = add_audio_stream_compressed_oggvideo, .add_video_stream_compressed = add_video_stream_compressed_oggvideo, .set_audio_parameter = set_audio_parameter_oggvideo, .set_video_parameter = set_video_parameter_oggvideo, .set_video_pass = bg_ogg_encoder_set_video_pass, .start = bg_ogg_encoder_start, .get_audio_sink = bg_ogg_encoder_get_audio_sink, .get_video_sink = bg_ogg_encoder_get_video_sink, .get_audio_packet_sink = bg_ogg_encoder_get_audio_packet_sink, .get_video_packet_sink = bg_ogg_encoder_get_video_packet_sink, .close = bg_ogg_encoder_close, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/ogg/e_opus.c000066400000000000000000000105241513225514200224010ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include "ogg_common.h" extern const bg_ogg_codec_t bg_opus_codec; static const bg_parameter_info_t * get_audio_parameters_opus(void * data) { return bg_opus_codec.get_parameters(); } static int add_audio_stream_opus(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format) { bg_ogg_stream_t * ret; ret = bg_ogg_encoder_add_audio_stream(data, m, format); bg_ogg_encoder_init_stream(data, ret, &bg_opus_codec); return ret->index; } static int open_opus(void * data, const char * file, const gavl_dictionary_t * metadata) { return bg_ogg_encoder_open(data, file, NULL, metadata, "opus"); } static int open_io_opus(void * data, gavl_io_t * io, const gavl_dictionary_t * metadata) { return bg_ogg_encoder_open(data, NULL, io, metadata, "opus"); } static int writes_compressed_audio_opus(void* data, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { if(ci->id == GAVL_CODEC_ID_OPUS) return 1; else return 0; } static int add_audio_stream_compressed_opus(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { bg_ogg_stream_t * ret; ret = bg_ogg_encoder_add_audio_stream_compressed(data, m, format, ci); bg_ogg_encoder_init_stream(data, ret, &bg_opus_codec); return ret->index; } static const char * get_extensions_opus(void * priv) { return "opus"; } const bg_encoder_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "e_opus", /* Unique short name */ .long_name = TRS("Opus"), .description = TRS("Encoder for Opus files"), .type = BG_PLUGIN_ENCODER_AUDIO, .flags = BG_PLUGIN_FILE | BG_PLUGIN_PIPE, .priority = 5, .create = bg_ogg_encoder_create, .destroy = bg_ogg_encoder_destroy, #if 0 .get_parameters = get_parameters_opus, .set_parameter = set_parameter_opus, #endif .get_extensions = get_extensions_opus, }, .max_audio_streams = 1, .max_video_streams = 0, .set_callbacks = bg_ogg_encoder_set_callbacks, .open = open_opus, .open_io = open_io_opus, .get_audio_parameters = get_audio_parameters_opus, .writes_compressed_audio = writes_compressed_audio_opus, .add_audio_stream = add_audio_stream_opus, .add_audio_stream_compressed = add_audio_stream_compressed_opus, .set_audio_parameter = bg_ogg_encoder_set_audio_parameter, .start = bg_ogg_encoder_start, .get_audio_sink = bg_ogg_encoder_get_audio_sink, .get_audio_packet_sink = bg_ogg_encoder_get_audio_packet_sink, .close = bg_ogg_encoder_close, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/ogg/e_vorbis.c000066400000000000000000000104121513225514200227130ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include "ogg_common.h" extern const bg_ogg_codec_t bg_vorbis_codec; static const bg_parameter_info_t * get_audio_parameters_vorbis(void * data) { return bg_vorbis_codec.get_parameters(); } static int add_audio_stream_vorbis(void * data, const gavl_dictionary_t *m, const gavl_audio_format_t * format) { bg_ogg_stream_t * s; s = bg_ogg_encoder_add_audio_stream(data, m, format); bg_ogg_encoder_init_stream(data, s, &bg_vorbis_codec); return s->index; } static int open_vorbis(void * data, const char * file, const gavl_dictionary_t * metadata) { return bg_ogg_encoder_open(data, file, NULL, metadata, "ogg"); } static int open_io_vorbis(void * data, gavl_io_t * io, const gavl_dictionary_t * metadata) { return bg_ogg_encoder_open(data, NULL, io, metadata, "ogg"); } static int writes_compressed_audio_vorbis(void* data, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { if(ci->id == GAVL_CODEC_ID_VORBIS) return 1; else return 0; } static int add_audio_stream_compressed_vorbis(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { bg_ogg_stream_t * s; s = bg_ogg_encoder_add_audio_stream_compressed(data, m, format, ci); bg_ogg_encoder_init_stream(data, s, &bg_vorbis_codec); return s->index; } static const char * get_extensions_vorbis(void * priv) { return "ogg"; } const bg_encoder_plugin_t the_plugin = { .common = { BG_LOCALE, .name = "e_vorbis", /* Unique short name */ .long_name = TRS("Ogg Vorbis"), .description = TRS("Encoder for Vorbis files"), .type = BG_PLUGIN_ENCODER_AUDIO, .flags = BG_PLUGIN_FILE | BG_PLUGIN_PIPE, .priority = 5, .create = bg_ogg_encoder_create, .destroy = bg_ogg_encoder_destroy, .get_extensions = get_extensions_vorbis, }, .max_audio_streams = 1, .max_video_streams = 0, .set_callbacks = bg_ogg_encoder_set_callbacks, .writes_compressed_audio = writes_compressed_audio_vorbis, .open = open_vorbis, .open_io = open_io_vorbis, .get_audio_parameters = get_audio_parameters_vorbis, .add_audio_stream = add_audio_stream_vorbis, .add_audio_stream_compressed = add_audio_stream_compressed_vorbis, .set_audio_parameter = bg_ogg_encoder_set_audio_parameter, .start = bg_ogg_encoder_start, .get_audio_sink = bg_ogg_encoder_get_audio_sink, .get_audio_packet_sink = bg_ogg_encoder_get_audio_packet_sink, .close = bg_ogg_encoder_close, }; /* Include this into all plugin modules exactly once to let the plugin loader obtain the API version */ BG_GET_PLUGIN_API_VERSION; bplaum-gmerlin-encoders-172394d/plugins/ogg/flac.c000066400000000000000000000113731513225514200220170ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #define LOG_DOMAIN "oggflac" #include #include "ogg_common.h" #include #include /* Way too large but save */ #define BUFFER_SIZE (MAX_BYTES_PER_FRAME*10) typedef struct { bg_flac_t * enc; int header_written; /* This is ugly: To properly set the e_o_s flag of the last page, we must cache the last frame and write it delayed. */ uint8_t * frame; int frame_size; int frame_alloc; int64_t samples_encoded; int64_t frames_encoded; int frame_samples; int write_error; } flacogg_t; static int init_compressed_flacogg(bg_ogg_stream_t * s) { int ret = 0; ogg_packet op; int len; uint8_t * ptr; uint8_t * comment_ptr; gavl_io_t * io; uint8_t header_bytes[] = { 0x7f, 0x46, 0x4C, 0x41, 0x43, // FLAC 0x01, 0x00, // Major, minor version 0x00, 0x01, // Number of other header packets (Big Endian) }; gavl_compression_info_t ci; gavl_compression_info_init(&ci); gavl_stream_get_compression_info(&s->s, &ci); memset(&op, 0, sizeof(op)); /* Not the last metadata packet */ ci.codec_header.buf[4] &= 0x7f; op.packet = malloc(9 + ci.codec_header.len); memcpy(op.packet, header_bytes, 9); memcpy(op.packet+9, ci.codec_header.buf, ci.codec_header.len); op.bytes = ci.codec_header.len + 9; if(!bg_ogg_stream_write_header_packet(s, &op)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Got no Flac ID page"); goto fail; } free(op.packet); /* Vorbis comment */ io = gavl_io_create_mem_write(); bg_vorbis_comment_write(io, gavl_stream_get_metadata(&s->s), s->m_global, 0); comment_ptr = gavl_io_mem_get_buf(io, &len); op.packet = malloc(4 + len); ptr = op.packet; ptr[0] = 0x84; // Last metadata packet ptr++; GAVL_24BE_2_PTR(len, ptr); ptr += 3; memcpy(ptr, comment_ptr, len); op.bytes = len + 4; free(comment_ptr); gavl_io_destroy(io); if(!bg_ogg_stream_write_header_packet(s, &op)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Got no Flac ID page"); free(op.packet); goto fail; } ret = 1; fail: gavl_compression_info_free(&ci); free(op.packet); return ret; } static void * create_flacogg() { flacogg_t * ret; ret = calloc(1, sizeof(*ret)); ret->enc = bg_flac_create(); return ret; } static const bg_parameter_info_t * get_parameters_flacogg() { return bg_flac_get_parameters(); } static void set_parameter_flacogg(void * data, const char * name, const gavl_value_t * v) { flacogg_t * flacogg; flacogg = data; bg_flac_set_parameter(flacogg->enc, name, v); } static gavl_audio_sink_t * init_flacogg(void * data, gavl_dictionary_t * stream) { flacogg_t * flacogg = data; return bg_flac_start_uncompressed(flacogg->enc, stream); } static void set_packet_sink(void * data, gavl_packet_sink_t * psink) { flacogg_t * flacogg = data; bg_flac_set_sink(flacogg->enc, psink); } static int close_flacogg(void * data) { int ret = 1; // uint8_t buf[1] = { 0x00 }; flacogg_t * flacogg; flacogg = data; bg_flac_free(flacogg->enc); flacogg->enc = NULL; if(flacogg->frame) { free(flacogg->frame); flacogg->frame = NULL; } free(flacogg); return ret; } const bg_ogg_codec_t bg_flacogg_codec = { .name = "flacogg", .long_name = TRS("Flac encoder"), .create = create_flacogg, .get_parameters = get_parameters_flacogg, .set_parameter = set_parameter_flacogg, .init_audio = init_flacogg, .init_audio_compressed = init_compressed_flacogg, .set_packet_sink = set_packet_sink, .close = close_flacogg, }; bplaum-gmerlin-encoders-172394d/plugins/ogg/ogg_common.c000066400000000000000000000531331513225514200232360ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include "ogg_common.h" #include #define LOG_DOMAIN "ogg" void * bg_ogg_encoder_create() { bg_ogg_encoder_t * ret; ret = calloc(1, sizeof(*ret)); return ret; } static void free_stream(bg_ogg_stream_t * s) { gavl_dictionary_free(&s->s); if(s->stats_file) free(s->stats_file); gavl_packet_free(&s->last_packet); } void bg_ogg_encoder_destroy(void * data) { int i; bg_ogg_encoder_t * e = data; if(e->io) bg_ogg_encoder_close(e, 1); if(e->io_priv) gavl_io_destroy(e->io_priv); if(e->audio_streams) { for(i = 0; i < e->num_audio_streams; i++) free_stream(&e->audio_streams[i]); free(e->audio_streams); } if(e->video_streams) { for(i = 0; i < e->num_video_streams; i++) free_stream(&e->video_streams[i]); free(e->video_streams); } if(e->filename) free(e->filename); if(e->audio_parameters) bg_parameter_info_destroy_array(e->audio_parameters); if(e->video_parameters) bg_parameter_info_destroy_array(e->video_parameters); free(e); } void bg_ogg_encoder_set_callbacks(void * data, bg_encoder_callbacks_t * cb) { bg_ogg_encoder_t * e = data; e->cb = cb; } int bg_ogg_encoder_open(void * data, const char * file, gavl_io_t * io, const gavl_dictionary_t * metadata, const char * ext) { bg_ogg_encoder_t * e = data; if(file) { if(!strcmp(file, "-")) { /* stdout */ e->io_priv = gavl_io_create_file(stdout, 1, 0, 0); } else { FILE * f; e->filename = gavl_filename_ensure_extension(file, ext); if(!bg_encoder_cb_create_output_file(e->cb, e->filename)) return 0; if(!(f = fopen(e->filename, "w"))) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Cannot open file %s: %s", file, strerror(errno)); return 0; } e->io_priv = gavl_io_create_file(f, 1, 1, 1); } e->io = e->io_priv; } else if(io) { e->io = io; } if(e->open_callback) { if(!e->open_callback(e->open_callback_data)) return 0; } e->serialno = rand(); if(metadata) gavl_dictionary_copy(&e->metadata, metadata); return 1; } static int bg_ogg_stream_flush_page(bg_ogg_stream_t * s, int force) { int result; ogg_page og; memset(&og, 0, sizeof(og)); if(force) result = ogg_stream_flush(&s->os,&og); else result = ogg_stream_pageout(&s->os,&og); if(result) { if((gavl_io_write_data(s->enc->io, og.header,og.header_len) < og.header_len) || (gavl_io_write_data(s->enc->io, og.body,og.body_len) < og.body_len)) return -1; else return 1; } return 0; } int bg_ogg_stream_write_header_packet(bg_ogg_stream_t * s, ogg_packet * p) { if(!s->packetno) p->b_o_s = 1; else p->b_o_s = 0; p->packetno = s->packetno++; ogg_stream_packetin(&s->os, p); if(!s->num_headers) { if(bg_ogg_stream_flush_page(s, 1) <= 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Got no ID page"); return 0; } } s->num_headers++; return 1; } int bg_ogg_stream_flush(bg_ogg_stream_t * s, int force) { int result, ret = 0; while((result = bg_ogg_stream_flush_page(s, force)) > 0) ret = 1; if(result < 0) return result; return ret; } void bg_ogg_packet_to_gavl(ogg_packet * src, gavl_packet_t * dst, int64_t * pts) { dst->buf.buf = src->packet; dst->buf.len = src->bytes; if(pts) { dst->pts = *pts; dst->duration = src->granulepos - dst->pts; *pts += dst->duration; } if(src->e_o_s) dst->flags |= GAVL_PACKET_LAST; else dst->flags &= ~GAVL_PACKET_LAST; } void bg_ogg_packet_from_gavl(bg_ogg_stream_t * s, gavl_packet_t * src, ogg_packet * dst) { dst->packet = src->buf.buf; dst->bytes = src->buf.len; dst->granulepos = src->pts + src->duration; if(src->flags & GAVL_PACKET_LAST) dst->e_o_s = 1; else dst->e_o_s = 0; if(s->codec->convert_packet) s->codec->convert_packet(s, src, dst); } static gavl_sink_status_t write_gavl_packet(void * data, gavl_packet_t * p) { bg_ogg_stream_t * s = data; /* Flush the last packet */ if(s->last_packet.buf.len) { ogg_packet op; int force_flush = 0; memset(&op, 0, sizeof(op)); bg_ogg_packet_from_gavl(s, &s->last_packet, &op); op.packetno = s->packetno++; ogg_stream_packetin(&s->os, &op); if((s->flags & STREAM_KEYFRAMES) && (p->flags & GAVL_PACKET_KEYFRAME)) force_flush = 1; /* Flush pages if any */ if(bg_ogg_stream_flush(s, force_flush) < 0) return GAVL_SINK_ERROR; } /* Save this packet */ gavl_packet_copy(&s->last_packet, p); return GAVL_SINK_OK; } static int flush_stream(bg_ogg_stream_t * s) { /* Flush the last packet */ if(s->last_packet.buf.len) { ogg_packet op; memset(&op, 0, sizeof(op)); bg_ogg_packet_from_gavl(s, &s->last_packet, &op); op.packetno = s->packetno++; op.e_o_s = 1; ogg_stream_packetin(&s->os, &op); /* Flush pages if any */ if(bg_ogg_stream_flush(s, 1) < 0) return 0; } return 1; } static bg_ogg_stream_t * append_stream(bg_ogg_encoder_t * e, bg_ogg_stream_t ** streams_p, int * num_streams_p) { bg_ogg_stream_t * ret; bg_ogg_stream_t * streams = *streams_p; int num_streams = *num_streams_p; streams = realloc(streams, (num_streams+1)*sizeof(*streams)); ret = streams + num_streams; ret->index = num_streams; memset(ret, 0, sizeof(*ret)); ogg_stream_init(&ret->os, e->serialno++); ret->enc = e; ret->index = num_streams; ret->m_global = &e->metadata; num_streams++; *num_streams_p = num_streams; *streams_p = streams; return ret; } bg_ogg_stream_t * bg_ogg_encoder_add_audio_stream(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format) { gavl_dictionary_t * m_stream; bg_ogg_stream_t * s; bg_ogg_encoder_t * e = data; s = append_stream(e, &e->audio_streams, &e->num_audio_streams); gavl_init_audio_stream(&s->s); m_stream = gavl_stream_get_metadata_nc(&s->s); gavl_dictionary_copy(m_stream, m); gavl_metadata_delete_compression_fields(m_stream); gavl_audio_format_copy(gavl_stream_get_audio_format_nc(&s->s), format); return s; } bg_ogg_stream_t * bg_ogg_encoder_add_video_stream(void * data, const gavl_dictionary_t * m, const gavl_video_format_t * format) { gavl_dictionary_t * m_stream; bg_ogg_stream_t * s; bg_ogg_encoder_t * e = data; s = append_stream(e, &e->video_streams, &e->num_video_streams); gavl_init_video_stream(&s->s); m_stream = gavl_stream_get_metadata_nc(&s->s); gavl_dictionary_copy(m_stream, m); gavl_metadata_delete_compression_fields(m_stream); gavl_video_format_copy(gavl_stream_get_video_format_nc(&s->s), format); gavl_metadata_delete_compression_fields(m_stream); return s; } bg_ogg_stream_t * bg_ogg_encoder_add_audio_stream_compressed(void * data, const gavl_dictionary_t * m, const gavl_audio_format_t * format, const gavl_compression_info_t * ci) { gavl_dictionary_t * m_stream; bg_ogg_stream_t * s; bg_ogg_encoder_t * e = data; s = append_stream(e, &e->audio_streams, &e->num_audio_streams); gavl_init_audio_stream(&s->s); m_stream = gavl_stream_get_metadata_nc(&s->s); gavl_dictionary_copy(m_stream, m); gavl_metadata_delete_compression_fields(m_stream); gavl_stream_set_compression_info(&s->s, ci); gavl_audio_format_copy(gavl_stream_get_audio_format_nc(&s->s), format); s->flags |= STREAM_COMPRESSED; return s; } bg_ogg_stream_t * bg_ogg_encoder_add_video_stream_compressed(void * data, const gavl_dictionary_t * m, const gavl_video_format_t * format, const gavl_compression_info_t * ci) { gavl_dictionary_t * m_stream; bg_ogg_stream_t * s; bg_ogg_encoder_t * e = data; s = append_stream(e, &e->video_streams, &e->num_video_streams); gavl_init_video_stream(&s->s); m_stream = gavl_stream_get_metadata_nc(&s->s); gavl_dictionary_copy(m_stream, m); gavl_metadata_delete_compression_fields(m_stream); gavl_stream_set_compression_info(&s->s, ci); gavl_video_format_copy(gavl_stream_get_video_format_nc(&s->s), format); s->flags |= STREAM_COMPRESSED; if(ci->flags & GAVL_COMPRESSION_HAS_P_FRAMES) s->flags |= STREAM_KEYFRAMES; return s; } void bg_ogg_encoder_init_stream(void * data, bg_ogg_stream_t * s, const bg_ogg_codec_t * codec) { s->codec = codec; s->codec_priv = s->codec->create(); } void bg_ogg_encoder_set_audio_parameter(void * data, int stream, const char * name, const gavl_value_t * val) { bg_ogg_encoder_t * e = data; bg_ogg_stream_t * s = &e->audio_streams[stream]; s->codec->set_parameter(s->codec_priv, name, val); } void bg_ogg_encoder_set_video_parameter(void * data, int stream, const char * name, const gavl_value_t * val) { bg_ogg_encoder_t * e = data; bg_ogg_stream_t * s = &e->video_streams[stream]; s->codec->set_parameter(s->codec_priv, name, val); } int bg_ogg_encoder_set_video_pass(void * data, int stream, int pass, int total_passes, const char * stats_file) { bg_ogg_encoder_t * e = data; bg_ogg_stream_t * s = &e->video_streams[stream]; s->pass = pass; s->total_passes = total_passes; s->stats_file = gavl_strrep(s->stats_file, stats_file); return 1; } static int start_audio(bg_ogg_encoder_t * e, int stream) { bg_ogg_stream_t * s = &e->audio_streams[stream]; if(s->flags & STREAM_COMPRESSED) { if(!s->codec->init_audio_compressed(s)) return 0; } else { if(!(s->asink = s->codec->init_audio(s->codec_priv, &s->s))) return 0; if(!s->codec->init_audio_compressed(s)) return 0; } s->psink_out = gavl_packet_sink_create(NULL, write_gavl_packet, s); s->codec->set_packet_sink(s->codec_priv, s->psink_out); return 1; } static int start_video(bg_ogg_encoder_t * e, int stream) { bg_ogg_stream_t * s = &e->video_streams[stream]; if(s->flags & STREAM_COMPRESSED) { if(!s->codec->init_video_compressed(s)) return 0; } else { if(!(s->vsink = s->codec->init_video(s->codec_priv, &s->s))) return 0; if(s->pass) { if(!s->codec->set_video_pass) return 0; else if(!s->codec->set_video_pass(s->codec_priv, s->pass, s->total_passes, s->stats_file)) return 0; } if(!s->codec->init_video_compressed(s)) return 0; } s->psink_out = gavl_packet_sink_create(NULL, write_gavl_packet, s); s->codec->set_packet_sink(s->codec_priv, s->psink_out); return 1; } int bg_ogg_encoder_start(void * data) { int i; bg_ogg_encoder_t * e = data; /* Start encoders and write identification headers */ for(i = 0; i < e->num_video_streams; i++) { if(!start_video(e, i)) return 0; } for(i = 0; i < e->num_audio_streams; i++) { if(!start_audio(e, i)) return 0; } /* Write remaining header pages */ for(i = 0; i < e->num_video_streams; i++) { bg_ogg_stream_t * s = &e->video_streams[i]; if(bg_ogg_stream_flush(s, 1) < 0) return 0; } for(i = 0; i < e->num_audio_streams; i++) { bg_ogg_stream_t * s = &e->audio_streams[i]; if(bg_ogg_stream_flush(s, 1) < 0) return 0; } e->started = 1; return 1; } gavl_audio_sink_t * bg_ogg_encoder_get_audio_sink(void * data, int stream) { bg_ogg_encoder_t * e = data; return e->audio_streams[stream].asink; } gavl_video_sink_t * bg_ogg_encoder_get_video_sink(void * data, int stream) { bg_ogg_encoder_t * e = data; return e->video_streams[stream].vsink; } gavl_packet_sink_t * bg_ogg_encoder_get_audio_packet_sink(void * data, int stream) { bg_ogg_encoder_t * e = data; return e->audio_streams[stream].psink_out; } gavl_packet_sink_t * bg_ogg_encoder_get_video_packet_sink(void * data, int stream) { bg_ogg_encoder_t * e = data; return e->video_streams[stream].psink_out; } void bg_ogg_encoder_update_metadata(void * data, const gavl_dictionary_t * new_metadata) { int i; bg_ogg_encoder_t * e = data; /* Copy all tags, overriding what's already there */ gavl_dictionary_copy(&e->metadata, new_metadata); if(!e->started) return; /* Flush all data */ for(i = 0; i < e->num_audio_streams; i++) { bg_ogg_stream_t * s = &e->audio_streams[i]; bg_ogg_stream_reset(s, e->serialno++); } for(i = 0; i < e->num_video_streams; i++) { bg_ogg_stream_t * s = &e->video_streams[i]; bg_ogg_stream_reset(s, e->serialno++); } /* Reinitialize with new metadata */ for(i = 0; i < e->num_audio_streams; i++) { bg_ogg_stream_t * s = &e->audio_streams[i]; s->codec->init_audio_compressed(s); } for(i = 0; i < e->num_video_streams; i++) { bg_ogg_stream_t * s = &e->video_streams[i]; s->codec->init_video_compressed(s); } /* Re-write header packets */ for(i = 0; i < e->num_audio_streams; i++) { bg_ogg_stream_t * s = &e->audio_streams[i]; bg_ogg_stream_flush(s, 1); } for(i = 0; i < e->num_video_streams; i++) { bg_ogg_stream_t * s = &e->video_streams[i]; bg_ogg_stream_flush(s, 1); } } int bg_ogg_encoder_close(void * data, int do_delete) { int ret = 1; int i; bg_ogg_encoder_t * e = data; if(!e->io) return 1; for(i = 0; i < e->num_audio_streams; i++) { bg_ogg_stream_t * s = &e->audio_streams[i]; if(!s->codec->close(e->audio_streams[i].codec_priv)) { ret = 0; break; } flush_stream(s); ogg_stream_clear(&s->os); if(s->asink) { gavl_audio_sink_destroy(s->asink); s->asink = NULL; } if(s->psink_out) { gavl_packet_sink_destroy(s->psink_out); s->psink_out = NULL; } } for(i = 0; i < e->num_video_streams; i++) { bg_ogg_stream_t * s = &e->video_streams[i]; if(!s->codec->close(s->codec_priv)) { ret = 0; break; } flush_stream(s); ogg_stream_clear(&s->os); if(s->vsink) { gavl_video_sink_destroy(s->vsink); s->vsink = NULL; } if(s->psink_out) { gavl_packet_sink_destroy(s->psink_out); s->psink_out = NULL; } } if(e->io_priv) gavl_io_destroy(e->io_priv); e->io_priv = NULL; e->io = NULL; if(do_delete && e->filename) remove(e->filename); return ret; } static const bg_parameter_info_t codec_parameters[] = { { .name = "codec", .long_name = TRS("Codec"), .type = BG_PARAMETER_MULTI_MENU, }, { /* End of parameters */ } }; static bg_parameter_info_t * create_codec_parameters(bg_ogg_codec_t const * const * codecs) { int num_codecs; int i; bg_parameter_info_t * ret = 0; num_codecs = 0; while(codecs[num_codecs]) num_codecs++; ret = bg_parameter_info_copy_array(codec_parameters); ret[0].multi_names_nc = calloc(num_codecs+1, sizeof(*ret[0].multi_names)); ret[0].multi_labels_nc = calloc(num_codecs+1, sizeof(*ret[0].multi_labels)); ret[0].multi_parameters_nc = calloc(num_codecs+1, sizeof(*ret[0].multi_parameters)); for(i = 0; i < num_codecs; i++) { ret[0].multi_names_nc[i] = gavl_strdup(codecs[i]->name); ret[0].multi_labels_nc[i] = gavl_strdup(codecs[i]->long_name); if(codecs[i]->get_parameters) ret[0].multi_parameters_nc[i] = bg_parameter_info_copy_array(codecs[i]->get_parameters()); } bg_parameter_info_set_const_ptrs(&ret[0]); return ret; } bg_parameter_info_t * bg_ogg_encoder_get_audio_parameters(bg_ogg_encoder_t * e, bg_ogg_codec_t const * const * audio_codecs) { if(!e->audio_parameters) e->audio_parameters = create_codec_parameters(audio_codecs); return e->audio_parameters; } bg_parameter_info_t * bg_ogg_encoder_get_video_parameters(bg_ogg_encoder_t * e, bg_ogg_codec_t const * const * video_codecs) { if(!e->video_parameters) e->video_parameters = create_codec_parameters(video_codecs); return e->video_parameters; } /* Comment building stuff */ void bg_ogg_create_comment_packet(const uint8_t * prefix, int prefix_len, const gavl_dictionary_t * m_stream, const gavl_dictionary_t * m_global, int framing, ogg_packet * op) { int len; gavl_io_t * io; uint8_t * ptr; io = gavl_io_create_mem_write(); bg_vorbis_comment_write(io, m_stream, m_global, framing); ptr = gavl_io_mem_get_buf(io, &len); /* Write mandatory fields */ op->packet = malloc(len + prefix_len); op->bytes = len + prefix_len; if(prefix_len) memcpy(op->packet, prefix, prefix_len); memcpy(op->packet + prefix_len, ptr, len); // fprintf(stderr, "Built comment packet:\n"); // gavl_hexdump(op->packet, op->bytes, 16); free(ptr); gavl_io_destroy(io); } void bg_ogg_free_comment_packet(ogg_packet * op) { free(op->packet); } void bg_ogg_set_vorbis_channel_setup(gavl_audio_format_t * format) { if(format->channel_locations[0] == GAVL_CHID_AUX) return; switch(format->num_channels) { case 1: format->channel_locations[0] = GAVL_CHID_FRONT_CENTER; break; case 2: format->channel_locations[0] = GAVL_CHID_FRONT_LEFT; format->channel_locations[1] = GAVL_CHID_FRONT_RIGHT; break; case 3: format->channel_locations[0] = GAVL_CHID_FRONT_LEFT; format->channel_locations[1] = GAVL_CHID_FRONT_CENTER; format->channel_locations[2] = GAVL_CHID_FRONT_RIGHT; break; case 4: format->channel_locations[0] = GAVL_CHID_FRONT_LEFT; format->channel_locations[1] = GAVL_CHID_FRONT_RIGHT; format->channel_locations[2] = GAVL_CHID_REAR_LEFT; format->channel_locations[3] = GAVL_CHID_REAR_RIGHT; break; case 5: format->channel_locations[0] = GAVL_CHID_FRONT_LEFT; format->channel_locations[1] = GAVL_CHID_FRONT_CENTER; format->channel_locations[2] = GAVL_CHID_FRONT_RIGHT; format->channel_locations[3] = GAVL_CHID_REAR_LEFT; format->channel_locations[4] = GAVL_CHID_REAR_RIGHT; break; case 6: format->channel_locations[0] = GAVL_CHID_FRONT_LEFT; format->channel_locations[1] = GAVL_CHID_FRONT_CENTER; format->channel_locations[2] = GAVL_CHID_FRONT_RIGHT; format->channel_locations[3] = GAVL_CHID_REAR_LEFT; format->channel_locations[4] = GAVL_CHID_REAR_RIGHT; format->channel_locations[5] = GAVL_CHID_LFE; break; case 7: format->channel_locations[0] = GAVL_CHID_FRONT_LEFT; format->channel_locations[1] = GAVL_CHID_FRONT_CENTER; format->channel_locations[2] = GAVL_CHID_FRONT_RIGHT; format->channel_locations[3] = GAVL_CHID_SIDE_LEFT; format->channel_locations[4] = GAVL_CHID_SIDE_RIGHT; format->channel_locations[5] = GAVL_CHID_REAR_CENTER; format->channel_locations[6] = GAVL_CHID_LFE; break; case 8: format->channel_locations[0] = GAVL_CHID_FRONT_LEFT; format->channel_locations[1] = GAVL_CHID_FRONT_CENTER; format->channel_locations[2] = GAVL_CHID_FRONT_RIGHT; format->channel_locations[3] = GAVL_CHID_SIDE_LEFT; format->channel_locations[4] = GAVL_CHID_SIDE_RIGHT; format->channel_locations[5] = GAVL_CHID_REAR_LEFT; format->channel_locations[6] = GAVL_CHID_REAR_RIGHT; format->channel_locations[7] = GAVL_CHID_LFE; break; } } void bg_ogg_stream_reset(bg_ogg_stream_t * s, long serialno) { flush_stream(s); s->packetno = 0; s->num_headers = 0; ogg_stream_clear(&s->os); ogg_stream_init(&s->os, serialno); } bplaum-gmerlin-encoders-172394d/plugins/ogg/ogg_common.h000066400000000000000000000166131513225514200232450ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include /* Generic struct for a codec. Here, we'll implement encoders for vorbis, theora and flac */ typedef struct bg_ogg_encoder_s bg_ogg_encoder_t; typedef struct bg_ogg_stream_s bg_ogg_stream_t; #define STREAM_COMPRESSED (1<<1) #define STREAM_KEYFRAMES (1<<2) typedef struct { char * name; char * long_name; void * (*create)(void); const bg_parameter_info_t * (*get_parameters)(void); void (*set_parameter)(void*, const char * name, const gavl_value_t * v); gavl_audio_sink_t * (*init_audio)(void*, gavl_dictionary_t * s); gavl_video_sink_t * (*init_video)(void*, gavl_dictionary_t * s); int (*init_audio_compressed)(bg_ogg_stream_t * s); int (*init_video_compressed)(bg_ogg_stream_t * s); int (*set_video_pass)(void*, int pass, int total_passes, const char * stats_file); int (*flush_header_pages)(void*); void (*convert_packet)(bg_ogg_stream_t * s, gavl_packet_t * src, ogg_packet * dst); void (*set_packet_sink)(void*, gavl_packet_sink_t * psink); int (*close)(void*); } bg_ogg_codec_t; struct bg_ogg_stream_s { bg_ogg_encoder_t * enc; const bg_ogg_codec_t * codec; void * codec_priv; /* gavl_audio_format_t afmt; gavl_video_format_t vfmt; gavl_compression_info_t ci; gavl_dictionary_t m_stream; */ gavl_dictionary_t s; gavl_audio_sink_t * asink; gavl_video_sink_t * vsink; gavl_packet_sink_t * psink_out; ogg_stream_state os; int flags; /* 2-pass stuff */ int pass; int total_passes; char * stats_file; /* Counter for header packets */ int num_headers; /* Counter for packets */ int64_t packetno; int index; /* Last packet */ gavl_packet_t last_packet; /* Metadata */ const gavl_dictionary_t * m_global; }; int bg_ogg_stream_write_header_packet(bg_ogg_stream_t * s, ogg_packet * p); int bg_ogg_stream_write_gavl_packet(bg_ogg_stream_t * s, gavl_packet_t * p); int bg_ogg_stream_flush(bg_ogg_stream_t * s, int force); void bg_ogg_packet_to_gavl(ogg_packet * src, gavl_packet_t * dst, int64_t * pts); void bg_ogg_packet_from_gavl(bg_ogg_stream_t * s, gavl_packet_t * src, ogg_packet * dst); /* Chaining support */ void bg_ogg_stream_reset(bg_ogg_stream_t * s, long serialno); void bg_ogg_encoder_update_metadata(void * priv, const gavl_dictionary_t * new_metadata); struct bg_ogg_encoder_s { int started; int num_audio_streams; int num_video_streams; bg_ogg_stream_t * audio_streams; bg_ogg_stream_t * video_streams; long serialno; gavl_dictionary_t metadata; char * filename; bg_parameter_info_t * audio_parameters; bg_parameter_info_t * video_parameters; bg_encoder_callbacks_t * cb; gavl_io_t * io_priv; gavl_io_t * io; // int (*write_callback)(void * priv, const uint8_t * data, int len); // void (*close_callback)(void * priv); int (*open_callback)(void * priv); void * open_callback_data; }; void * bg_ogg_encoder_create(void); void bg_ogg_encoder_set_callbacks(void *, bg_encoder_callbacks_t * cb); int bg_ogg_encoder_open(void *, const char * file, gavl_io_t * io, const gavl_dictionary_t * metadata, const char * ext); void bg_ogg_encoder_destroy(void*); //int bg_ogg_flush_page(ogg_stream_state * os, bg_ogg_encoder_t * output, int force); int bg_ogg_flush(ogg_stream_state * os, bg_ogg_encoder_t * output, int force); bg_ogg_stream_t * bg_ogg_encoder_add_audio_stream(void*, const gavl_dictionary_t * m, const gavl_audio_format_t * format); bg_ogg_stream_t * bg_ogg_encoder_add_video_stream(void*, const gavl_dictionary_t * m, const gavl_video_format_t * format); bg_ogg_stream_t * bg_ogg_encoder_add_audio_stream_compressed(void*, const gavl_dictionary_t * m, const gavl_audio_format_t * format, const gavl_compression_info_t * ci); bg_ogg_stream_t * bg_ogg_encoder_add_video_stream_compressed(void*, const gavl_dictionary_t * m, const gavl_video_format_t * format, const gavl_compression_info_t * ci); void bg_ogg_encoder_init_stream(void*, bg_ogg_stream_t * s, const bg_ogg_codec_t * codec); void bg_ogg_encoder_set_audio_parameter(void*, int stream, const char * name, const gavl_value_t * val); void bg_ogg_encoder_set_video_parameter(void*, int stream, const char * name, const gavl_value_t * val); int bg_ogg_encoder_set_video_pass(void*, int stream, int pass, int total_passes, const char * stats_file); int bg_ogg_encoder_start(void*); void bg_ogg_encoder_get_audio_format(void * data, int stream, gavl_audio_format_t*ret); void bg_ogg_encoder_get_video_format(void * data, int stream, gavl_video_format_t*ret); gavl_audio_sink_t * bg_ogg_encoder_get_audio_sink(void * data, int stream); gavl_packet_sink_t * bg_ogg_encoder_get_audio_packet_sink(void * data, int stream); gavl_video_sink_t * bg_ogg_encoder_get_video_sink(void * data, int stream); gavl_packet_sink_t * bg_ogg_encoder_get_video_packet_sink(void * data, int stream); int bg_ogg_encoder_close(void * data, int do_delete); bg_parameter_info_t * bg_ogg_encoder_get_audio_parameters(bg_ogg_encoder_t * e, bg_ogg_codec_t const * const * audio_codecs); bg_parameter_info_t * bg_ogg_encoder_get_video_parameters(bg_ogg_encoder_t * e, bg_ogg_codec_t const * const * video_codecs); void bg_ogg_create_comment_packet(const uint8_t * prefix, int prefix_len, const gavl_dictionary_t * m_stream, const gavl_dictionary_t * m_global, int framing, ogg_packet * op); void bg_ogg_free_comment_packet(ogg_packet * op); void bg_ogg_set_vorbis_channel_setup(gavl_audio_format_t * format); bplaum-gmerlin-encoders-172394d/plugins/ogg/opus.c000066400000000000000000000603551513225514200221040ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #define LOG_DOMAIN "oggopus" #include #include "ogg_common.h" #include #include #define BITRATE_VBR 0 #define BITRATE_CVBR 1 #define BITRATE_CBR 2 typedef struct { uint8_t version; uint8_t channel_count; uint16_t pre_skip; uint32_t samplerate; int16_t output_gain; uint8_t channel_mapping; struct { uint8_t stream_count; uint8_t coupled_count; uint8_t map[256]; // 255 actually } chtab; // Channel mapping table } opus_header_t; #define MAX_HEADER_LEN (8+1+1+2+4+2+1+1+1+256) static void setup_header(opus_header_t * h, gavl_audio_format_t * format); static void header_to_packet(opus_header_t * h, gavl_buffer_t * ret); typedef struct { /* Config */ int application; int bitrate_mode; int complexity; int fec; int dtx; int loss_perc; int bandwidth; int max_bandwidth; int bitrate; int frame_size; // in 100 us /* Encoder */ OpusMSEncoder * enc; opus_header_t h; opus_int32 lookahead; gavl_audio_frame_t * frame; gavl_audio_format_t * format; int64_t samples_read; uint8_t * enc_buffer; int enc_buffer_size; int64_t pts; int to_skip; gavl_packet_sink_t * psink; } opus_t; static void * create_opus() { opus_t * ret; ret = calloc(1, sizeof(*ret)); return ret; } static const bg_parameter_info_t parameters[] = { { .name = "application", .long_name = TRS("Application"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("audio"), .multi_names = (char const *[]){ "audio", "voip", NULL }, .multi_labels = (char const *[]){ TRS("Audio"), TRS("VOIP"), NULL }, }, { .name = "bitrate_mode", .long_name = TRS("Bitrate mode"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("vbr"), .multi_names = (char const *[]){ "vbr", "cvbr", "cbr", NULL }, .multi_labels = (char const *[]){ TRS("VBR"), TRS("Constrained VBR"), TRS("CBR"), NULL }, .help_string = TRS("Bitrate mode") }, { .name = "bitrate", .long_name = TRS("Bitrate"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(512000), .val_default = GAVL_VALUE_INIT_INT(0), .help_string = TRS("Bitrate (in bps). 0 means auto."), }, { .name = "complexity", .long_name = TRS("Encoding complexity"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(1), .val_max = GAVL_VALUE_INIT_INT(10), .val_default = GAVL_VALUE_INIT_INT(10), }, { .name = "frame_size", .long_name = TRS("Frame size (ms)"), .type = BG_PARAMETER_STRINGLIST, /* Multiplied by 10 */ .val_default = GAVL_VALUE_INIT_STRING("200"), .multi_names = (char const *[]){ "25", "50", "100", "200", "400", "600", NULL }, .multi_labels = (char const *[]){ "2.5", "5", "10", "20", "40", "60", NULL }, .help_string = TRS("Smaller framesizes achieve lower latency but less quality at a given bitrate. Sizes greater than 20ms are only interesting at fairly low bitrates. ") }, { .name = "dtx", .long_name = TRS("Enable discontinuous transmission"), .type = BG_PARAMETER_CHECKBUTTON, }, { .name = "inband_fec", .long_name = TRS("Enable inband forward error correction"), .type = BG_PARAMETER_CHECKBUTTON, }, { .name = "bandwidth", .long_name = TRS("Bandwidth"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("auto"), .multi_names = (char const *[]){ "auto", "narrow", "medium", "wide", "superwide", "full", NULL }, .multi_labels = (char const *[]){ TRS("Automatic"), TRS("Narrow (4 kHz)"), TRS("Medium (6 kHz)"), TRS("Wide (8 kHz)"), TRS("Superwide (12 kHz)"), TRS("Full (20 kHz)"), NULL }, }, #if 1 // Request not implemented { .name = "max_bandwidth", .long_name = TRS("Maximum bandwidth"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("full"), .multi_names = (char const *[]){ "narrow", "medium", "wide", "superwide", "full", NULL }, .multi_labels = (char const *[]){ TRS("Narrow (4 kHz)"), TRS("Medium (6 kHz)"), TRS("Wide (8 kHz)"), TRS("Superwide (12 kHz)"), TRS("Full (20 kHz)"), NULL }, }, #endif { .name = "loss_perc", .long_name = TRS("Loss percentage"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(100), .val_default = GAVL_VALUE_INIT_INT(0), }, { /* End */ }, }; static const bg_parameter_info_t * get_parameters_opus() { return parameters; } static void set_packet_sink(void * data, gavl_packet_sink_t * psink) { opus_t * opus = data; opus->psink = psink; } static void set_parameter_opus(void * data, const char * name, const gavl_value_t * v) { opus_t * opus = data; if(!name) return; if(!strcmp(name, "application")) { if(!strcmp(v->v.str, "audio")) opus->application = OPUS_APPLICATION_AUDIO; else if(!strcmp(v->v.str, "voip")) opus->application = OPUS_APPLICATION_VOIP; } else if(!strcmp(name, "bitrate_mode")) { if(!strcmp(v->v.str, "vbr")) opus->bitrate_mode = BITRATE_VBR; else if(!strcmp(v->v.str, "cvbr")) opus->bitrate_mode = BITRATE_CVBR; else if(!strcmp(v->v.str, "cbr")) opus->bitrate_mode = BITRATE_CBR; } else if(!strcmp(name, "bitrate")) { opus->bitrate = v->v.i; } else if(!strcmp(name, "complexity")) { opus->complexity = v->v.i; } else if(!strcmp(name, "dtx")) { opus->dtx = v->v.i; } else if(!strcmp(name, "inband_fec")) { opus->fec = v->v.i; } else if(!strcmp(name, "bandwidth")) { if(!strcmp(v->v.str, "narrow")) opus->bandwidth = OPUS_BANDWIDTH_NARROWBAND; else if(!strcmp(v->v.str, "medium")) opus->bandwidth = OPUS_BANDWIDTH_MEDIUMBAND; else if(!strcmp(v->v.str, "wide")) opus->bandwidth = OPUS_BANDWIDTH_WIDEBAND; else if(!strcmp(v->v.str, "superwide")) opus->bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND; else if(!strcmp(v->v.str, "full")) opus->bandwidth = OPUS_BANDWIDTH_FULLBAND; else if(!strcmp(v->v.str, "auto")) opus->bandwidth = OPUS_AUTO; } else if(!strcmp(name, "max_bandwidth")) { if(!strcmp(v->v.str, "narrow")) opus->max_bandwidth = OPUS_BANDWIDTH_NARROWBAND; else if(!strcmp(v->v.str, "medium")) opus->max_bandwidth = OPUS_BANDWIDTH_MEDIUMBAND; else if(!strcmp(v->v.str, "wide")) opus->max_bandwidth = OPUS_BANDWIDTH_WIDEBAND; else if(!strcmp(v->v.str, "superwide")) opus->max_bandwidth = OPUS_BANDWIDTH_SUPERWIDEBAND; else if(!strcmp(v->v.str, "full")) opus->max_bandwidth = OPUS_BANDWIDTH_FULLBAND; else if(!strcmp(v->v.str, "auto")) opus->max_bandwidth = OPUS_AUTO; } else if(!strcmp(name, "loss_perc")) { opus->loss_perc = v->v.i; } else if(!strcmp(name, "frame_size")) { opus->frame_size = atoi(v->v.str); } } static int flush_frame(opus_t * opus, int eof) { gavl_packet_t gp; int result; // fprintf(stderr, "Flush frame %d %d\n", opus->frame->valid_samples, // opus->format->samples_per_frame); if(opus->frame && opus->frame->valid_samples) { if(opus->frame->valid_samples < opus->format->samples_per_frame) { int block_align = opus->format->num_channels * gavl_bytes_per_sample(opus->format->sample_format); memset(opus->frame->samples.s_8 + block_align * opus->frame->valid_samples, 0, (opus->format->samples_per_frame - opus->frame->valid_samples) * block_align); } if(opus->format->sample_format == GAVL_SAMPLE_FLOAT) { result = opus_multistream_encode_float(opus->enc, opus->frame->samples.f, opus->format->samples_per_frame, opus->enc_buffer, opus->enc_buffer_size); } else { result = opus_multistream_encode(opus->enc, opus->frame->samples.s_16, opus->format->samples_per_frame, opus->enc_buffer, opus->enc_buffer_size); } if(result < 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Encoding failed: %s", opus_strerror(result)); return 0; } /* Create packet */ gavl_packet_init(&gp); gp.buf.buf = opus->enc_buffer; gp.buf.len = result; if(eof) gp.flags |= GAVL_PACKET_LAST; gp.duration = (opus->frame->valid_samples * 48000) / opus->format->samplerate; gp.pts = opus->pts; opus->pts += gp.duration; gavl_packet_sink_put_packet(opus->psink, &gp); opus->frame->valid_samples = 0; } return 1; } static gavl_sink_status_t write_audio_frame_opus(void * data, gavl_audio_frame_t * frame) { int result = 1; int samples_read = 0; int samples_copied; opus_t * opus = data; /* Handle lookahead */ while(opus->lookahead) { gavl_audio_frame_mute(opus->frame, opus->format); opus->frame->valid_samples = opus->lookahead; if(opus->frame->valid_samples > opus->format->samples_per_frame) opus->frame->valid_samples = opus->format->samples_per_frame; samples_copied = opus->frame->valid_samples; if(opus->frame->valid_samples == opus->format->samples_per_frame) { result = flush_frame(opus, 0); if(!result) break; } opus->lookahead -= samples_copied; } // fprintf(stderr, "write_audio %d\n", frame->valid_samples); while(samples_read < frame->valid_samples) { samples_copied = gavl_audio_frame_copy(opus->format, opus->frame, frame, opus->frame->valid_samples, /* dst_pos */ samples_read, /* src_pos */ opus->format->samples_per_frame - opus->frame->valid_samples, /* dst_size */ frame->valid_samples - samples_read /* src_size */ ); opus->frame->valid_samples += samples_copied; samples_read += samples_copied; if(opus->frame->valid_samples == opus->format->samples_per_frame) { result = flush_frame(opus, 0); if(!result) break; } } opus->samples_read += frame->valid_samples; return result ? GAVL_SINK_OK : GAVL_SINK_ERROR; } static gavl_audio_sink_t * init_opus(void * data, gavl_dictionary_t * s) { int err; opus_t * opus = data; gavl_compression_info_t ci; gavl_audio_format_t * format = gavl_stream_get_audio_format_nc(s); gavl_compression_info_init(&ci); setup_header(&opus->h, format); format->samples_per_frame = (format->samplerate * opus->frame_size) / 10000; /* Create encoder */ opus->enc = opus_multistream_encoder_create(format->samplerate, opus->h.channel_count, opus->h.chtab.stream_count, opus->h.chtab.coupled_count, opus->h.chtab.map, opus->application, &err); /* Apply config */ switch(opus->bitrate_mode) { case BITRATE_VBR: opus_multistream_encoder_ctl(opus->enc, OPUS_SET_VBR(1)); opus_multistream_encoder_ctl(opus->enc, OPUS_SET_VBR_CONSTRAINT(0)); break; case BITRATE_CVBR: opus_multistream_encoder_ctl(opus->enc, OPUS_SET_VBR(1)); opus_multistream_encoder_ctl(opus->enc, OPUS_SET_VBR_CONSTRAINT(1)); break; case BITRATE_CBR: opus_multistream_encoder_ctl(opus->enc, OPUS_SET_VBR(0)); opus_multistream_encoder_ctl(opus->enc, OPUS_SET_VBR_CONSTRAINT(0)); break; } if(opus->bitrate <= 0) { if((err = opus_multistream_encoder_ctl(opus->enc, OPUS_SET_BITRATE(OPUS_AUTO))) != OPUS_OK) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Setting bitrate to %d failed: %s", opus->bitrate, opus_strerror(err)); } } else { if((err = opus_multistream_encoder_ctl(opus->enc, OPUS_SET_BITRATE(opus->bitrate))) != OPUS_OK) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Setting bitrate to %d failed: %s", opus->bitrate, opus_strerror(err)); } } if((err = opus_multistream_encoder_ctl(opus->enc, OPUS_SET_COMPLEXITY(opus->complexity))) != OPUS_OK) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Setting complexity failed: %s", opus_strerror(err)); } if((err = opus_multistream_encoder_ctl(opus->enc, OPUS_SET_DTX(opus->dtx))) != OPUS_OK) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Setting dtx failed: %s", opus_strerror(err)); } if((err = opus_multistream_encoder_ctl(opus->enc, OPUS_SET_INBAND_FEC(opus->fec))) != OPUS_OK) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Setting fec failed: %s", opus_strerror(err)); } if((err = opus_multistream_encoder_ctl(opus->enc, OPUS_SET_PACKET_LOSS_PERC(opus->loss_perc))) != OPUS_OK) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Setting loss percentage failed: %s", opus_strerror(err)); } if((err = opus_multistream_encoder_ctl(opus->enc, OPUS_SET_BANDWIDTH(opus->bandwidth))) != OPUS_OK) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Setting bandwidth to %d failed: %s", opus->bandwidth, opus_strerror(err)); } if((err = opus_multistream_encoder_ctl(opus->enc, OPUS_SET_MAX_BANDWIDTH(opus->max_bandwidth))) != OPUS_OK) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Setting max bandwidth to %d failed: %s", opus->max_bandwidth, opus_strerror(err)); } /* Get preskip */ err = opus_multistream_encoder_ctl(opus->enc, OPUS_GET_LOOKAHEAD(&opus->lookahead)); if(err != OPUS_OK) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "OPUS_GET_LOOKAHEAD failed: %s", opus_strerror(err)); gavl_compression_info_free(&ci); return 0; } opus->h.pre_skip = (opus->lookahead * 48000) / format->samplerate; /* Save format and create frame */ opus->format = format; opus->frame = gavl_audio_frame_create(opus->format); /* Output header */ header_to_packet(&opus->h, &ci.codec_header); // fprintf(stderr, "Encoded header packet:\n"); // gavl_hexdump(ci.codec_header.buf, ci.codec_header.len, 16); ci.id = GAVL_CODEC_ID_OPUS; ci.pre_skip = opus->h.pre_skip; opus->pts = -((int64_t)ci.pre_skip); gavl_dictionary_set_string(gavl_stream_get_metadata_nc(s), GAVL_META_SOFTWARE, opus_get_version_string()); /* Allocate encoder buffer */ // Size taken from opusenc.c opus->enc_buffer_size = opus->h.chtab.stream_count * (1275*3+7); opus->enc_buffer = malloc(opus->enc_buffer_size); gavl_stream_set_compression_info(s, &ci); gavl_compression_info_free(&ci); return gavl_audio_sink_create(NULL, write_audio_frame_opus, opus, opus->format); } static int init_compressed_opus(bg_ogg_stream_t * s) { ogg_packet op; const char * vendor; int ret = 0; // opus_t * opus = data; gavl_compression_info_t ci; gavl_dictionary_t * m_stream = gavl_stream_get_metadata_nc(&s->s); gavl_compression_info_init(&ci); gavl_stream_get_compression_info(&s->s, &ci); memset(&op, 0, sizeof(op)); op.packet = ci.codec_header.buf; op.bytes = ci.codec_header.len; /* And stream them out */ if(!bg_ogg_stream_write_header_packet(s, &op)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Got no Opus header page"); goto fail; } /* Build comment */ vendor = gavl_dictionary_get_string(m_stream, GAVL_META_SOFTWARE); if(!vendor) { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Got no vendor string, using probably wrong value from codec library"); vendor = opus_get_version_string(); } bg_ogg_create_comment_packet((uint8_t*)"OpusTags", 8, m_stream, s->m_global, 0, &op); op.b_o_s = 0; op.e_o_s = 0; op.granulepos = 0; if(!bg_ogg_stream_write_header_packet(s, &op)) goto fail; bg_ogg_free_comment_packet(&op); ret = 1; fail: gavl_compression_info_free(&ci); return ret; } static int close_opus(void * data) { int result = 1; opus_t * opus = data; /* Flush */ result = flush_frame(opus, 1); if(opus->frame) gavl_audio_frame_destroy(opus->frame); if(opus->enc_buffer) free(opus->enc_buffer); opus_multistream_encoder_destroy(opus->enc); free(opus); return result; } const bg_ogg_codec_t bg_opus_codec = { .name = "opus", .long_name = TRS("Opus encoder"), .create = create_opus, .get_parameters = get_parameters_opus, .set_parameter = set_parameter_opus, .init_audio = init_opus, .init_audio_compressed = init_compressed_opus, .set_packet_sink = set_packet_sink, // .write_packet = write_audio_packet_opus, .close = close_opus, }; /* Header stuff */ static const int samplerates[] = { 8000, 12000, 16000, 24000, 48000, 0 }; static void setup_header(opus_header_t * h, gavl_audio_format_t * format) { int rate; format->interleave_mode = GAVL_INTERLEAVE_ALL; if(gavl_bytes_per_sample(format->sample_format) >= 4) format->sample_format = GAVL_SAMPLE_FLOAT; else format->sample_format = GAVL_SAMPLE_S16; rate = gavl_nearest_samplerate(format->samplerate, samplerates); if(rate != format->samplerate) { gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Resampling from %d to %d", format->samplerate, rate); format->samplerate = rate; } h->version = 1; h->channel_count = format->num_channels; h->pre_skip = 0; h->samplerate = format->samplerate; h->output_gain = 0; if(format->channel_locations[0] == GAVL_CHID_AUX) { int i; h->channel_mapping = 255; h->chtab.stream_count = format->num_channels; h->chtab.coupled_count = 0; for(i = 0; i < format->num_channels; i++) h->chtab.map[i] = i; return; } bg_ogg_set_vorbis_channel_setup(format); switch(format->num_channels) { case 1: h->channel_mapping = 0; h->chtab.stream_count = 1; h->chtab.coupled_count = 0; h->chtab.map[0] = 0; break; case 2: h->channel_mapping = 0; h->chtab.stream_count = 1; h->chtab.coupled_count = 1; h->chtab.map[0] = 0; h->chtab.map[1] = 1; break; case 3: // Left, Center, Right h->channel_mapping = 1; h->chtab.stream_count = 2; h->chtab.coupled_count = 1; h->chtab.map[0] = 0; h->chtab.map[1] = 2; h->chtab.map[2] = 1; break; case 4: // Left, Right, Rear left, Rear right h->channel_mapping = 1; h->chtab.stream_count = 2; h->chtab.coupled_count = 2; h->chtab.map[0] = 0; h->chtab.map[1] = 1; h->chtab.map[2] = 2; h->chtab.map[3] = 3; break; case 5: // Left, Center, Right, Rear left, Rear right h->channel_mapping = 1; h->chtab.stream_count = 3; h->chtab.coupled_count = 2; h->chtab.map[0] = 0; h->chtab.map[1] = 4; h->chtab.map[2] = 1; h->chtab.map[3] = 2; h->chtab.map[4] = 3; break; case 6: // Left, Center, Right, Rear left, Rear right, LFE h->channel_mapping = 1; h->chtab.stream_count = 4; h->chtab.coupled_count = 2; h->chtab.map[0] = 0; h->chtab.map[1] = 4; h->chtab.map[2] = 1; h->chtab.map[3] = 2; h->chtab.map[4] = 3; h->chtab.map[5] = 5; break; case 7: // Left, Center, Right, Side left, Side right, Rear Center, LFE h->channel_mapping = 1; h->chtab.stream_count = 5; h->chtab.coupled_count = 2; h->chtab.map[0] = 0; h->chtab.map[1] = 4; h->chtab.map[2] = 1; h->chtab.map[3] = 2; h->chtab.map[4] = 3; h->chtab.map[5] = 5; h->chtab.map[6] = 6; break; case 8: // Left, Center, Right, Side left, Side right, Rear left, Rear right, LFE h->channel_mapping = 1; h->chtab.stream_count = 5; h->chtab.coupled_count = 2; h->chtab.map[0] = 0; h->chtab.map[1] = 6; h->chtab.map[2] = 1; h->chtab.map[3] = 2; h->chtab.map[4] = 3; h->chtab.map[5] = 4; h->chtab.map[6] = 5; h->chtab.map[7] = 7; break; } } #define write32(buf, base, val) \ buf[base+3]=((val)>>24)&0xff; \ buf[base+2]=((val)>>16)&0xff; \ buf[base+1]=((val)>>8)&0xff; \ buf[base]=(val)&0xff; #define write16(buf, base, val) \ buf[base+1]=((val)>>8)&0xff; \ buf[base]=(val)&0xff; static void header_to_packet(opus_header_t * h, gavl_buffer_t * buf) { int len = 0; uint8_t * ret; gavl_buffer_alloc(buf, MAX_HEADER_LEN); ret = buf->buf; memcpy(ret, "OpusHead", 8); len+=8; ret[len] = h->version; len++; ret[len] = h->channel_count; len++; write16(ret, len, h->pre_skip); len+=2; write32(ret, len, h->samplerate); len+=4; write16(ret, len, h->output_gain); len+=2; ret[len] = h->channel_mapping; len++; if(h->channel_mapping != 0) { ret[len] = h->chtab.stream_count; len++; ret[len] = h->chtab.coupled_count; len++; memcpy(ret + len, h->chtab.map, h->channel_count); len += h->channel_count; } buf->len = len; } bplaum-gmerlin-encoders-172394d/plugins/ogg/theora.c000066400000000000000000000507161513225514200224000ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include #include #define LOG_DOMAIN "oggtheora" #include #include "ogg_common.h" /* * 2-pass encoding was introduced in 1.1.0 * However use the THEORA_1_1 macro for other things * introduced in that version */ #ifdef TH_ENCCTL_2PASS_IN #define THEORA_1_1 #endif typedef struct { /* Ogg theora stuff */ th_info ti; th_comment tc; th_enc_ctx * ts; int cbr; int max_keyframe_interval; th_ycbcr_buffer buf; float speed; int64_t frame_counter; #ifdef THEORA_1_1 int pass; FILE * stats_file; // char * stats_buf; // int stats_size; gavl_buffer_t stats; char * stats_ptr; int rate_flags; #endif bg_encoder_framerate_t fr; int frames_since_keyframe; int64_t last_keyframe; gavl_packet_sink_t * psink; int64_t pts; gavl_video_format_t * format; } theora_t; static void set_packet_sink(void * data, gavl_packet_sink_t * psink) { theora_t * theora = data; theora->psink = psink; } static void * create_theora() { theora_t * ret; ret = calloc(1, sizeof(*ret)); th_info_init(&ret->ti); return ret; } static const bg_parameter_info_t parameters[] = { { .name = "cbr", .long_name = TRS("Use constant bitrate"), .type = BG_PARAMETER_CHECKBUTTON, .help_string = TRS("For constant bitrate, choose a target bitrate. For variable bitrate, choose a nominal quality."), }, { .name = "target_bitrate", .long_name = TRS("Target bitrate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(45), .val_max = GAVL_VALUE_INIT_INT(2000), .val_default = GAVL_VALUE_INIT_INT(250), }, { .name = "quality", .long_name = TRS("Nominal quality"), .type = BG_PARAMETER_SLIDER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(63), .val_default = GAVL_VALUE_INIT_INT(10), .num_digits = 1, .help_string = TRS("Quality for VBR mode\n\ 63: best (largest output file)\n\ 0: worst (smallest output file)"), }, { .name = "max_keyframe_interval", .long_name = TRS("Maximum keyframe interval"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(1), .val_max = GAVL_VALUE_INIT_INT(1000), .val_default = GAVL_VALUE_INIT_INT(64), }, #ifdef THEORA_1_1 { .name = "drop_frames", .long_name = TRS("Enable frame dropping"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(1), .help_string = TRS("Drop frames to keep within bitrate buffer constraints. This can have a severe impact on quality, but is the only way to ensure that bitrate targets are met at low rates during sudden bursts of activity."), }, { .name = "cap_overflow", .long_name = TRS("Don't bank excess bits for later use"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(1), .help_string = TRS("Ignore bitrate buffer overflows. If the encoder uses so few bits that the reservoir of available bits overflows, ignore the excess. The encoder will not try to use these extra bits in future frames. At high rates this may cause the result to be undersized, but allows a client to play the stream using a finite buffer; it should normally be enabled."), }, { .name = "cap_underflow", .long_name = TRS("Don't try to make up shortfalls later"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(0), .help_string = TRS("Ignore bitrate buffer underflows. If the encoder uses so many bits that the reservoir of available bits underflows, ignore the deficit. The encoder will not try to make up these extra bits in future frames. At low rates this may cause the result to be oversized; it should normally be disabled."), }, #endif { .name = "speed", .long_name = TRS("Encoding speed"), .type = BG_PARAMETER_SLIDER_FLOAT, .val_min = GAVL_VALUE_INIT_FLOAT(0.0), .val_max = GAVL_VALUE_INIT_FLOAT(1.0), .val_default = GAVL_VALUE_INIT_FLOAT(0.0), .num_digits = 2, .help_string = TRS("Higher speed levels favor quicker encoding over better quality per bit. Depending on the encoding mode, and the internal algorithms used, quality may actually improve, but in this case bitrate will also likely increase. In any case, overall rate/distortion performance will probably decrease."), }, BG_ENCODER_FRAMERATE_PARAMS, { /* End of parameters */ } }; static const bg_parameter_info_t * get_parameters_theora() { return parameters; } static void set_parameter_theora(void * data, const char * name, const gavl_value_t * v) { theora_t * theora = data; if(!name) return; else if(bg_encoder_set_framerate_parameter(&theora->fr, name, v)) return; else if(!strcmp(name, "target_bitrate")) theora->ti.target_bitrate = v->v.i * 1000; else if(!strcmp(name, "quality")) theora->ti.quality = v->v.i; else if(!strcmp(name, "cbr")) theora->cbr = v->v.i; else if(!strcmp(name, "max_keyframe_interval")) theora->max_keyframe_interval = v->v.i; else if(!strcmp(name, "speed")) theora->speed = v->v.d; #ifdef THEORA_1_1 else if(!strcmp(name, "drop_frames")) { if(v->v.i) theora->rate_flags |= TH_RATECTL_DROP_FRAMES; else theora->rate_flags &= ~TH_RATECTL_DROP_FRAMES; } else if(!strcmp(name, "cap_overflow")) { if(v->v.i) theora->rate_flags |= TH_RATECTL_CAP_OVERFLOW; else theora->rate_flags &= ~TH_RATECTL_CAP_OVERFLOW; } else if(!strcmp(name, "cap_underflow")) { if(v->v.i) theora->rate_flags |= TH_RATECTL_CAP_UNDERFLOW; else theora->rate_flags &= ~TH_RATECTL_CAP_UNDERFLOW; } #endif } static const gavl_pixelformat_t supported_pixelformats[] = { GAVL_YUV_420_P, #ifdef THEORA_1_1 GAVL_YUV_422_P, GAVL_YUV_444_P, #endif GAVL_PIXELFORMAT_NONE, }; #define PTR_2_32BE(p) \ ((*(p) << 24) | \ (*(p+1) << 16) | \ (*(p+2) << 8) | \ *(p+3)) #define PTR_2_32LE(p) \ ((*(p+3) << 24) | \ (*(p+2) << 16) | \ (*(p+1) << 8) | \ *(p)) #define INT32LE_2_PTR(num, p) \ (p)[0] = (num) & 0xff; \ (p)[1] = ((num)>>8) & 0xff; \ (p)[2] = ((num)>>16) & 0xff; \ (p)[3] = ((num)>>24) & 0xff #define INT32BE_2_PTR(num, p) \ (p)[3] = (num) & 0xff; \ (p)[2] = ((num)>>8) & 0xff; \ (p)[1] = ((num)>>16) & 0xff; \ (p)[0] = ((num)>>24) & 0xff #define WRITE_STRING(s, p) string_len = strlen(s); \ INT32LE_2_PTR(string_len, p); p += 4; \ memcpy(p, s, string_len); \ p+=string_len; static const uint8_t comment_header[7] = { 0x81, 't', 'h', 'e', 'o', 'r', 'a' }; static int init_compressed_theora(bg_ogg_stream_t * s) { int ret = 0; ogg_packet packet; int len; gavl_compression_info_t ci; theora_t * theora = s->codec_priv; theora->format = gavl_stream_get_video_format_nc(&s->s); memset(&packet, 0, sizeof(packet)); gavl_compression_info_init(&ci); gavl_stream_get_compression_info(&s->s, &ci); /* Write ID packet */ packet.packet = gavl_extract_xiph_header(&ci.codec_header, 0, &len); if(!packet.packet) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Didn't get first header page"); gavl_hexdump(ci.codec_header.buf, ci.codec_header.len, 16); goto fail; } packet.bytes = len; theora->ti.keyframe_granule_shift = (char) ((packet.packet[40] & 0x03) << 3); theora->ti.keyframe_granule_shift |= (packet.packet[41] & 0xe0) >> 5; if(!bg_ogg_stream_write_header_packet(s, &packet)) goto fail; /* Build comment packet */ bg_ogg_create_comment_packet(comment_header, 7, gavl_stream_get_metadata_nc(&s->s), s->m_global, 1, &packet); if(!bg_ogg_stream_write_header_packet(s, &packet)) goto fail; bg_ogg_free_comment_packet(&packet); /* Codepages */ packet.packet = gavl_extract_xiph_header(&ci.codec_header, 2, &len); if(!packet.packet) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Didn't get code pages"); goto fail; } packet.bytes = len; if(!bg_ogg_stream_write_header_packet(s, &packet)) goto fail; theora->frames_since_keyframe = -1; s->flags |= STREAM_KEYFRAMES; ret = 1; fail: gavl_compression_info_free(&ci); return ret; } static gavl_sink_status_t write_video_frame_theora(void * data, gavl_video_frame_t * frame) { theora_t * theora; int i; ogg_packet op; gavl_packet_t gp; // int64_t frame_index; // fprintf(stderr, "Write frame theora\n"); theora = data; for(i = 0; i < 3; i++) { theora->buf[i].stride = frame->strides[i]; theora->buf[i].data = frame->planes[i]; } #ifdef THEORA_1_1 if(theora->pass == 2) { /* Input pass data */ int ret; while(theora->stats_ptr - (char*)theora->stats.buf < theora->stats.len) { ret = th_encode_ctl(theora->ts, TH_ENCCTL_2PASS_IN, theora->stats_ptr, theora->stats.len - (theora->stats_ptr - (char*)theora->stats.buf)); if(ret < 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "passing 2 pass data failed"); return GAVL_SINK_ERROR; } else if(!ret) break; else { theora->stats_ptr += ret; } } } #endif th_encode_ycbcr_in(theora->ts, theora->buf); #ifdef THEORA_1_1 /* Output pass data */ if(theora->pass == 1) { int ret; char * buf; ret = th_encode_ctl(theora->ts, TH_ENCCTL_2PASS_OUT, &buf, sizeof(buf)); if(ret < 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "getting 2 pass data failed"); return GAVL_SINK_ERROR; } fwrite(buf, 1, ret, theora->stats_file); } #endif /* Output packet */ if(!th_encode_packetout(theora->ts, 0, &op)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Theora encoder produced no packet"); return GAVL_SINK_ERROR; } gavl_packet_init(&gp); bg_ogg_packet_to_gavl(&op, &gp, NULL); gp.pts = theora->pts; gp.duration = theora->format->frame_duration; theora->pts += theora->format->frame_duration; if(op.bytes && !(op.packet[0] & 0x40)) // Keyframe gp.flags |= GAVL_PACKET_TYPE_I | GAVL_PACKET_KEYFRAME; else gp.flags |= GAVL_PACKET_TYPE_P; #if 0 fprintf(stderr, "Encoding granulepos: %lld %lld / %d\n", op.granulepos, op.granulepos >> theora->ti.keyframe_granule_shift, op.granulepos & ((1<ti.keyframe_granule_shift)-1)); #endif // fprintf(stderr, "Write frame theora done\n"); // gavl_packet_dump(&gp); return gavl_packet_sink_put_packet(theora->psink, &gp); } static gavl_video_sink_t * init_theora(void * data, gavl_dictionary_t * s) { int sub_h, sub_v; int arg_i1, arg_i2; uint8_t * ptr; ogg_packet op; int header_packets; theora_t * theora = data; gavl_compression_info_t ci; gavl_dictionary_t * stream_metadata = gavl_stream_get_metadata_nc(s); gavl_video_format_t * format = gavl_stream_get_video_format_nc(s); theora->format = format; gavl_compression_info_init(&ci); gavl_stream_get_compression_info(s, &ci); bg_encoder_set_framerate(&theora->fr, format); /* Set video format */ theora->ti.frame_width = ((format->image_width + 15)/16*16); theora->ti.frame_height = ((format->image_height + 15)/16*16); theora->ti.pic_width = format->image_width; theora->ti.pic_height = format->image_height; theora->ti.fps_numerator = format->timescale; theora->ti.fps_denominator = format->frame_duration; theora->ti.aspect_numerator = format->pixel_width; theora->ti.aspect_denominator = format->pixel_height; format->interlace_mode = GAVL_INTERLACE_NONE; format->frame_width = theora->ti.frame_width; format->frame_height = theora->ti.frame_height; if(theora->cbr) theora->ti.quality = 0; else theora->ti.target_bitrate = 0; /* Granule shift */ theora->ti.keyframe_granule_shift = 0; while(1 << theora->ti.keyframe_granule_shift < theora->max_keyframe_interval) theora->ti.keyframe_granule_shift++; theora->ti.colorspace=TH_CS_UNSPECIFIED; format->pixelformat = gavl_pixelformat_get_best(format->pixelformat, supported_pixelformats, NULL); switch(format->pixelformat) { case GAVL_YUV_420_P: theora->ti.pixel_fmt = TH_PF_420; break; case GAVL_YUV_422_P: theora->ti.pixel_fmt = TH_PF_422; break; case GAVL_YUV_444_P: theora->ti.pixel_fmt = TH_PF_444; break; default: return 0; } /* Initialize encoder */ if(!(theora->ts = th_encode_alloc(&theora->ti))) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "th_encode_alloc failed"); return 0; } /* Build comment (comments are UTF-8, good for us :-) */ // build_comment(&theora->tc, metadata); /* Call encode CTLs */ // Keyframe frequency th_encode_ctl(theora->ts, TH_ENCCTL_SET_KEYFRAME_FREQUENCY_FORCE, &theora->max_keyframe_interval, sizeof(theora->max_keyframe_interval)); #ifdef THEORA_1_1 // Rate flags th_encode_ctl(theora->ts, TH_ENCCTL_SET_RATE_FLAGS, &theora->rate_flags,sizeof(theora->rate_flags)); #endif // Maximum speed if(th_encode_ctl(theora->ts, TH_ENCCTL_GET_SPLEVEL_MAX, &arg_i1, sizeof(arg_i1)) != TH_EIMPL) { arg_i2 = (int)((float)arg_i1 * theora->speed + 0.5); if(arg_i2 > arg_i1) arg_i2 = arg_i1; th_encode_ctl(theora->ts, TH_ENCCTL_SET_SPLEVEL, &arg_i2, sizeof(arg_i2)); } /* Encode initial packets */ ci.id = GAVL_CODEC_ID_THEORA; ci.flags = GAVL_COMPRESSION_HAS_P_FRAMES; header_packets = 0; /* Build global header */ while(th_encode_flushheader(theora->ts, &theora->tc, &op) > 0) { gavl_append_xiph_header(&ci.codec_header, op.packet, op.bytes); if(header_packets == 1) { char * vendor; int vendor_len; /* Extract vendor ID */ ptr = op.packet + 7; vendor_len = GAVL_PTR_2_32LE(ptr); ptr += 4; vendor = calloc(1, vendor_len + 1); memcpy(vendor, ptr, vendor_len); gavl_dictionary_set_string_nocopy(stream_metadata, GAVL_META_SOFTWARE, vendor); } header_packets++; } if(header_packets < 3) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Got %d header packets instead of 3", header_packets); return 0; } /* Initialize buffer */ gavl_pixelformat_chroma_sub(theora->format->pixelformat, &sub_h, &sub_v); theora->buf[0].width = theora->format->frame_width; theora->buf[0].height = theora->format->frame_height; theora->buf[1].width = theora->format->frame_width / sub_h; theora->buf[1].height = theora->format->frame_height / sub_v; theora->buf[2].width = theora->format->frame_width / sub_h; theora->buf[2].height = theora->format->frame_height / sub_v; gavl_stream_set_compression_info(s, &ci); gavl_compression_info_free(&ci); return gavl_video_sink_create(NULL, write_video_frame_theora, theora, theora->format); } #ifdef THEORA_1_1 static int set_video_pass_theora(void * data, int pass, int total_passes, const char * stats_file) { char * buf; int ret; theora_t * theora = data; theora->pass = pass; if(theora->pass == 1) { theora->stats_file = fopen(stats_file, "wb"); /* Get initial header */ if(!theora->stats_file) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "couldn't open stats file %s", stats_file); return 0; } ret = th_encode_ctl(theora->ts, TH_ENCCTL_2PASS_OUT, &buf, sizeof(buf)); if(ret < 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "getting 2 pass header failed"); return 0; } fwrite(buf, 1, ret, theora->stats_file); } else { if(!(gavl_read_file(stats_file, &theora->stats))) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "couldn't open stats file %s", stats_file); return 0; } theora->stats_ptr = (char*)theora->stats.buf; } return 1; } #endif #if 0 static int write_packet_theora(void * data, gavl_packet_t * packet) { ogg_packet op; theora_t * theora; theora = data; memset(&op, 0, sizeof(op)); op.packet = packet->data; op.bytes = packet->data_len; if(theora->frames_since_keyframe < 0) { if(!(packet->flags & GAVL_PACKET_KEYFRAME)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "First packet isn't a keyframe"); return 0; } theora->frames_since_keyframe = 0; theora->last_keyframe = packet->pts / theora->format->frame_duration + 1; } else if(packet->flags & GAVL_PACKET_KEYFRAME) { theora->last_keyframe += theora->frames_since_keyframe + 1; theora->frames_since_keyframe = 0; } else { theora->frames_since_keyframe++; } op.granulepos = (theora->last_keyframe << theora->ti.keyframe_granule_shift) + theora->frames_since_keyframe; #if 0 fprintf(stderr, "Encoding granulepos: %lld %lld / %d\n", op.granulepos, theora->last_keyframe, theora->frames_since_keyframe); #endif ogg_stream_packetin(&theora->os,&op); if(bg_ogg_flush(&theora->os, theora->output, 0) < 0) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Writing theora packet failed"); return 0; } return 1; } #endif static void convert_packet(bg_ogg_stream_t * s, gavl_packet_t * src, ogg_packet * dst) { theora_t * theora; theora = s->codec_priv; if(theora->frames_since_keyframe < 0) { if(!(src->flags & GAVL_PACKET_KEYFRAME)) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "First packet isn't a keyframe"); return; } theora->frames_since_keyframe = 0; theora->last_keyframe = src->pts / theora->format->frame_duration + 1; } else if(src->flags & GAVL_PACKET_KEYFRAME) { theora->last_keyframe += theora->frames_since_keyframe + 1; theora->frames_since_keyframe = 0; } else { theora->frames_since_keyframe++; } dst->granulepos = (theora->last_keyframe << theora->ti.keyframe_granule_shift) + theora->frames_since_keyframe; } static int close_theora(void * data) { int ret = 1; theora_t * theora; theora = data; #ifdef THEORA_1_1 if(theora->stats_file) fclose(theora->stats_file); gavl_buffer_free(&theora->stats); #endif th_comment_clear(&theora->tc); th_info_clear(&theora->ti); th_encode_free(theora->ts); free(theora); return ret; } const bg_ogg_codec_t bg_theora_codec = { .name = "theora", .long_name = TRS("Theora encoder"), .create = create_theora, .get_parameters = get_parameters_theora, .set_parameter = set_parameter_theora, #ifdef THEORA_1_1 .set_video_pass = set_video_pass_theora, #endif .init_video = init_theora, .init_video_compressed = init_compressed_theora, .set_packet_sink = set_packet_sink, .convert_packet = convert_packet, .close = close_theora, }; bplaum-gmerlin-encoders-172394d/plugins/ogg/vorbis.c000066400000000000000000000315401513225514200224140ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ #include #include #include #include #include #include #include #define LOG_DOMAIN "oggvorbis" #include #include #include "ogg_common.h" #include #define BITRATE_MODE_VBR 0 #define BITRATE_MODE_VBR_BITRATE 1 #define BITRATE_MODE_MANAGED 2 typedef struct { /* Ogg vorbis stuff */ // ogg_page enc_og; vorbis_info enc_vi; vorbis_comment enc_vc; vorbis_dsp_state enc_vd; vorbis_block enc_vb; bg_ogg_encoder_t * output; /* Options */ int managed; int bitrate_mode; int min_bitrate; int nominal_bitrate; int max_bitrate; float quality; /* Float from 0 to 1 (low->high) */ int quality_set; int64_t samples_read; gavl_audio_format_t * format; gavl_audio_frame_t * frame; gavl_packet_sink_t * psink; int64_t pts; } vorbis_t; static void * create_vorbis() { vorbis_t * ret; ret = calloc(1, sizeof(*ret)); return ret; } static const bg_parameter_info_t parameters[] = { { .name = "bitrate_mode", .long_name = TRS("Bitrate mode"), .type = BG_PARAMETER_STRINGLIST, .val_default = GAVL_VALUE_INIT_STRING("VBR"), .multi_names = (char const *[]){ "vbr", "vbr_bitrate", "managed", NULL }, .multi_labels = (char const *[]){ TRS("VBR"), TRS("VBR (bitrate)"), TRS("Managed"), NULL }, .help_string = TRS("Bitrate mode:\n\ VBR: You specify a quality and (optionally) a minimum and maximum bitrate\n\ VBR (bitrate): The specified nominal bitrate will be used for selecting the encoder mode.\n\ Managed: You specify a nominal bitrate and (optionally) a minimum and maximum bitrate\n\ VBR is recommended, managed bitrate might result in a worse quality") }, { .name = "nominal_bitrate", .long_name = TRS("Nominal bitrate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(1000), .val_default = GAVL_VALUE_INIT_INT(128), .help_string = TRS("Nominal bitrate (in kbps) for managed mode"), }, { .name = "quality", .long_name = TRS("VBR Quality (10: best)"), .type = BG_PARAMETER_SLIDER_FLOAT, .val_min = GAVL_VALUE_INIT_FLOAT(0.0), .val_max = GAVL_VALUE_INIT_FLOAT(10.0), .val_default = GAVL_VALUE_INIT_FLOAT(3.0), .num_digits = 1, .help_string = TRS("Quality for VBR mode\n\ 10: best (largest output file)\n\ 0: worst (smallest output file)"), }, { .name = "min_bitrate", .long_name = TRS("Minimum bitrate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(1000), .val_default = GAVL_VALUE_INIT_INT(0), .help_string = TRS("Optional minimum bitrate (in kbps)\n\ 0 = unspecified"), }, { .name = "max_bitrate", .long_name = TRS("Maximum bitrate (kbps)"), .type = BG_PARAMETER_INT, .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(1000), .val_default = GAVL_VALUE_INIT_INT(0), .help_string = TRS("Optional maximum bitrate (in kbps)\n\ 0 = unspecified"), }, { /* End of parameters */ } }; static const bg_parameter_info_t * get_parameters_vorbis() { return parameters; } static const uint8_t comment_header[7] = { 0x03, 'v', 'o', 'r', 'b', 'i', 's' }; static int init_compressed_vorbis(bg_ogg_stream_t * s) { int ret = 0; ogg_packet packet; int len; gavl_compression_info_t ci; memset(&packet, 0, sizeof(packet)); gavl_compression_info_init(&ci); gavl_stream_get_compression_info(&s->s, &ci); /* Write ID packet */ packet.packet = gavl_extract_xiph_header(&ci.codec_header, 0, &len); if(!packet.packet) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Broken vorbis header"); return 0; } packet.bytes = len; if(!bg_ogg_stream_write_header_packet(s, &packet)) return 0; /* Build comment packet */ bg_ogg_create_comment_packet(comment_header, 7, gavl_dictionary_get_dictionary_create(&s->s, GAVL_META_METADATA), s->m_global, 1, &packet); if(!bg_ogg_stream_write_header_packet(s, &packet)) return 0; bg_ogg_free_comment_packet(&packet); /* Codepages */ packet.packet = gavl_extract_xiph_header(&ci.codec_header, 2, &len); if(!packet.packet) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Broken vorbis header"); goto fail; } packet.bytes = len; if(!bg_ogg_stream_write_header_packet(s, &packet)) goto fail; ret = 1; fail: gavl_compression_info_free(&ci); return ret; } static void set_packet_sink(void * data, gavl_packet_sink_t * psink) { vorbis_t * vorbis = data; vorbis->psink = psink; } static int flush_packet(vorbis_t * vorbis, ogg_packet * op) { gavl_packet_t gp; gavl_packet_init(&gp); bg_ogg_packet_to_gavl(op, &gp, &vorbis->pts); return gavl_packet_sink_put_packet(vorbis->psink, &gp) ? 1 : 0; } static int flush_data(vorbis_t * vorbis, int force) { ogg_packet op; memset(&op, 0, sizeof(op)); /* While we can get enough data from the library to analyse, one block at a time... */ while(vorbis_analysis_blockout(&vorbis->enc_vd,&vorbis->enc_vb)==1) { if(vorbis->managed) { /* Do the main analysis, creating a packet */ vorbis_analysis(&vorbis->enc_vb, NULL); vorbis_bitrate_addblock(&vorbis->enc_vb); while(vorbis_bitrate_flushpacket(&vorbis->enc_vd, &op)) { /* Add packet to bitstream */ if(!flush_packet(vorbis, &op)) return 0; } } else { vorbis_analysis(&vorbis->enc_vb, &op); /* Add packet to bitstream */ if(!flush_packet(vorbis, &op)) return 0; } } /* Flush pages if any */ // if((result = bg_ogg_flush(&vorbis->enc_os, vorbis->output, force)) <= 0) // return result; return 1; } static gavl_sink_status_t write_audio_frame_vorbis(void * data, gavl_audio_frame_t * frame) { int i; vorbis_t * vorbis; float **buffer; vorbis = data; buffer = vorbis_analysis_buffer(&vorbis->enc_vd, frame->valid_samples); for(i = 0; i < vorbis->format->num_channels; i++) { vorbis->frame->channels.f[i] = buffer[i]; } gavl_audio_frame_copy(vorbis->format, vorbis->frame, frame, 0, 0, frame->valid_samples, frame->valid_samples); vorbis_analysis_wrote(&vorbis->enc_vd, frame->valid_samples); if(flush_data(vorbis, 0) < 0) return GAVL_SINK_ERROR; vorbis->samples_read += frame->valid_samples; return GAVL_SINK_OK; } static gavl_audio_sink_t * init_vorbis(void * data, gavl_dictionary_t * s) { ogg_packet header_main; ogg_packet header_comments; ogg_packet header_codebooks; // struct ovectl_ratemanage2_arg ai; vorbis_t * vorbis = data; uint8_t * ptr; char * vendor; int vendor_len; gavl_compression_info_t ci; gavl_compression_info_init(&ci); vorbis->format = gavl_stream_get_audio_format_nc(s); vorbis->frame = gavl_audio_frame_create(NULL); vorbis->managed = 0; /* Adjust the format */ vorbis->format->interleave_mode = GAVL_INTERLEAVE_NONE; vorbis->format->sample_format = GAVL_SAMPLE_FLOAT; bg_ogg_set_vorbis_channel_setup(vorbis->format); vorbis_info_init(&vorbis->enc_vi); /* VBR Initialization */ switch(vorbis->bitrate_mode) { case BITRATE_MODE_VBR: vorbis_encode_init_vbr(&vorbis->enc_vi, vorbis->format->num_channels, vorbis->format->samplerate, vorbis->quality); break; case BITRATE_MODE_VBR_BITRATE: vorbis_encode_setup_managed(&vorbis->enc_vi, vorbis->format->num_channels, vorbis->format->samplerate,-1,128000,-1); vorbis_encode_ctl(&vorbis->enc_vi,OV_ECTL_RATEMANAGE2_SET,NULL); vorbis_encode_setup_init(&vorbis->enc_vi); break; case BITRATE_MODE_MANAGED: vorbis_encode_init(&vorbis->enc_vi, vorbis->format->num_channels, vorbis->format->samplerate, vorbis->max_bitrate>0 ? vorbis->max_bitrate : -1, vorbis->nominal_bitrate, vorbis->min_bitrate>0 ? vorbis->min_bitrate : -1); vorbis->managed = 1; break; } vorbis_analysis_init(&vorbis->enc_vd,&vorbis->enc_vi); vorbis_block_init(&vorbis->enc_vd,&vorbis->enc_vb); /* Build the packets */ vorbis_analysis_headerout(&vorbis->enc_vd,&vorbis->enc_vc, &header_main,&header_comments,&header_codebooks); /* Extract vendor ID */ ptr = header_comments.packet + 7; vendor_len = GAVL_PTR_2_32LE(ptr); ptr += 4; vendor = calloc(1, vendor_len + 1); memcpy(vendor, ptr, vendor_len); gavl_dictionary_set_string_nocopy(gavl_dictionary_get_dictionary_create(s, GAVL_META_METADATA), GAVL_META_SOFTWARE, vendor); /* And stream them out */ gavl_append_xiph_header(&ci.codec_header, header_main.packet, header_main.bytes); gavl_append_xiph_header(&ci.codec_header, header_comments.packet, header_comments.bytes); gavl_append_xiph_header(&ci.codec_header, header_codebooks.packet, header_codebooks.bytes); ci.id = GAVL_CODEC_ID_VORBIS; gavl_stream_set_compression_info(s, &ci); gavl_compression_info_free(&ci); return gavl_audio_sink_create(NULL, write_audio_frame_vorbis, vorbis, vorbis->format); } static void set_parameter_vorbis(void * data, const char * name, const gavl_value_t * v) { vorbis_t * vorbis; vorbis = data; if(!name) { return; } else if(!strcmp(name, "nominal_bitrate")) { vorbis->nominal_bitrate = v->v.i * 1000; if(vorbis->nominal_bitrate < 0) vorbis->nominal_bitrate = -1; } else if(!strcmp(name, "min_bitrate")) { vorbis->min_bitrate = v->v.i * 1000; if(vorbis->min_bitrate < 0) vorbis->min_bitrate = -1; } else if(!strcmp(name, "max_bitrate")) { vorbis->max_bitrate = v->v.i * 1000; if(vorbis->max_bitrate < 0) vorbis->max_bitrate = -1; } else if(!strcmp(name, "quality")) { vorbis->quality = v->v.d * 0.1; } else if(!strcmp(name, "bitrate_mode")) { if(!strcmp(v->v.str, "vbr")) vorbis->bitrate_mode = BITRATE_MODE_VBR; else if(!strcmp(v->v.str, "vbr_bitrate")) vorbis->bitrate_mode = BITRATE_MODE_VBR_BITRATE; else if(!strcmp(v->v.str, "managed")) vorbis->bitrate_mode = BITRATE_MODE_MANAGED; } } static int close_vorbis(void * data) { int ret = 1; vorbis_t * vorbis; int result; vorbis = data; if(vorbis->samples_read) { vorbis_analysis_wrote(&vorbis->enc_vd, 0); result = flush_data(vorbis, 1); if(result < 0) ret = 0; } vorbis_block_clear(&vorbis->enc_vb); vorbis_dsp_clear(&vorbis->enc_vd); vorbis_comment_clear(&vorbis->enc_vc); vorbis_info_clear(&vorbis->enc_vi); if(vorbis->frame) gavl_audio_frame_destroy(vorbis->frame); free(vorbis); return ret; } const bg_ogg_codec_t bg_vorbis_codec = { .name = "vorbis", .long_name = TRS("Vorbis encoder"), .create = create_vorbis, .get_parameters = get_parameters_vorbis, .set_parameter = set_parameter_vorbis, .init_audio = init_vorbis, .init_audio_compressed = init_compressed_vorbis, // .encode_audio = write_audio_frame_vorbis, // .write_packet = write_packet_vorbis, .close = close_vorbis, .set_packet_sink = set_packet_sink, }; bplaum-gmerlin-encoders-172394d/po/000077500000000000000000000000001513225514200171225ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/po/ChangeLog000066400000000000000000000011321513225514200206710ustar00rootroot000000000000002014-06-17 gettextize * Makefile.in.in: Upgrade to gettext-0.18.3. * Rules-quot: Upgrade to gettext-0.18.3. 2007-02-15 gettextize * Makefile.in.in: New file, from gettext-0.15. * Rules-quot: New file, from gettext-0.15. * boldquot.sed: New file, from gettext-0.15. * en@boldquot.header: New file, from gettext-0.15. * en@quot.header: New file, from gettext-0.15. * insert-header.sin: New file, from gettext-0.15. * quot.sed: New file, from gettext-0.15. * remove-potcdate.sin: New file, from gettext-0.15. * POTFILES.in: New file. bplaum-gmerlin-encoders-172394d/po/LINGUAS000066400000000000000000000000031513225514200201400ustar00rootroot00000000000000de bplaum-gmerlin-encoders-172394d/po/Makefile.in.in000066400000000000000000000404231513225514200215770ustar00rootroot00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18.3 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SED = @SED@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. CHECK_MACRO_VERSION = \ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. # The determination of whether the package xyz is a GNU one is based on the # heuristic whether some file in the top level directory mentions "GNU xyz". # If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ else \ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ fi; \ } | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: bplaum-gmerlin-encoders-172394d/po/Makevars000066400000000000000000000035131513225514200206200ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword="bg_log:3" --keyword=TRS --keyword=TR # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Members of the gmerlin project # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = gmerlin-general@lists.sourceforge.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = bplaum-gmerlin-encoders-172394d/po/Makevars.template000066400000000000000000000044521513225514200224350ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = bplaum-gmerlin-encoders-172394d/po/POTFILES.in000066400000000000000000000034241513225514200207020ustar00rootroot00000000000000include/bgshout.h include/bgflac.h include/vorbiscomment.h include/gmerlin_encoders.h utils/cpuinfo.c lib/vorbiscomment.c lib/id3v1.c lib/bgshout.c lib/bgflac.c raspi-build-debug/include/config.h pc-build-normal/include/config.h raspi-build-normal/include/config.h plugins/lame/e_lame.c plugins/lame/xing.c plugins/lame/c_lame.c plugins/lame/xing.h plugins/lame/bglame.c plugins/lame/bglame.h plugins/ogg/_codec_plugin.c plugins/ogg/flac.c plugins/ogg/e_opus.c plugins/ogg/ogg_common.h plugins/ogg/vorbis.c plugins/ogg/opus.c plugins/ogg/c_opusenc.c plugins/ogg/ogg_common.c plugins/ogg/c_flacenc.c plugins/ogg/c_vorbisenc.c plugins/ogg/e_oggvideo.c plugins/ogg/e_vorbis.c plugins/ogg/c_theoraenc.c plugins/ogg/theora.c plugins/ogg/c_speexenc.c plugins/ffmpeg/_e_ffmpeg_video.c plugins/ffmpeg/c_ffmpeg_alaw.c plugins/ffmpeg/e_mpeg2video.c plugins/ffmpeg/c_ffmpeg_mp2.c plugins/ffmpeg/c_ffmpeg_mpeg2.c plugins/ffmpeg/e_mpegts.c plugins/ffmpeg/_codec_plugin.c plugins/ffmpeg/ffmpeg_common.h plugins/ffmpeg/c_ffmpeg_tga.c plugins/ffmpeg/e_avi.c plugins/ffmpeg/e_ac3.c plugins/ffmpeg/codec.c plugins/ffmpeg/c_ffmpeg_mpeg4.c plugins/ffmpeg/e_wma.c plugins/ffmpeg/_e_ffmpeg.c plugins/ffmpeg/c_ffmpeg_vp8.c plugins/ffmpeg/e_mp4.c plugins/ffmpeg/params.h plugins/ffmpeg/c_ffmpeg_x264.c plugins/ffmpeg/e_adts.c plugins/ffmpeg/c_ffmpeg_jpeg.c plugins/ffmpeg/_e_ffmpeg_audio.c plugins/ffmpeg/e_mpeg.c plugins/ffmpeg/e_mpeg1video.c plugins/ffmpeg/codecs.c plugins/ffmpeg/e_mp2.c plugins/ffmpeg/e_matroska.c plugins/ffmpeg/c_ffmpeg_mpeg1.c plugins/ffmpeg/e_asf.c plugins/ffmpeg/e_dvd.c plugins/ffmpeg/e_webm.c plugins/ffmpeg/ffmpeg_common.c plugins/ffmpeg/e_au.c plugins/ffmpeg/c_ffmpeg_ulaw.c plugins/ffmpeg/e_aiff.c plugins/ffmpeg/c_ffmpeg_ac3.c plugins/ffmpeg/e_vob.c plugins/flac/e_flac.c pc-build-debug/include/config.h bplaum-gmerlin-encoders-172394d/po/Rules-quot000066400000000000000000000034111513225514200211240ustar00rootroot00000000000000# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header bplaum-gmerlin-encoders-172394d/po/boldquot.sed000066400000000000000000000003311513225514200214450ustar00rootroot00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g bplaum-gmerlin-encoders-172394d/po/de.gmo000066400000000000000000001161151513225514200202230ustar00rootroot00000000000000~ FD8 } !!!!!!!! !! "#">"B"V"j"~"##*##'##$$$2$$$ %'%,%)4%6^%%%$%%& & & ,&9&1I&U{&& &[& I'KV'(( (((( (()/)O)o)))\)* 1*=*L*R*d*m* q*{**j* ++1+C+T+n++!+#+!+,,I;,,]-^{-[-K6..=..j.b\/F/Z0xa0q0OL11N11_2n22222 2'2 3 '3 33@3T3^\33 33334 4444J4`4 o4y444444 445585X5l5!|5 55555>5$6)6 -696T6 f6r66 666 66 6&7D7W7 j7w7 777 77"7 8 !8.858!J8"l888R8M9b9j9 r9d99:#:;:R::':/;G;;+;<.<d5<<<#<<=='=a=0>H>%M> s>>#>>>>G ?-U?G??2?@C@ @ @@@ALA*bAAAAAmA{UBB B2B2CHCRC?DEDaKDNDTDNQEEEEEETET/F FF FFF2F GNG!H9H.I3IEI\I kIxI I IIXK*]KKKaK[LoL~LnMM FN RO `OkOO OO_PyPnPP-QEQ[QxQ!Q\Q R RR R/RCRS[RRRRRc SmSSSS'S S(T10TbT}T+TT TT T T U$!UFUVUZUiUrUUVVV-!V_OVVVVVV4W;W&LWsWWWWWWWWXX$.X%SX$yXXXXXYY7YOYeYkYtY>YSZ\[ v[,[\\\\\\]] ]]9]S]l]p]]]]!I^k^^_F7_~_$__@c`(` ` ``B`B9a |a'a/aab b&b=bNb7]bTbb bcc kc_ycdd deee e+*e+Ve-e-e*e f#f_Cff ffffff fggp/gg#ggg g$h@h&_h)h'h:h\ipitjwjukZ}kkEk8llTldlJ&mWqmmrInSno\%oonop$p)p?p[p(qp/p p p ppqgqwq ~qqqq qqq r )rJr \rgrzrrrrr rrs,s0Js{ss#s sssstStltrtvttttt tttu u(u"Gu'juuu uu uuv v+v">vav uvvv!v"vvv[wTsw w w wzw!exx&xxx ry)y3yyz/zzzz{)}{{&{{{|)|s|J} h}:v} }}+}@}@~GZ~/~O~ "C`P X e p }I26#Jnt~v {))قXdRS[RUgm XX Zh 5]ʇ(@0Nb{ ĉċ0ɋu3]$Di ) 7B] dq"Hk4$Y$l&yȒ B LV\k_ !=Xtv&$,Q-o*4ٕ.5M# ʖؖ- 15DM^7? ˜̘4(])r$*ۙ%,/4&9`,-ɚ,$$Bg%$ț +1:wCC'  Kg r$\A?~*yz3@;h{I^H(m#4eqR|#i` 4[YRs+t@0M oVFwbl5.6\f{<}08o+/NV>XQDPOf3 X(l1g!G=%1HLT cJsJq~OBbyUcr`Gp_u/dzE&aBhEK5?j$6mUZ>2pL |kP9:xN_SAt^YuQnvZT*I]xW;]"=[:7-'.8)S"Ma 2dek v),,n}-<i7j &!9%WFD0: Fastest encoding, biggest files 8: Slowest encoding, smallest files0: Slowest encoding, best quality 9: Fastest encoding, worst quality16 bit PCM2: Strictly conform to a older more strict version of the spec or reference software 1: Strictly conform to all the things in the spec no matter what consequences 0: Default -1: Allow unofficial extensions -2: Allow non standarized experimental things4 MV per MB allowed4:1:14:2:0 (MPEG-1/JPEG)4:2:0 (MPEG-2)4:2:0 (PAL DV)4:2:24:4:44:4:4:4 (YUVA)8 bit PCMABR max bitrate (kbps)ABR min bitrate (kbps)ABR overall bitrate (kbps)AC3Additional stream 1Additional stream 2Additional stream 3Additional stream to multiplex into the final output file. Use this if you want e.g. create mp3 or AC3 audio with some other encoderAdvanced intra codingAdvanced optionsAllow 4 motion vectors per macroblock (slightly better quality). Works better if MB decision mode is "Fewest bits" or "Rate distoration".Allow fast encodingAllow non spec compliant speedup tricksAlternative inter vlcAlways try a MB with MV=<0,0>Amount of motion predictors from the previous frame. 0 (default) a Will use 2a+1 x 2a+1 macroblock square of motion vector predictors from the previous frame.Amount of qscale change between easy & hard scenesAmount of qscale smoothing over timeAudio layerAutoAverageAverage bitrate (0: VBR based on quality)Average bitrate (in kbps). Set to 0 for disabling ABR.Average bitrate (kbps)Average bitrate for ABR modeAvoid B-frames in high motion scenesB quantizer factorB quantizer offsetBRD scaleBasic optionsBidir refineBit rate (kbps)Bitrate %d kbps unsupported, switching to %d kbpsBitrate (in kbps). Set to 0 for seleting the standard bitrates for the encoding mode.Bitrate (kbps)Bitrate ModeBitrate in kbps. If your selection is no valid mp3 bitrate, we'll choose the closest value.Bitrate modeBitrate mode: VBR: You specify a quality and (optionally) a minimum and maximum bitrate VBR (bitrate): The specified nominal bitrate will be used for selecting the encoder mode. Managed: You specify a nominal bitrate and (optionally) a minimum and maximum bitrate VBR is recommended, managed bitrate might result in a worse qualityBitrate tolerance (kbps)BitsBlock typesBorder maskingBothCBP RDCBR optionsCannot find mp2enc exectuableCannot find mp2enc executableCannot find mpeg2enc exectuableCannot find mpeg2enc executableCannot find mplex exectuableCannot open %s: %sCannot open file %s: %sChoose quantization such that noise will be masked by similar-frequency content in the imageChroma elimination thresholdChroma modeClose all GOPsCodecCompression LevelConstantDVDDVD (NAV)DVD (for dvdauthor)Darkness maskingDecoder bitstream buffer size in kbits. When encoding with max and/or min bitrate, this must be specified.DefaultDirectory for temporary filesDivx 3 compatibleDon't draw edgesDon't use mid/side codingEnable chroma ILDCT ME compareEnable chroma ME compareEnable chroma ME pre-pass compareEnable chroma macroblock ME compareEnable chroma subpixel ME compareEnable file-based discontinuous transmissionEncode image parts near the border with reduced quality. 0 means disabledEncode inter blocks with reduced quality (increases the quality of intra blocks). 0 means disabled, 1 will double the bits allocated for intra blocks.Encode very bright image parts with reduced quality. 0 means disabled, 0-0.3 is a sane range.Encode very complex image parts with reduced quality. 0 means disabled, 0-0.5 is a sane range.Encode very dark image parts with reduced quality. 0 means disabled, 0-0.3 is a sane range.Encode very fast moving image parts with reduced quality. 0 means disabled.Encoder for Speex filesEncoder for Theora files. Audio can be Vorbis, Flac or Speex.Encoder for Vorbis filesEncoder for elementary MPEG-1 layer 1/2 audio streams. Based on mjpegtools (http://mjpeg.sourceforge.net).Encoder for elementary MPEG-1/2 video streams. Based on mjpegtools (http://mjpeg.sourceforge.net).Encoder for flac files. Based on libflac (http://flac.sourceforge.net)Encoder for flac streams in Ogg containers. Based on libflac (http://flac.sourceforge.net)Encoder for mp3 files. Based on lame (http://www.mp3dev.org). Supports CBR, ABR and VBR as well as ID3V1 and ID3V2 tags.Encoder for regular .mpg files as well as VCD and DVD streams. Based on mjpegtools (http://mjpeg.sourceforge.net)Encoder for yuv4mpeg files. Based on mjpegtools (http://mjpeg.sourceforge.net).Encoding complexityEncoding mode. If you select Auto, the mode will be taken from the samplerate.Encoding speedEnter further commandline options for mpeg2enc here. Check the mpeg2enc manual page for detailsEntries in the seektableEpzsFFmpeg audio encoderFFmpeg audio/video encoderFFmpeg video encoderFLAC__stream_encoder_init failedFLAC__stream_encoder_init_stream failedFaac encoderFewest bitsFlac encoderFlac in Ogg encoderFlash 1For constant bitrate, choose a target bitrate. For variable bitrate, choose a nominal quality.FormatFrame typesFrames per Ogg packetFullGOP size (0 = intra only)GeneralGot no Flac ID pageGot no Speex ID pageGot no Theora ID pageGot no Vorbis ID pageGrayscale modeGreyscaleH263P slice structHi-ResI quantizer factorI quantizer offsetID3V2 EncodingILDCT compare functionISO-8859-1Initial RC buffer occupancyInitial RC complexityInitializing encoder failedInitializing encoder failed: %sInter block maskingInter thresholdInterlaced dct compare function. Joint stereoKVCDLame mp3 encoderLast predictor countLayer (1 or 2)Leave empty to use the same directory as the final output fileLeftLogLoop filterLuma elimination thresholdLuminance maskingMB ThesholdMB compare functionMB decision modeME ThesholdME diamond size & shapeME penalty compensationME pre-passME pre-pass compare functionME pre-pass diamond size & shapeMPEG 1/2 program/system stream encoderMPEG audio layer 2MPEG audio layer 3MPEG-1 (VCD)MPEG-1 (generic)MPEG-1 VideoMPEG-1 layer 1/2 audio encoderMPEG-1/2 video encoderMPEG-2 (SVCD)MPEG-2 (generic)MPEG-2 Low Complexity profile (LC)MPEG-2 Main profileMPEG-2 VideoMPEG-4MPEG-4 AC predictionMPEG-4 Long Term Prediction (LTP)MPEG-4 Low Complexity profile (LC)MPEG-4 Main profileMacroblock compare function. Macroblock threshold. under which the user specified macroblock types will be usedMake VCD compliant output. This forces layer II, 224 kbps and 44.1 KHz stereoManagedMaskingMax B-FramesMaximum Lagrange multiplier for ratecontrol. Should possibly be the same as maximum quantizer scale.Maximum MB lagrange multiplerMaximum MB quantizerMaximum bitrate (0 means arbitrary)Maximum bitrate (kbps)Maximum bitrate for ABR mode. 0 means let lame decide. If your selection is no valid mp3 bitrate, we'll choose the closest value.Maximum lagrange multiplerMaximum macroblock Lagrange multiplier.Maximum number of B-frames between non B-framesMaximum number of entries in the seek table. Default is 100, larger numbers result in shorter seeking times but also in larger files.Maximum quantizer differenceMaximum quantizer difference between framesMaximum quantizer scaleMedianMinimum Lagrange multiplier for ratecontrol. Should possibly be the same as minimum quantizer scale.Minimum MB lagrange multiplerMinimum MB quantizerMinimum bitrate (0 means arbitrary)Minimum bitrate (kbps)Minimum bitrate for ABR mode. 0 means let lame decide. If your selection is no valid mp3 bitrate, we'll choose the closest value.Minimum lagrange multiplierMinimum macroblock Lagrange multiplier.Minimum quantization for VBR. Lower numbers mean higher quality. For CBR, this option is ignored.Minimum quantizer scaleMiscMixed interlacing not supported (yet)Motion JPEGMotion estimationMotion estimation compare function.Motion estimation diamond size. Negative means shape adaptive.Motion estimation methodMotion estimation pre-pass 0: disabled 1: only after I-frames 2: alwaysMotion estimation pre-pass compare function. Motion estimation pre-pass diamond size. Negative means shape adaptive.Motion estimation rangeMotion estimation search range (0 means unlimited)Motion estimation threshold. under which no motion estimation is performed, but instead the user specified motion vectors are usedMultiplied by qscale for each frame and added to scene_change_scoreNSSE weightNarrowbandNo longNo shortNoise reductionNoise vs. SSE weight for the NSSE comparsion function. 0 is identical to SSENominal bitrate (in kbps) for managed modeNominal bitrate (kbps)Nominal qualityNormalize adaptive quantizationNumber of B-FramesNumber of bits the bitstream is allowed to diverge from the reference. Unused for constant quantizer encodingNumber of kilobits which should be loaded into the rc buffer before encoding starts. Must not be larger than RC buffer sizeOBMCObject typeOptional maximum bitrate (in kbps) 0 = unspecifiedOptional minimum bitrate (in kbps) 0 = unspecifiedOutput format. Note that for some output formats (e.g. VCD), you MUST use proper settings for the audio and video streams also, since this isn't done automaticallyOverlapped block motion compensation (only supported with with simple MB decision)PhodsPlanePlugin for encoding AAC streams (with ADTS headers). Based on faac (http://faac.sourceforge.net).Plugin for encoding various audio formats with ffmpeg (http://www.ffmpeg.org).Plugin for encoding various audio/video formats with ffmpeg (http://www.ffmpeg.org).Plugin for encoding various video formats with ffmpeg (http://www.ffmpeg.org).Precition methodQP RDQpel MEQualityQuality (10: best)Quality for VBR mode 10: best (largest output file) 0: worst (smallest output file)Quality for VBR mode 63: best (largest output file) 0: worst (smallest output file)QuantizationQuantization matricesQuantizerQuantizer blurQuantizer compressionQuantizer factor between B-frames and non-B-framesQuantizer factor between P-frames and I-frames. If > 0 then the last P frame quantizer will be used (q= lastp_q*factor+offset). If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)Quantizer for fixed quality encoding. Lower means better, 1 is not recommendedQuantizer noise shapingQuantizer offset between B-frames and non-B-frames if > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset) if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)Quantizer offset between P-frames and I-framesQuantizer qualityRC buffer aggressivityRC buffer sizeRate controlRate distorationReal Video 1Removing %sSAD: Sum of absolute differences SSE: Sum of squared errors SATD: Sum of absolute Hadamard transformed differences DCT: Sum of absolute DCT transformed differences PSNR: Sum of squared quantization errors (low quality) BIT: Number of bits needed for the block RD: Rate distortion optimal (slow) ZERO: 0 VSAD: Sum of absolute vertical differences VSSE: Sum of squared vertical differences NSSE: Noise preserving sum of squared differencesSVCDSamplerate %d unsupported, switching to %dScenechange factorScenechange thresholdSet the chroma mode of the output file. Auto means to take the format most similar to the source.Sets the MPEG flavour. Note, that for VCD, SVCD and DVD, you MUST provide valid frame sizesSingle coefficient elimination threshold for chrominamce. Negative values also consider dc coefficient. 7 is JVT recommendationSingle coefficient elimination threshold for luminance. Negative values also consider dc coefficient. -4 is JVT recommendationSpatial complexity maskingSpecify constant or variable bitrate. For "Auto", constant bitrate will be used for MPEG-1, variable bitrate will be used for MPEG-2. For formats, which require CBR, this option is ignoredSpecify the number of B-frames between 2 P/I frames. More B-frames slow down encoding and increase memory usage, but might give better compression results. For VCD, this option is ignored, since the VCD standard requires 2 B-frames, no matter if you like them or not.Speex encoderSpeex modeStandards complianceStereoStereo modeStereo: Completely independent channels Joint stereo: Improve quality (save bits) by using similarities of the channels Auto (recommended): Select one of the above depending on quality or bitrate settingStrictly enforce GOP sizeSubpel ME qualitySubpel motion estimation refinement quality (for qpel). Higher values mean higher quality but slower encoding.Subpixel ME compare functionSubpixel motion estimation compare function. Target bitrate (kbps)Temporary complexity maskingTheora encoderTheora encoder produced no packetThreshold for scene change detection. Negative values mean more sensitivity (more keyframes)UTF-16 BEUTF-16 LEUTF-8Ultra-widebandUnknown MPEG formatUnlimited motion vectorUse 1/4 pixel motion compensation. Warning: QPEL is not supported by all decoders.Use alternative scantableUse compare functionUse constant bitrateUse data partitioningUse data partitioning for more robustness if the video is for transmitting over unreliable channelsUse fixed quality encodingUse fixed quantizerUse global motion compensationUse only bitexact stuffUse only bitexact stuff (except (i)dct)Use qpel MCUse rate distortion optimization for cbpUse rate distortion optimization for qp selectionUse temporal noise shapingUse trellis quantizationUse trellis quantization (improves quality)Use voice activity detectionUser optionsVBRVBR (bitrate)VBR QualityVBR Quality (10: best)VBR Quality level. 0: best, 9: worstVBR/ABR optionsVCDVCD CompatibleVariableVariable bitrateVideo bitrate in kbps. For VBR, it's the maximum bitrate. If the format requires a fixed bitrate (e.g. VCD) this option is ignoredVorbis encoderWMV 1WMV 2Warning: GMC is not supported by all decodersWhen using masking, try to adjust the per macroblock quantizers to maintain the desired averageWidebandWindows media Audio 1Windows media Audio 2Write ID3V1.1 tagWrite ID3V2 tagWrite Vorbis comment containing metadata to the fileWrite seek tableWrite seektable (strongly recommended)Write vorbis commentWriting packet failedWriting theora packet failedWriting to file failed: %sX1ZeroalawfaacEncSetConfiguration failedlame_init_params failedlame_set_VBR failedlame_set_VBR_max_bitrate_kbps failedlame_set_VBR_mean_bitrate_kbps failedlame_set_VBR_min_bitrate_kbps failedlame_set_VBR_q failedlame_set_bWriteVbrTag failedlame_set_brate failedlame_set_in_samplerate failedlame_set_mode failedlame_set_num_channels failedlame_set_quality failedlame_set_scale failedmulawtmpegencyuv4mpeg2 encoderProject-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: gmerlin-general@lists.sourceforge.net PO-Revision-Date: 2007-11-18 22:25+0100 Last-Translator: FULL NAME Language-Team: LANGUAGE Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0: Schnellstes Kodieren, größte Dateien 8: Langsamstes Kodieren, kleinste Dateien0: Langsamstes Encodieren, Beste Qualität 9: Schnellstes Encodieren, Schlechteste Qualität16 Bit PCM2: Strenges Befolgen einer älteren, strengeren Version der Spezifikation oder Referenzsoftware 1: Strenges Befolgen der Spezifikation oder Referenzsoftware ungeachtet der Konsequenzen 0: Voreinstellung -1: Erlaube inoffizielle Erweiterungen -2: Erlaube nicht standardisierte und experimentelle Dinge4 MV per MB erlaubt4:1:14:2:0 (MPEG-1/JPEG)4:2:0 (MPEG-2)4:2:0 (PAL DV)4:2:24:4:44:4:4:4 (YUVA)8 Bit PCMABR Maximalbitrate (kbps)ABR Mindestbitrate (kbps)ABR Gesamtbitrate (kbps)AC3Zusätzlicher Stream 1Zusätzlicher Stream 2Zusätzlicher Stream 3Zusätzliche Streams zum Multiplexen in die endgültige Ausgabedatei. Benutze dies, wenn Du z.B. mp3 oder AC3 mit anderen Kodieren ergeugen willst.Fortgeschrittlene Intra CodierungFortgeschrittene OptionenErlaube 4 Bewegungsvektoren pro Macroblock (etwas bessere Qualität). Arbeit besser wenn der MB Wahlmodus "Wenigste Bits" oder "Ratenverzerrung" ist.Erlaube schnelles CodierenErlaube Beschleunigungstricks, die nicht der Spezifikation entsprechenAlternatives inter vlcVersuche immer einen MB mit MV=<0,0>Anzahl der Vorhersager vom vorherigen Bild. 0 ist Voreinstellung, a wird 2a+1 mal 2a+1 Makroblock Quadrat von Bewegungsvektor-Vorhersagern vom vorherigen Bild benutzen.Menge der qcale Änderung zwiischen leichten und schweren SzenenMenge an qscale Glättung über die ZeitAudio layerAutomatischDurchschnittlichDurchschnittliche Bitrate (0: Qualitätsbasierte Variable Bitrate)Durchschnittliche Bitrate (in kbps). Wähle 0 um ABR abzuschalten.Durchschnittliche Bitrate (kbps)Durchschnittliche Bitrate for ABR modusVermeide B-Frames in bewegungsintensiven SzenenB Quantizer FaktorB Quantizer VersatzBRD SkalaGrundlegenden OptionenBidir AbstimmungBitrate (kbps)Bitrate %d kbps wird nicht unterstützt, wähle %d kbpsBitrate (in kbps). Wähle 0 um die Standardbitrate für den Enkodiermodus zu nehmen.Bitrate (kbps)BitratenmodusBitrate in kbps. Wenn Deine Auswahl keine gültige mp3-Bitrate ist, nehmen wir die nächstliegende.BitratenmodusBitratenmodus:\n VBR: Du wählst eine Qualität und (optional) eine minimale und maximale Bitrate\n VBR (Bitrate): Die gewählte Bitrate wird verwendet um den Kdiermodus zu wählen.\n Gesteuert: Du wählst eine nominelle und (optional) eine minimale und maximale Bitrate.\n VBR ist empfohlen, kontrollierte Bitrate könnte Qualitätseinbußen bringen.Bitratentoleranz (kbps)BitsBlocktypenRandmaskierungBeideCBP RDCBR OptionenKann ausführbare Datei mp2enc nicht findenKann ausführbare Datei mp2enc nicht findenKann ausführbare Datei mpeg2enc nicht findenKann ausführbare Datei mpeg2enc nicht findenKann ausführbare Datei mplex nicht findenKann %s nicht öffnen: %sKann Datei %s nicht öffnen: %sWähle Quantisierung so dass Rauschen von Bildinhalten mit ähnlichen Frequenzen maskiert wird.Chroma GrenzwertChroma modusSchließe alle GOPsCodecKompressionsstufeKonstantDVDDVD (NAV)DVD (für dvdauthor)DunkelheitsmaskierungDecoder Bitstream Puffergröße in kbits. Beim Codieren mit Max und/oder Min Bitrate muss dies angegeben werden.VoreinstellungVerzeichnis für temporäre DateienDivx 3 kompatibelZeichne keine KantenBenutze keine Mid/Side KodierungAktiviere Chroma ILDCT ME Vergleich.Aktiviere Chroma ME Vergleich.Aktiviere Chroma ME pre-pass VergleichAktiviere Chroma Macroblock ME Vergleich.Aktiviere Chroma subpixel ME Vergleich.Aktiviere Dateibasierte, nichtkontinuierliche ÜbertragungCodiere Bild teile in der Nähe der Ränder mit verringerter Qualität. 0 heißt deaktiviertKodiere Inter-Blöcke mit reduzierter Qualität (erhöhe die Qualität von Intra-Blöcken). 0 heist abgeschaltet, 1 wird die Zahl der Bits für Intra-Blöcke verdoppeln.Codiere sehr helle Bild teile mit verringerter Qualität. 0 heißt deaktiviert, 0-0,3 ist ein vernünftiger Bereich.Codiere sehr komplexe Bild teile mit verringerter Qualität. 0 heißt deaktiviert, 0-0,5 ist ein vernünftiger Bereich.Codiere sehr dunkle Bild teile mit verringerter Qualität. 0 heißt deaktiviert, 0-0,3 ist ein vernünftiger Bereich.Codiere sehr Bewegungsintensive Bild teile mit verringerter Qualität. 0 heißt deakiviertEnkoder für SpeexdateienKodierer für Theoradateien. Audio kann Vorbis, Flac oder Speex sein.Kodierer für VorbisdateienKodierer für elementare MPEG-1 layer 1/2 Audiodateien. Verwendet mjpegtools (http://mjpeg.sourceforge.net).Kodierer für elementare MPEG-1/2 Videodateien. Verwendet mjpegtools (http://mjpeg.sourceforge.net).Kodierer für Flacdateien. Verwendet libflac (http://flac.sourceforge.net)Kodierer für Flac Audio in Oggdateien. Verwendet libflac (http://flac.sourceforge.net)Enkoder für mp3-Dateien. Verwendet lame (http://www.mp3dev.org). Unterstützt CBR, ABR und VBR sowie ID3V1 und ID2V2 KennungenKodierer für reguläre mpg-Dateien sowie VCD und DVD Dateien. Verwendet mjpegtools (http://mjpeg.sourceforge.net)Kodierer für yuv4mpeg Dateien. Verwendet mjpegtools (http://mjpeg.sourceforge.net)EnkodierkomplexitätEnkodiermodus. Wenn Du Automatisch wählst, wird der Modus aus der Abtastfrequenz ermittelt.KodiergeschwindigkeitGib zusätliche Komanndozeilenargumente für mpeg2enc an. Schau in die mpeg2enc Manual-Page für Einzelheiten.Einträge in der SuchtabelleEpzsFFmpeg Audio KodiererFFmpeg Audio/Video KodiererFFmpeg video KodiererFLAC__stream_encoder_init fehlgeschlagenFLAC__stream_encoder_init_stream fehlgeschlagenFaac encoderWenigste BitsFlac EnkoderFlac in Ogg KodiererFlash 1Für constante Bitrate, wähle eine Zielbitrate. Für variable Bitrate, wähle eine nominelle QualitätFormatFrametypenRahmen pro Ogg-PaketVollGOP größe (0 = nur intra)AllgemeinBekam keine Flac-KennungsseiteBekam keine Speex KennungsseiteBekam keine Theora-KennungsseiteBekam keine Vorbis-KennungsseiteSchwarzweß ModusGraustufenH263P slice structHi-ResI Quantizer FaktorI Quantizer VersatzID3V2 ZeichentabelleILDCT VergleichsfunktionISO-8859-1Anfängliche RC PufferbelegungAnfängliche RC KomplexitätInitialisierung des Kodierers fehlgeschlagenInitialisierung des Kodierers fehlgeschlagen: %sInterblock MaskierungInter SchwellwertInterlaced dct Vergleichsfunktion. Joint stereoKVCDLame mp3 CodiererAnzahl letzter Vorhersager Layer (1 oder 2)Leerlassen um das gleiche Verzeichnis, wie die endgütlige Ausgabedatei, zu wählenLinksLogSchleifenfilterLuma GrenzwertHelligkeitsmaskierungMB SchwellwertMB VergleichsfunktionMB WahlmodusME SchwellwertME Diamantgröße und -formME StrafenausgleichME pre-passME pre-pass VergleichsfunktionME pre-pass Diamantgröße & -formMPEG 1/2 program/system stream KodiererMPEG Audio Layer 2MPEG Audio layer 3MPEG-1 (VCD)MPEG-1 (allgemein)MPEG-1 VideoMPEG-1 layer 1/2 Audio KodiererMPEG-1/2 Video KodiererMPEG-2 (SVCD)MPEG-2 (allgemein)MPEG-2 Low Complexity profile (LC)MPEG-2 Main profileMPEG-2 VideoMPEG-4MPEG-4 AC VorhersageMPEG-4 Long Term Prediction (LTP)MPEG-4 Low Complexity profile (LC)MPEG-4 Main profileMakroblock Vergleichsfunktion. Macroblock Schwellwert, unter welchem vom Nutzer gegebene Macroblocktypen verwendet werden.Erzeuge VCD-kompatible Ausgabe. Dies erzwingt Layer II, 224 kbps und 44.1 KHz StereoGesteuertMaskierungMax B-FramesMaximaler Lagrange Multiplikator für Ratensteuerung. Sollte wenn möglich gleich der Maximalen Quantizer Skalierung sein.Maximaler MB Lagrange multiplier.Maximaler MB QuantizerMaximale Bitrate (0 bedeutet beliebig)Maximale Bitrate (kbps)Maximale Bitrate für ABR Modus. 0 heißt, lame darf entscheiden. Wenn Deine Auswahl keine gültige mp3-Bitrate ist, nehmen wir die nächstliegende.Maximaler Lagrange MultiplikatorMaximaler macroblock Lagrange multiplier.Maximale Anzahl an B-Frames zwischen nicht B-FramesMaximale Zahl der Einträge in der Suchtabelle. Voreinstellung ist 100, größere Zahlen resultieren in schnellerem Suchen aber auch in größeren Dateien.Maximaler Quantizer UnterschiedMaximaler quantizer Unterschied zwischen FramesMaximale Qunatizer SkalierungMedianMinimaler Lagrange Multiplikator für Ratensteuerung. Sollte wenn möglich gleich der Minimalen Quantizer Skalierung sein.Minimaler macroblock Lagrange multiplier.Minimaler MB QuantizerMinimale Bitrate (0 bedeutet beliebig)Minimale Bitrate (kbps)Minimale Bitrate für ABR Modus. 0 heißt, lame darf entscheiden. Wenn Deine Auswahl keine gültige mp3-Bitrate ist, nehmen wir die nächstliegende.Minimaler Lagrange-FaktorMinimaler macroblock Lagrange multiplier.Minimaler Quantizierer für VBR. Niedrigere Werte bedeuten höhere Qualität. Für CBR wird diese Option ignoriert.Minimale Quantizer SkalierungVerschiedenesGemischtes Interlacing wird nicht unterstützt (bis jetzt)Motion JPEGBewegungsabschätzungVergleichsfunktion für Bewegungsausgleich.Motion Estimation Diamantgröße. Negative bedeutet Formadaptiv.Art der Motion EstimationMotion estimation pre-pass 0: deaktiviert 1: nur nach I-Frames 2: immerMotion estimation pre-pass Vergleichsfunktion. Motion Estimation pre-pass Diamantgröße. Negative Werte bedeuten Formadaptiv.Reichweite der Motion EstimationMotion Estimation Suchweite Schwellwert für Motion Estimation, unter welchem keine Motion Compensation durchgeführt wird und stattdessen vom Nutzer gegebene Bewegungsvektoren verwendet werden.Für jeden Frame mit qscale multipliziert und zu scene_change_score hinzuaddiertNSSE GewichtSchmalbandKeine langenKeine kurzenRausch UnterdrückungRausch vs SSE Wichtung für die NSSE Vergleichsfunktion. 0 entspricht SSENominelle Bitrate (in kbps) für gesteuerten ModusNominelle Bitrate (kbps)Nominelle QualitätNormalisiere adaptive QuantisierungAnzahl der B-FramesAnzahl an Bits die der Bitstream von der Referenz abweichen darf. Nicht verwendet bei konstantem Quantizer Codieren.Anzahl an Kilobits die vor dem Codieren in den RC Puffer geladen werden sollen. Darf nicht mehr als die RC Puffergröße sein.OBMCObjekttypOptionale maximale Bitrate (0 = beliebig)Optionale minimale Bitrate (0 = beliebig)Ausgabeformat. Beachte, daß Du für einige Formate (z.B. VCD) die richtigen Einstellungen für die Audio- und Videokodierer machen mußt, da dies nicht automatisch geschieht.Überlappender Block-Bewegungsausgleich (nur unterstützt mit einfacher MB-Entscheidung)PhodsPlanePlugin zum Erzeugen von AAC Dateien (mit ADTS Köpfen). Verwendet faac (http://faac.sourceforge.net)Plugin zum Erzeugen Verschiedener Audioformate mit ffmpeg (http://www.ffmpeg.org)."Plugin zum Erzeugen Verschiedener Audio/Video Formate mit ffmpeg (http://www.ffmpeg.org)."Plugin zum Erzeugen Verschiedener Videoformate mit ffmpeg (http://www.ffmpeg.org).VorhersagemethodeQP RDQpel BewegungsabschätzungQualitätQualität (10: Beste)Qualität für VBR Modus\n 10: Beste (größte Datei)\n 0: Schlechteste (kleinste Datei)Qualität für VBR Modus\n 63: Beste (größte Datei)\n 0: Schlechteste (kleinste Datei)QuantisierungQuantisierungsmatrizenQuantisiererQuantizer UnschärfeQuantizer KompressionQuantizer Faktor zwischen B-Frames und nicht B-FramesQuantizer Faktor zwischen P-frames und I-frames. Wenn > 0 dann wird der letzte P Frame Quantizer verwendet (q= Letzterp_q*Faktor+Versatz). Wenn < 0 dann wird normale Ratensteuerung verwendet (q= -Normal_q*Faktor+Versatz)Quantizer für Codieren mit fester Qualität. Niedriger heißt besser, 1 ist nicht empfohlen.Quantizer RauschformungQuantizer Faktor zwischen P-frames und I-frames. Wenn > 0 dann wird der letzte P Frame Quantizer verwendet (q= Letzterp_q*Faktor+Versatz). Wenn < 0 dann wird normale Ratensteuerung verwendet (q= -Normal_q*Faktor+Versatz)Quantizer Versatz zwischen P-Frames und I-FramesQuantisierqualitätRC Puffer AggressivitätRC PuffergrößeRatensteuerungRatenverzerrungReal Video 1Entferne %sSAD: Summe der absoluten Differenzen SSE: Summe der quadrierten errors SATD: Summe der absoluten Hadamard transformierten Differenzen DCT: Summe der absoluten DCT transformierten Differenzen PSNR: Summe der quadrierten Quantisierungsfehler (niedrige Qualität) BIT: Zahl der für einen Block benötigten Bits RD: Ratenverzerrung optimal (langsam) ZERO: 0 VSAD: Summe der absoluten vertikalen Differenzen VSSE: Summe der quadrierten vertikalen Differenzen NSSE: Rauscherhaltende Summe der quadrierten DifferenzenSVCDSamplerate %d wird nicht unterstützt, wähle %dFaktor für SzenenwechselSchwellwert für SzenenwechselWähle Farbmodus der Datei. Automatisch heißt, den Farbmodus, der dem Quellformat am ähnlichsten ist, zu verwenden.Wählt den MPEG-Modus. Beachte: Für VCD, SVCD und DVD MUSST Du gültige Bildgrößen liefernSchwellwert für die Beseitigung einzelner Chrominanz Koeffizienten. Bei negativen Werten werden auch DC Koeffizienten miteinbezogen. Die JVT Empfehlung ist 7Schwellwert für die Beseitigung einzelner Luminanz Koeffizienten. Bei negativen Werten werden auch DC Koeffizienten miteinbezogen. Die JVT Empfehlung ist -4Maskierung Regionaler KomplexitätenWähle konstante oder variable Bitrate. Automatisch wählt CBR für MPEG-1 und VBR für MPEG-2. Für Formate, die eine feste Bitrate benötigen, wird diese Option ignoriert.Wähle die Zahl der B-Frames zwischen 2 P/I frames. Mehr B-Frames bremsen den Kodierprozess und erhöhen den Speicherbedarf, können aber bessere Qualität bringen. Für VCD wird diese Option ignoriert, da der VCD Standard 2 B-Frames fordert, egal ob Du willst, oder nicht.Speex EnkoderSpeexmodusKonformität mit StandardsStereoStereo ModusStereo: Völlig unabhängige Kanäle\n Joing Stereo: Verbessere Qualität (spare Bits) durch Ausnutzung von Ähnlichkeiten der Kanäle\n Automatisch (empfohlen): Wähle Modus aufgrund der Qualität oder der BitrateStrenge Einhaltung der GOP GrößeSubpel ME QualitätVerfeinerungsqualität für Subpel Motion Estimation (für qpel). Höhere Werte bedeuten bessere Qualität aber langsameres Codieren.Subpixel ME VergleichsfunktionVergleichsfunktion für Subpixel-Bewegungsausgleich Zielbitrate (kbps)Maskierung Temporaler KomplexitätenTheora KodiererTheora Kodierer hat kein Paket erzeugtSchwellwert für für Erkennung von Szenenwechseln. Negative Werte bedeuten eine höhere Empfindlichkeit (mehr Keyframes)UTF-16 BEUTF-16 LEUTF-8UltrabreitbandUnbekanntes MPEG FormatUnbegrenzter BewegungsvektorBenutze 1/4 Pixel Bewegungsausgleich. Warning: QPEL wird nicht von allen Dekodern unterstützt.Verwende alternative ScantabelleVerwende VergleichsfunktionVerwende konstante BitrateVerwende DatenpartitionierungVerwende Datenpartitionierung für erhöhte Robustheit wenn das Video über unzuverlässige Kanäle übertragen WirdVerwende Codieren mit fester QualitätVerwende festen QuantizerVerwende Globale Motion CompensationVerwende nur bitgenaue SachenVerwende nur bitgenaue Sachen (ausser (i)dct)Verwende qpel MCVerwende Ratenverzerr Optimierung für cbpBenutze Ratenverzerrungs-Optimierung für qp AuswahlBenutze zeitliche RauschformungVerwende Trellis QuantisierungVerwende Trellis Quantisierung (verbessert Qualität)Verwende SprachaktivitätserkennungBenutzeroptionenVBRVBR (Bitrate)VBR QualitätVBR Qualität (10: Beste)VBR Qualitätsstufe 0: Beste, 9: SchlechtesteVBR/ABR OptionenVCDVCD-kompatibelVariabelVariable BitrateVideo Bitrate in kbps. Für VBR ist dies die maximale Bitrate. Für Formate, die eine feste Bitrate benötigen, wird diese Option ignoriert.Vorbis KodiererWMV 1WMV 2Warnung: GMC wird nicht von allen Decodern unterstütztBei Verwendung von Maskierung, versuche per Macroblock Quantizer so abzustimmen dass der gewünschte Durchschnitt erhalten bleibt.BreitbandWindows Media Audio 1Windows Media Audio 2Schreibe ID3V1.1 KennungSchreibe ID3V2 KennungSchreibe Vorbis-Kommentar mit Metadaten in die DateiSchreibe SuchtabelleSchreibe Suchtabelle (dringend empfohlen)Schreibe Vorbis-KommentarSchreiben des Paketes fehlgeschlagenSchreiben des Theorapaketes fehlgeschlagenSchreiben in Datei fehlgeschlagen: %sX1NullalawfaacEncSetConfiguration fehlgeschlagenlame_init_params fehlgeschlagenlame_set_VBR fehlgeschlagenlame_set_VBR_max_bitrate_kbps fehlgeschlagenlame_set_VBR_mean_bitrate_kbps fehlgeschlagenlame_set_VBR_min_bitrate_kbps fehlgeschlagenlame_set_VBR_q fehlgeschlagenlame_set_bWriteVbrTag fehlgeschlagenlame_set_brate fehlgeschlagenlame_set_in_samplerate fehlgeschlagenlame_set_mode fehlgeschlagenlame_set_num_channels fehlgeschlagenlame_set_quality fehlgeschlagenlame_set_scale fehlgeschlagenmulawtmpegencyuv4mpeg2 Kodiererbplaum-gmerlin-encoders-172394d/po/de.po000066400000000000000000001636441513225514200200700ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Members of the gmerlin project # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: gmerlin-general@lists.sourceforge.net\n" "POT-Creation-Date: 2011-02-12 00:22+0100\n" "PO-Revision-Date: 2007-11-18 22:25+0100\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: plugins/faac/e_faac.c:91 msgid "Basic options" msgstr "Grundlegenden Optionen" #: plugins/faac/e_faac.c:96 msgid "Object type" msgstr "Objekttyp" #: plugins/faac/e_faac.c:105 msgid "MPEG-2 Main profile" msgstr "MPEG-2 Main profile" #: plugins/faac/e_faac.c:106 msgid "MPEG-2 Low Complexity profile (LC)" msgstr "MPEG-2 Low Complexity profile (LC)" #: plugins/faac/e_faac.c:107 msgid "MPEG-4 Main profile" msgstr "MPEG-4 Main profile" #: plugins/faac/e_faac.c:108 msgid "MPEG-4 Low Complexity profile (LC)" msgstr "MPEG-4 Low Complexity profile (LC)" #: plugins/faac/e_faac.c:109 msgid "MPEG-4 Long Term Prediction (LTP)" msgstr "MPEG-4 Long Term Prediction (LTP)" #: plugins/faac/e_faac.c:114 plugins/lame/e_lame.c:271 plugins/ogg/speex.c:180 #: plugins/yuv4mpeg/mpv_common.c:81 plugins/yuv4mpeg/mpa_common.c:42 msgid "Bitrate (kbps)" msgstr "Bitrate (kbps)" #: plugins/faac/e_faac.c:118 msgid "Average bitrate (0: VBR based on quality)" msgstr "Durchschnittliche Bitrate (0: Qualitätsbasierte Variable Bitrate)" #: plugins/faac/e_faac.c:122 msgid "Quality" msgstr "Qualität" #: plugins/faac/e_faac.c:127 msgid "Quantizer quality" msgstr "Quantisierqualität" #: plugins/faac/e_faac.c:131 msgid "Advanced options" msgstr "Fortgeschrittene Optionen" #: plugins/faac/e_faac.c:136 msgid "Block types" msgstr "Blocktypen" #: plugins/faac/e_faac.c:143 msgid "Both" msgstr "Beide" #: plugins/faac/e_faac.c:144 msgid "No short" msgstr "Keine kurzen" #: plugins/faac/e_faac.c:145 msgid "No long" msgstr "Keine langen" #: plugins/faac/e_faac.c:151 msgid "Use temporal noise shaping" msgstr "Benutze zeitliche Rauschformung" #: plugins/faac/e_faac.c:156 msgid "Don't use mid/side coding" msgstr "Benutze keine Mid/Side Kodierung" #: plugins/faac/e_faac.c:181 msgid "faacEncSetConfiguration failed" msgstr "faacEncSetConfiguration fehlgeschlagen" #: plugins/faac/e_faac.c:250 plugins/lame/e_lame.c:475 msgid "Write ID3V1.1 tag" msgstr "Schreibe ID3V1.1 Kennung" #: plugins/faac/e_faac.c:256 plugins/lame/e_lame.c:481 msgid "Write ID3V2 tag" msgstr "Schreibe ID3V2 Kennung" #: plugins/faac/e_faac.c:262 plugins/lame/e_lame.c:487 msgid "ID3V2 Encoding" msgstr "ID3V2 Zeichentabelle" #: plugins/faac/e_faac.c:267 plugins/lame/e_lame.c:492 msgid "ISO-8859-1" msgstr "ISO-8859-1" #: plugins/faac/e_faac.c:267 plugins/lame/e_lame.c:492 msgid "UTF-16 LE" msgstr "UTF-16 LE" #: plugins/faac/e_faac.c:268 plugins/lame/e_lame.c:493 msgid "UTF-16 BE" msgstr "UTF-16 BE" #: plugins/faac/e_faac.c:268 plugins/lame/e_lame.c:493 msgid "UTF-8" msgstr "UTF-8" #: plugins/faac/e_faac.c:313 plugins/lame/e_lame.c:540 #, c-format msgid "Cannot open %s: %s" msgstr "Kann %s nicht öffnen: %s" #: plugins/faac/e_faac.c:541 msgid "Faac encoder" msgstr "Faac encoder" #: plugins/faac/e_faac.c:542 msgid "" "Plugin for encoding AAC streams (with ADTS headers). Based on faac (http://" "faac.sourceforge.net)." msgstr "" "Plugin zum Erzeugen von AAC Dateien (mit ADTS Köpfen). Verwendet faac " "(http://faac.sourceforge.net)" #: plugins/lame/e_lame.c:220 msgid "General" msgstr "Allgemein" #: plugins/lame/e_lame.c:225 plugins/ogg/vorbis.c:89 msgid "Bitrate mode" msgstr "Bitratenmodus" #: plugins/lame/e_lame.c:232 plugins/yuv4mpeg/mpv_common.c:74 msgid "Constant" msgstr "Konstant" #: plugins/lame/e_lame.c:233 msgid "Average" msgstr "Durchschnittlich" #: plugins/lame/e_lame.c:234 plugins/yuv4mpeg/mpv_common.c:74 msgid "Variable" msgstr "Variabel" #: plugins/lame/e_lame.c:239 msgid "Stereo mode" msgstr "Stereo Modus" #: plugins/lame/e_lame.c:246 msgid "Stereo" msgstr "Stereo" #: plugins/lame/e_lame.c:247 msgid "Joint stereo" msgstr "Joint stereo" #: plugins/lame/e_lame.c:248 plugins/ogg/speex.c:150 #: plugins/yuv4mpeg/e_yuv4mpeg.c:154 plugins/yuv4mpeg/mpv_common.c:74 msgid "Auto" msgstr "Automatisch" #: plugins/lame/e_lame.c:250 msgid "" "Stereo: Completely independent channels\n" "Joint stereo: Improve quality (save bits) by using similarities of the " "channels\n" "Auto (recommended): Select one of the above depending on quality or bitrate " "setting" msgstr "" "Stereo: Völlig unabhängige Kanäle\\n\n" "Joing Stereo: Verbessere Qualität (spare Bits) durch Ausnutzung von " "Ähnlichkeiten der Kanäle\\n\n" "Automatisch (empfohlen): Wähle Modus aufgrund der Qualität oder der Bitrate" #: plugins/lame/e_lame.c:256 plugins/ogg/theora.c:162 msgid "Encoding speed" msgstr "Kodiergeschwindigkeit" #: plugins/lame/e_lame.c:261 msgid "" "0: Slowest encoding, best quality\n" "9: Fastest encoding, worst quality" msgstr "" "0: Langsamstes Encodieren, Beste Qualität\n" "9: Schnellstes Encodieren, Schlechteste Qualität" #: plugins/lame/e_lame.c:266 msgid "CBR options" msgstr "CBR Optionen" #: plugins/lame/e_lame.c:276 msgid "" "Bitrate in kbps. If your selection is no valid mp3 bitrate, we'll choose the " "closest value." msgstr "" "Bitrate in kbps. Wenn Deine Auswahl keine gültige mp3-Bitrate ist, nehmen " "wir die nächstliegende." #: plugins/lame/e_lame.c:281 msgid "VBR/ABR options" msgstr "VBR/ABR Optionen" #: plugins/lame/e_lame.c:286 msgid "VBR Quality" msgstr "VBR Qualität" #: plugins/lame/e_lame.c:291 msgid "VBR Quality level. 0: best, 9: worst" msgstr "VBR Qualitätsstufe 0: Beste, 9: Schlechteste" #: plugins/lame/e_lame.c:295 msgid "ABR overall bitrate (kbps)" msgstr "ABR Gesamtbitrate (kbps)" #: plugins/lame/e_lame.c:300 msgid "Average bitrate for ABR mode" msgstr "Durchschnittliche Bitrate for ABR modus" #: plugins/lame/e_lame.c:304 msgid "ABR min bitrate (kbps)" msgstr "ABR Mindestbitrate (kbps)" #: plugins/lame/e_lame.c:309 msgid "" "Minimum bitrate for ABR mode. 0 means let lame decide. If your selection is " "no valid mp3 bitrate, we'll choose the closest value." msgstr "" "Minimale Bitrate für ABR Modus. 0 heißt, lame darf entscheiden.\n" "Wenn Deine Auswahl keine gültige mp3-Bitrate ist, nehmen\n" "wir die nächstliegende." #: plugins/lame/e_lame.c:314 msgid "ABR max bitrate (kbps)" msgstr "ABR Maximalbitrate (kbps)" #: plugins/lame/e_lame.c:319 msgid "" "Maximum bitrate for ABR mode. 0 means let lame decide. If your selection is " "no valid mp3 bitrate, we'll choose the closest value." msgstr "" "Maximale Bitrate für ABR Modus. 0 heißt, lame darf entscheiden.\n" "Wenn Deine Auswahl keine gültige mp3-Bitrate ist, nehmen\n" "wir die nächstliegende." #: plugins/lame/e_lame.c:349 plugins/lame/e_lame.c:382 msgid "lame_set_VBR_q failed" msgstr "lame_set_VBR_q fehlgeschlagen" #: plugins/lame/e_lame.c:353 msgid "lame_set_VBR_mean_bitrate_kbps failed" msgstr "lame_set_VBR_mean_bitrate_kbps fehlgeschlagen" #: plugins/lame/e_lame.c:365 msgid "lame_set_VBR_min_bitrate_kbps failed" msgstr "lame_set_VBR_min_bitrate_kbps fehlgeschlagen" #: plugins/lame/e_lame.c:377 msgid "lame_set_VBR_max_bitrate_kbps failed" msgstr "lame_set_VBR_max_bitrate_kbps fehlgeschlagen" #: plugins/lame/e_lame.c:388 msgid "lame_set_brate failed" msgstr "lame_set_brate fehlgeschlagen" #: plugins/lame/e_lame.c:395 msgid "lame_init_params failed" msgstr "lame_init_params fehlgeschlagen" #: plugins/lame/e_lame.c:415 msgid "lame_set_VBR failed" msgstr "lame_set_VBR fehlgeschlagen" #: plugins/lame/e_lame.c:418 msgid "lame_set_bWriteVbrTag failed" msgstr "lame_set_bWriteVbrTag fehlgeschlagen" #: plugins/lame/e_lame.c:438 msgid "lame_set_mode failed" msgstr "lame_set_mode fehlgeschlagen" #: plugins/lame/e_lame.c:444 msgid "lame_set_quality failed" msgstr "lame_set_quality fehlgeschlagen" #: plugins/lame/e_lame.c:607 msgid "lame_set_in_samplerate failed" msgstr "lame_set_in_samplerate fehlgeschlagen" #: plugins/lame/e_lame.c:609 msgid "lame_set_num_channels failed" msgstr "lame_set_num_channels fehlgeschlagen" #: plugins/lame/e_lame.c:612 msgid "lame_set_scale failed" msgstr "lame_set_scale fehlgeschlagen" #: plugins/lame/e_lame.c:771 msgid "Lame mp3 encoder" msgstr "Lame mp3 Codierer" #: plugins/lame/e_lame.c:772 msgid "" "Encoder for mp3 files. Based on lame (http://www.mp3dev.org). Supports CBR, " "ABR and VBR as well as ID3V1 and ID3V2 tags." msgstr "" "Enkoder für mp3-Dateien. Verwendet lame (http://www.mp3dev.org). Unterstützt " "CBR, ABR und VBR sowie ID3V1 und ID2V2 Kennungen" #: plugins/ogg/flac.c:112 msgid "Got no Flac ID page" msgstr "Bekam keine Flac-Kennungsseite" #: plugins/ogg/flac.c:117 plugins/ogg/flac.c:159 #, c-format msgid "Writing to file failed: %s" msgstr "Schreiben in Datei fehlgeschlagen: %s" #: plugins/ogg/flac.c:251 msgid "FLAC__stream_encoder_init failed" msgstr "FLAC__stream_encoder_init fehlgeschlagen" #: plugins/ogg/flac.c:262 msgid "FLAC__stream_encoder_init_stream failed" msgstr "FLAC__stream_encoder_init_stream fehlgeschlagen" #: plugins/ogg/flac.c:333 plugins/flac/e_flac.c:481 msgid "Flac encoder" msgstr "Flac Enkoder" #: plugins/ogg/e_speex.c:68 plugins/ogg/speex.c:583 msgid "Speex encoder" msgstr "Speex Enkoder" #: plugins/ogg/e_speex.c:69 msgid "Encoder for Speex files" msgstr "Enkoder für Speexdateien" #: plugins/ogg/speex.c:146 msgid "Speex mode" msgstr "Speexmodus" #: plugins/ogg/speex.c:150 msgid "Narrowband" msgstr "Schmalband" #: plugins/ogg/speex.c:150 msgid "Wideband" msgstr "Breitband" #: plugins/ogg/speex.c:151 msgid "Ultra-wideband" msgstr "Ultrabreitband" #: plugins/ogg/speex.c:152 msgid "" "Encoding mode. If you select Auto, the mode will be taken from the " "samplerate." msgstr "" "Enkodiermodus. Wenn Du Automatisch wählst, wird der Modus aus der " "Abtastfrequenz ermittelt." #: plugins/ogg/speex.c:156 msgid "Quality (10: best)" msgstr "Qualität (10: Beste)" #: plugins/ogg/speex.c:164 msgid "Encoding complexity" msgstr "Enkodierkomplexität" #: plugins/ogg/speex.c:172 msgid "Frames per Ogg packet" msgstr "Rahmen pro Ogg-Paket" #: plugins/ogg/speex.c:185 msgid "" "Bitrate (in kbps). Set to 0 for seleting the standard bitrates for the " "encoding mode." msgstr "" "Bitrate (in kbps). Wähle 0 um die Standardbitrate für den Enkodiermodus zu " "nehmen." #: plugins/ogg/speex.c:189 msgid "Variable bitrate" msgstr "Variable Bitrate" #: plugins/ogg/speex.c:194 msgid "Average bitrate (kbps)" msgstr "Durchschnittliche Bitrate (kbps)" #: plugins/ogg/speex.c:199 msgid "Average bitrate (in kbps). Set to 0 for disabling ABR." msgstr "Durchschnittliche Bitrate (in kbps). Wähle 0 um ABR abzuschalten." #: plugins/ogg/speex.c:203 msgid "Use voice activity detection" msgstr "Verwende Sprachaktivitätserkennung" #: plugins/ogg/speex.c:208 msgid "Enable file-based discontinuous transmission" msgstr "Aktiviere Dateibasierte, nichtkontinuierliche Übertragung" #: plugins/ogg/speex.c:434 msgid "Got no Speex ID page" msgstr "Bekam keine Speex Kennungsseite" #: plugins/ogg/e_theora.c:167 plugins/ogg/theora.c:846 msgid "Theora encoder" msgstr "Theora Kodierer" #: plugins/ogg/e_theora.c:168 msgid "Encoder for Theora files. Audio can be Vorbis, Flac or Speex." msgstr "Kodierer für Theoradateien. Audio kann Vorbis, Flac oder Speex sein." #: plugins/ogg/e_flacogg.c:68 msgid "Flac in Ogg encoder" msgstr "Flac in Ogg Kodierer" #: plugins/ogg/e_flacogg.c:69 msgid "" "Encoder for flac streams in Ogg containers. Based on libflac (http://flac." "sourceforge.net)" msgstr "" "Kodierer für Flac Audio in Oggdateien. Verwendet libflac (http://flac." "sourceforge.net)" #: plugins/ogg/b_ogg.c:167 msgid "Ogg Broadcaster" msgstr "" #: plugins/ogg/b_ogg.c:168 msgid "" "Broadcaster for Ogg streams using libshout. Supports vorbis, theora and " "speex." msgstr "" #: plugins/ogg/ogg_common.c:103 #, c-format msgid "Cannot open file %s: %s" msgstr "Kann Datei %s nicht öffnen: %s" #: plugins/ogg/ogg_common.c:413 plugins/ffmpeg/codecs.c:443 #: plugins/ffmpeg/codecs.c:453 msgid "Codec" msgstr "Codec" #: plugins/ogg/vorbis.c:93 msgid "VBR" msgstr "VBR" #: plugins/ogg/vorbis.c:93 msgid "VBR (bitrate)" msgstr "VBR (Bitrate)" #: plugins/ogg/vorbis.c:93 msgid "Managed" msgstr "Gesteuert" #: plugins/ogg/vorbis.c:94 msgid "" "Bitrate mode:\n" "VBR: You specify a quality and (optionally) a minimum and maximum bitrate\n" "VBR (bitrate): The specified nominal bitrate will be used for selecting the " "encoder mode.\n" "Managed: You specify a nominal bitrate and (optionally) a minimum and " "maximum bitrate\n" "VBR is recommended, managed bitrate might result in a worse quality" msgstr "" "Bitratenmodus:\\n\n" "VBR: Du wählst eine Qualität und (optional) eine minimale und maximale " "Bitrate\\n\n" "VBR (Bitrate): Die gewählte Bitrate wird verwendet um den Kdiermodus zu " "wählen.\\n\n" "Gesteuert: Du wählst eine nominelle und (optional) eine minimale und " "maximale Bitrate.\\n\n" "VBR ist empfohlen, kontrollierte Bitrate könnte Qualitätseinbußen bringen." #: plugins/ogg/vorbis.c:102 msgid "Nominal bitrate (kbps)" msgstr "Nominelle Bitrate (kbps)" #: plugins/ogg/vorbis.c:107 msgid "Nominal bitrate (in kbps) for managed mode" msgstr "Nominelle Bitrate (in kbps) für gesteuerten Modus" #: plugins/ogg/vorbis.c:111 msgid "VBR Quality (10: best)" msgstr "VBR Qualität (10: Beste)" #: plugins/ogg/vorbis.c:117 msgid "" "Quality for VBR mode\n" "10: best (largest output file)\n" "0: worst (smallest output file)" msgstr "" "Qualität für VBR Modus\\n\n" "10: Beste (größte Datei)\\n\n" "0: Schlechteste (kleinste Datei)" #: plugins/ogg/vorbis.c:123 plugins/ffmpeg/params.h:237 msgid "Minimum bitrate (kbps)" msgstr "Minimale Bitrate (kbps)" #: plugins/ogg/vorbis.c:128 msgid "" "Optional minimum bitrate (in kbps)\n" "0 = unspecified" msgstr "Optionale minimale Bitrate (0 = beliebig)" #: plugins/ogg/vorbis.c:133 plugins/ffmpeg/params.h:247 msgid "Maximum bitrate (kbps)" msgstr "Maximale Bitrate (kbps)" #: plugins/ogg/vorbis.c:138 msgid "" "Optional maximum bitrate (in kbps)\n" "0 = unspecified" msgstr "Optionale maximale Bitrate (0 = beliebig)" #: plugins/ogg/vorbis.c:275 plugins/ogg/vorbis.c:389 msgid "Got no Vorbis ID page" msgstr "Bekam keine Vorbis-Kennungsseite" #: plugins/ogg/vorbis.c:569 plugins/ogg/e_vorbis.c:88 msgid "Vorbis encoder" msgstr "Vorbis Kodierer" #: plugins/ogg/theora.c:105 msgid "Use constant bitrate" msgstr "Verwende konstante Bitrate" #: plugins/ogg/theora.c:107 msgid "" "For constant bitrate, choose a target bitrate. For variable bitrate, choose " "a nominal quality." msgstr "" "Für constante Bitrate, wähle eine Zielbitrate. Für variable Bitrate, wähle " "eine nominelle Qualität" #: plugins/ogg/theora.c:111 msgid "Target bitrate (kbps)" msgstr "Zielbitrate (kbps)" #: plugins/ogg/theora.c:119 msgid "Nominal quality" msgstr "Nominelle Qualität" #: plugins/ogg/theora.c:125 msgid "" "Quality for VBR mode\n" "63: best (largest output file)\n" "0: worst (smallest output file)" msgstr "" "Qualität für VBR Modus\\n\n" "63: Beste (größte Datei)\\n\n" "0: Schlechteste (kleinste Datei)" #: plugins/ogg/theora.c:131 #, fuzzy msgid "Maximum keyframe interval" msgstr "Maximale Qunatizer Skalierung" #: plugins/ogg/theora.c:140 msgid "Enable frame dropping" msgstr "" #: plugins/ogg/theora.c:143 msgid "" "Drop frames to keep within bitrate buffer constraints. This can have a " "severe impact on quality, but is the only way to ensure that bitrate targets " "are met at low rates during sudden bursts of activity." msgstr "" #: plugins/ogg/theora.c:147 msgid "Don't bank excess bits for later use" msgstr "" #: plugins/ogg/theora.c:150 msgid "" "Ignore bitrate buffer overflows. If the encoder uses so few bits that the " "reservoir of available bits overflows, ignore the excess. The encoder will " "not try to use these extra bits in future frames. At high rates this may " "cause the result to be undersized, but allows a client to play the stream " "using a finite buffer; it should normally be enabled." msgstr "" #: plugins/ogg/theora.c:154 msgid "Don't try to make up shortfalls later" msgstr "" #: plugins/ogg/theora.c:157 msgid "" "Ignore bitrate buffer underflows. If the encoder uses so many bits that the " "reservoir of available bits underflows, ignore the deficit. The encoder will " "not try to make up these extra bits in future frames. At low rates this may " "cause the result to be oversized; it should normally be disabled." msgstr "" #: plugins/ogg/theora.c:168 msgid "" "Higher speed levels favor quicker encoding over better quality per bit. " "Depending on the encoding mode, and the internal algorithms used, quality " "may actually improve, but in this case bitrate will also likely increase. In " "any case, overall rate/distortion performance will probably decrease." msgstr "" #: plugins/ogg/theora.c:367 #, fuzzy msgid "Got no theora ID page" msgstr "Bekam keine Theora-Kennungsseite" #: plugins/ogg/theora.c:480 #, fuzzy msgid "th_encode_alloc failed" msgstr "theora_encode_header fehlgeschlagen" #: plugins/ogg/theora.c:530 msgid "Got no Theora ID page" msgstr "Bekam keine Theora-Kennungsseite" #: plugins/ogg/theora.c:539 #, c-format msgid "Got %d header packets instead of 3" msgstr "" #: plugins/ogg/theora.c:574 plugins/ogg/theora.c:595 #, fuzzy, c-format msgid "couldn't open stats file %s" msgstr "Kann Datei %s nicht öffnen: %s" #: plugins/ogg/theora.c:584 #, fuzzy msgid "getting 2 pass header failed" msgstr "Schreiben des Kopfes fehlgeschlagen" #: plugins/ogg/theora.c:607 msgid "couldn't read stats data" msgstr "" #: plugins/ogg/theora.c:642 plugins/ogg/theora.c:782 msgid "Theora encoder produced no packet" msgstr "Theora Kodierer hat kein Paket erzeugt" #: plugins/ogg/theora.c:655 plugins/ogg/theora.c:765 msgid "Writing theora packet failed" msgstr "Schreiben des Theorapaketes fehlgeschlagen" #: plugins/ogg/theora.c:684 msgid "passing 2 pass data failed" msgstr "" #: plugins/ogg/theora.c:710 plugins/ogg/theora.c:809 #, fuzzy msgid "getting 2 pass data failed" msgstr "Schreiben des Paketes fehlgeschlagen" #: plugins/ogg/theora.c:737 msgid "First packet isn't a keyframe" msgstr "" #: plugins/ogg/theora.c:791 plugins/ogg/theora.c:822 msgid "Writing packet failed" msgstr "Schreiben des Paketes fehlgeschlagen" #: plugins/ogg/e_vorbis.c:89 msgid "Encoder for Vorbis files" msgstr "Kodierer für Vorbisdateien" #: plugins/flac/e_flac.c:83 msgid "Write vorbis comment" msgstr "Schreibe Vorbis-Kommentar" #: plugins/flac/e_flac.c:86 msgid "Write Vorbis comment containing metadata to the file" msgstr "Schreibe Vorbis-Kommentar mit Metadaten in die Datei" #: plugins/flac/e_flac.c:90 msgid "Write seek table" msgstr "Schreibe Suchtabelle" #: plugins/flac/e_flac.c:93 msgid "Write seektable (strongly recommended)" msgstr "Schreibe Suchtabelle (dringend empfohlen)" #: plugins/flac/e_flac.c:97 msgid "Entries in the seektable" msgstr "Einträge in der Suchtabelle" #: plugins/flac/e_flac.c:102 msgid "" "Maximum number of entries in the seek table. Default is 100, larger numbers " "result in shorter seeking times but also in larger files." msgstr "" "Maximale Zahl der Einträge in der Suchtabelle. Voreinstellung ist 100, " "größere Zahlen resultieren in schnellerem Suchen aber auch in größeren " "Dateien." #: plugins/flac/e_flac.c:214 #, c-format msgid "Initializing encoder failed: %s" msgstr "Initialisierung des Kodierers fehlgeschlagen: %s" #: plugins/flac/e_flac.c:217 msgid "Initializing encoder failed" msgstr "Initialisierung des Kodierers fehlgeschlagen" #: plugins/flac/e_flac.c:482 msgid "Encoder for flac files. Based on libflac (http://flac.sourceforge.net)" msgstr "" "Kodierer für Flacdateien. Verwendet libflac (http://flac.sourceforge.net)" #: plugins/yuv4mpeg/e_yuv4mpeg.c:141 msgid "Chroma mode" msgstr "Chroma modus" #: plugins/yuv4mpeg/e_yuv4mpeg.c:155 msgid "4:2:0 (MPEG-1/JPEG)" msgstr "4:2:0 (MPEG-1/JPEG)" #: plugins/yuv4mpeg/e_yuv4mpeg.c:156 msgid "4:2:0 (MPEG-2)" msgstr "4:2:0 (MPEG-2)" #: plugins/yuv4mpeg/e_yuv4mpeg.c:157 msgid "4:2:0 (PAL DV)" msgstr "4:2:0 (PAL DV)" #: plugins/yuv4mpeg/e_yuv4mpeg.c:158 msgid "4:4:4" msgstr "4:4:4" #: plugins/yuv4mpeg/e_yuv4mpeg.c:159 msgid "4:2:2" msgstr "4:2:2" #: plugins/yuv4mpeg/e_yuv4mpeg.c:160 msgid "4:1:1" msgstr "4:1:1" #: plugins/yuv4mpeg/e_yuv4mpeg.c:161 msgid "Greyscale" msgstr "Graustufen" #: plugins/yuv4mpeg/e_yuv4mpeg.c:162 msgid "4:4:4:4 (YUVA)" msgstr "4:4:4:4 (YUVA)" #: plugins/yuv4mpeg/e_yuv4mpeg.c:164 msgid "" "Set the chroma mode of the output file. Auto means to take the format most " "similar to the source." msgstr "" "Wähle Farbmodus der Datei. Automatisch heißt, den Farbmodus, der dem " "Quellformat am ähnlichsten ist, zu verwenden." #: plugins/yuv4mpeg/e_yuv4mpeg.c:254 msgid "yuv4mpeg2 encoder" msgstr "yuv4mpeg2 Kodierer" #: plugins/yuv4mpeg/e_yuv4mpeg.c:255 msgid "" "Encoder for yuv4mpeg files. Based on mjpegtools (http://mjpeg.sourceforge." "net)." msgstr "" "Kodierer für yuv4mpeg Dateien. Verwendet mjpegtools (http://mjpeg." "sourceforge.net)" #: plugins/yuv4mpeg/mpv_common.c:58 plugins/yuv4mpeg/e_mpeg.c:666 #: plugins/ffmpeg/ffmpeg_common.c:43 msgid "Format" msgstr "Format" #: plugins/yuv4mpeg/mpv_common.c:62 plugins/yuv4mpeg/e_mpeg.c:670 msgid "MPEG-1 (generic)" msgstr "MPEG-1 (allgemein)" #: plugins/yuv4mpeg/mpv_common.c:62 plugins/yuv4mpeg/e_mpeg.c:671 msgid "MPEG-2 (generic)" msgstr "MPEG-2 (allgemein)" #: plugins/yuv4mpeg/mpv_common.c:63 msgid "VCD" msgstr "VCD" #: plugins/yuv4mpeg/mpv_common.c:63 msgid "SVCD" msgstr "SVCD" #: plugins/yuv4mpeg/mpv_common.c:63 msgid "DVD (for dvdauthor)" msgstr "DVD (für dvdauthor)" #: plugins/yuv4mpeg/mpv_common.c:65 msgid "" "Sets the MPEG flavour. Note, that for VCD, SVCD and DVD, you MUST provide " "valid frame sizes" msgstr "" "Wählt den MPEG-Modus. Beachte: Für VCD, SVCD und DVD MUSST Du gültige " "Bildgrößen liefern" #: plugins/yuv4mpeg/mpv_common.c:70 msgid "Bitrate Mode" msgstr "Bitratenmodus" #: plugins/yuv4mpeg/mpv_common.c:75 msgid "" "Specify constant or variable bitrate. For \"Auto\", constant bitrate will be " "used for MPEG-1, variable bitrate will be used for MPEG-2. For formats, " "which require CBR, this option is ignored" msgstr "" "Wähle konstante oder variable Bitrate. Automatisch wählt CBR für MPEG-1 und " "VBR für MPEG-2. Für Formate, die eine feste Bitrate benötigen, wird diese " "Option ignoriert." #: plugins/yuv4mpeg/mpv_common.c:86 msgid "" "Video bitrate in kbps. For VBR, it's the maximum bitrate. If the format " "requires a fixed bitrate (e.g. VCD) this option is ignored" msgstr "" "Video Bitrate in kbps. Für VBR ist dies die maximale Bitrate. Für Formate, " "die eine feste Bitrate benötigen, wird diese Option ignoriert." #: plugins/yuv4mpeg/mpv_common.c:91 msgid "Quantization" msgstr "Quantisierung" #: plugins/yuv4mpeg/mpv_common.c:96 msgid "" "Minimum quantization for VBR. Lower numbers mean higher quality. For CBR, " "this option is ignored." msgstr "" "Minimaler Quantizierer für VBR. Niedrigere Werte bedeuten höhere Qualität. " "Für CBR wird diese Option ignoriert." #: plugins/yuv4mpeg/mpv_common.c:100 msgid "Quantization matrices" msgstr "Quantisierungsmatrizen" #: plugins/yuv4mpeg/mpv_common.c:105 msgid "Default" msgstr "Voreinstellung" #: plugins/yuv4mpeg/mpv_common.c:105 msgid "KVCD" msgstr "KVCD" #: plugins/yuv4mpeg/mpv_common.c:106 msgid "tmpegenc" msgstr "tmpegenc" #: plugins/yuv4mpeg/mpv_common.c:106 msgid "Hi-Res" msgstr "Hi-Res" #: plugins/yuv4mpeg/mpv_common.c:111 msgid "Number of B-Frames" msgstr "Anzahl der B-Frames" #: plugins/yuv4mpeg/mpv_common.c:116 msgid "" "Specify the number of B-frames between 2 P/I frames. More B-frames slow down " "encoding and increase memory usage, but might give better compression " "results. For VCD, this option is ignored, since the VCD standard requires 2 " "B-frames, no matter if you like them or not." msgstr "" "Wähle die Zahl der B-Frames zwischen 2 P/I frames. Mehr B-Frames bremsen den " "Kodierprozess und erhöhen den Speicherbedarf, können aber bessere Qualität " "bringen. Für VCD wird diese Option ignoriert, da der VCD Standard 2 B-Frames " "fordert, egal ob Du willst, oder nicht." #: plugins/yuv4mpeg/mpv_common.c:122 msgid "User options" msgstr "Benutzeroptionen" #: plugins/yuv4mpeg/mpv_common.c:124 msgid "" "Enter further commandline options for mpeg2enc here. Check the mpeg2enc " "manual page for details" msgstr "" "Gib zusätliche Komanndozeilenargumente für mpeg2enc an. Schau in die " "mpeg2enc Manual-Page für Einzelheiten." #: plugins/yuv4mpeg/mpv_common.c:194 msgid "Cannot find mpeg2enc executable" msgstr "Kann ausführbare Datei mpeg2enc nicht finden" #: plugins/yuv4mpeg/mpv_common.c:292 plugins/yuv4mpeg/mpv_common.c:316 msgid "Unknown MPEG format" msgstr "Unbekanntes MPEG Format" #: plugins/yuv4mpeg/mpv_common.c:311 msgid "Mixed interlacing not supported (yet)" msgstr "Gemischtes Interlacing wird nicht unterstützt (bis jetzt)" #: plugins/yuv4mpeg/mpv_common.c:434 #, fuzzy msgid "Inserting sequence end code failed" msgstr "Initialisierung des Kodierers fehlgeschlagen" #: plugins/yuv4mpeg/e_mpegaudio.c:129 plugins/yuv4mpeg/mpa_common.c:100 msgid "Cannot find mp2enc executable" msgstr "Kann ausführbare Datei mp2enc nicht finden" #: plugins/yuv4mpeg/e_mpegaudio.c:183 plugins/yuv4mpeg/e_mpegvideo.c:164 #: plugins/yuv4mpeg/e_mpeg.c:611 plugins/yuv4mpeg/e_mpeg.c:627 #, c-format msgid "Removing %s" msgstr "Entferne %s" #: plugins/yuv4mpeg/e_mpegaudio.c:204 msgid "MPEG-1 layer 1/2 audio encoder" msgstr "MPEG-1 layer 1/2 Audio Kodierer" #: plugins/yuv4mpeg/e_mpegaudio.c:205 msgid "" "Encoder for elementary MPEG-1 layer 1/2 audio streams. Based on mjpegtools " "(http://mjpeg.sourceforge.net)." msgstr "" "Kodierer für elementare MPEG-1 layer 1/2 Audiodateien. Verwendet mjpegtools " "(http://mjpeg.sourceforge.net)." #: plugins/yuv4mpeg/y4m_common.c:130 #, fuzzy, c-format msgid "Writing stream header failed: %s" msgstr "Schreiben des Kopfes fehlgeschlagen" #: plugins/yuv4mpeg/e_mpegvideo.c:198 msgid "MPEG-1/2 video encoder" msgstr "MPEG-1/2 Video Kodierer" #: plugins/yuv4mpeg/e_mpegvideo.c:199 msgid "" "Encoder for elementary MPEG-1/2 video streams. Based on mjpegtools (http://" "mjpeg.sourceforge.net)." msgstr "" "Kodierer für elementare MPEG-1/2 Videodateien. Verwendet mjpegtools (http://" "mjpeg.sourceforge.net)." #: plugins/yuv4mpeg/e_mpeg.c:120 msgid "Cannot find mpeg2enc exectuable" msgstr "Kann ausführbare Datei mpeg2enc nicht finden" #: plugins/yuv4mpeg/e_mpeg.c:125 msgid "Cannot find mp2enc exectuable" msgstr "Kann ausführbare Datei mp2enc nicht finden" #: plugins/yuv4mpeg/e_mpeg.c:130 plugins/yuv4mpeg/e_mpeg.c:535 msgid "Cannot find mplex exectuable" msgstr "Kann ausführbare Datei mplex nicht finden" #: plugins/yuv4mpeg/e_mpeg.c:547 #, c-format msgid "Video sync offset: %" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:670 msgid "MPEG-1 (VCD)" msgstr "MPEG-1 (VCD)" #: plugins/yuv4mpeg/e_mpeg.c:671 msgid "MPEG-2 (SVCD)" msgstr "MPEG-2 (SVCD)" #: plugins/yuv4mpeg/e_mpeg.c:672 msgid "DVD (NAV)" msgstr "DVD (NAV)" #: plugins/yuv4mpeg/e_mpeg.c:672 msgid "DVD" msgstr "DVD" #: plugins/yuv4mpeg/e_mpeg.c:673 msgid "" "Output format. Note that for some output formats (e.g. VCD), you MUST use " "proper settings for the audio and video streams also, since this isn't done " "automatically" msgstr "" "Ausgabeformat. Beachte, daß Du für einige Formate (z.B. VCD) die richtigen " "Einstellungen für die Audio- und Videokodierer machen mußt, da dies nicht " "automatisch geschieht." #: plugins/yuv4mpeg/e_mpeg.c:677 msgid "Directory for temporary files" msgstr "Verzeichnis für temporäre Dateien" #: plugins/yuv4mpeg/e_mpeg.c:679 msgid "Leave empty to use the same directory as the final output file" msgstr "" "Leerlassen um das gleiche Verzeichnis, wie die endgütlige Ausgabedatei, zu " "wählen" #: plugins/yuv4mpeg/e_mpeg.c:683 msgid "Additional stream 1" msgstr "Zusätzlicher Stream 1" #: plugins/yuv4mpeg/e_mpeg.c:685 plugins/yuv4mpeg/e_mpeg.c:692 #: plugins/yuv4mpeg/e_mpeg.c:699 msgid "" "Additional stream to multiplex into the final output file. Use this if you " "want e.g. create mp3 or AC3 audio with some other encoder" msgstr "" "Zusätzliche Streams zum Multiplexen in die endgültige Ausgabedatei. Benutze " "dies, wenn Du z.B. mp3 oder AC3 mit anderen Kodieren ergeugen willst." #: plugins/yuv4mpeg/e_mpeg.c:690 msgid "Additional stream 2" msgstr "Zusätzlicher Stream 2" #: plugins/yuv4mpeg/e_mpeg.c:697 msgid "Additional stream 3" msgstr "Zusätzlicher Stream 3" #: plugins/yuv4mpeg/e_mpeg.c:778 msgid "MPEG 1/2 program/system stream encoder" msgstr "MPEG 1/2 program/system stream Kodierer" #: plugins/yuv4mpeg/e_mpeg.c:779 msgid "" "Encoder for regular .mpg files as well as VCD and DVD streams. Based on " "mjpegtools (http://mjpeg.sourceforge.net)" msgstr "" "Kodierer für reguläre mpg-Dateien sowie VCD und DVD Dateien. Verwendet " "mjpegtools (http://mjpeg.sourceforge.net)" #: plugins/yuv4mpeg/mpa_common.c:50 msgid "Layer (1 or 2)" msgstr "Layer (1 oder 2)" #: plugins/yuv4mpeg/mpa_common.c:55 msgid "Audio layer" msgstr "Audio layer" #: plugins/yuv4mpeg/mpa_common.c:59 msgid "VCD Compatible" msgstr "VCD-kompatibel" #: plugins/yuv4mpeg/mpa_common.c:62 msgid "" "Make VCD compliant output. This forces layer II, 224 kbps and 44.1 KHz stereo" msgstr "" "Erzeuge VCD-kompatible Ausgabe. Dies erzwingt Layer II, 224 kbps und 44.1 " "KHz Stereo" #: plugins/yuv4mpeg/mpa_common.c:200 #, c-format msgid "Bitrate %d kbps unsupported, switching to %d kbps" msgstr "Bitrate %d kbps wird nicht unterstützt, wähle %d kbps" #: plugins/yuv4mpeg/mpa_common.c:256 #, c-format msgid "Samplerate %d unsupported, switching to %d" msgstr "Samplerate %d wird nicht unterstützt, wähle %d" #: plugins/ffmpeg/e_ffmpeg.c:161 msgid "FFmpeg audio/video encoder" msgstr "FFmpeg Audio/Video Kodierer" #: plugins/ffmpeg/e_ffmpeg.c:162 msgid "" "Plugin for encoding various audio/video formats with ffmpeg (http://www." "ffmpeg.org)." msgstr "" "\"Plugin zum Erzeugen Verschiedener Audio/Video Formate mit ffmpeg (http://" "www.ffmpeg.org).\"" #: plugins/ffmpeg/params.h:33 plugins/ffmpeg/params.h:42 #: plugins/ffmpeg/codecs.c:35 plugins/ffmpeg/codecs.c:46 #: plugins/ffmpeg/codecs.c:57 plugins/ffmpeg/codecs.c:68 msgid "Bit rate (kbps)" msgstr "Bitrate (kbps)" #: plugins/ffmpeg/params.h:51 msgid "Bitrate tolerance (kbps)" msgstr "Bitratentoleranz (kbps)" #: plugins/ffmpeg/params.h:54 msgid "" "Number of bits the bitstream is allowed to diverge from the reference. " "Unused for constant quantizer encoding" msgstr "" "Anzahl an Bits die der Bitstream von der Referenz abweichen darf. Nicht " "verwendet bei konstantem Quantizer Codieren." #: plugins/ffmpeg/params.h:62 msgid "Motion estimation method" msgstr "Art der Motion Estimation" # keine? #: plugins/ffmpeg/params.h:66 msgid "Zero" msgstr "Null" #: plugins/ffmpeg/params.h:66 msgid "Phods" msgstr "Phods" #: plugins/ffmpeg/params.h:66 msgid "Log" msgstr "Log" #: plugins/ffmpeg/params.h:67 msgid "X1" msgstr "X1" #: plugins/ffmpeg/params.h:67 msgid "Epzs" msgstr "Epzs" #: plugins/ffmpeg/params.h:67 msgid "Full" msgstr "Voll" #: plugins/ffmpeg/params.h:74 msgid "GOP size (0 = intra only)" msgstr "GOP größe (0 = nur intra)" #: plugins/ffmpeg/params.h:85 msgid "Quantizer compression" msgstr "Quantizer Kompression" #: plugins/ffmpeg/params.h:91 msgid "Amount of qscale change between easy & hard scenes" msgstr "Menge der qcale Änderung zwiischen leichten und schweren Szenen" #: plugins/ffmpeg/params.h:98 msgid "Quantizer blur" msgstr "Quantizer Unschärfe" #: plugins/ffmpeg/params.h:104 msgid "Amount of qscale smoothing over time" msgstr "Menge an qscale Glättung über die Zeit" #: plugins/ffmpeg/params.h:111 msgid "Minimum quantizer scale" msgstr "Minimale Quantizer Skalierung" #: plugins/ffmpeg/params.h:122 msgid "Maximum quantizer scale" msgstr "Maximale Qunatizer Skalierung" #: plugins/ffmpeg/params.h:133 msgid "Maximum quantizer difference" msgstr "Maximaler Quantizer Unterschied" #: plugins/ffmpeg/params.h:138 msgid "Maximum quantizer difference between frames" msgstr "Maximaler quantizer Unterschied zwischen Frames" #: plugins/ffmpeg/params.h:145 msgid "Max B-Frames" msgstr "Max B-Frames" #: plugins/ffmpeg/params.h:150 msgid "Maximum number of B-frames between non B-frames" msgstr "Maximale Anzahl an B-Frames zwischen nicht B-Frames" #: plugins/ffmpeg/params.h:157 msgid "B quantizer factor" msgstr "B Quantizer Faktor" #: plugins/ffmpeg/params.h:163 msgid "Quantizer factor between B-frames and non-B-frames" msgstr "Quantizer Faktor zwischen B-Frames und nicht B-Frames" #: plugins/ffmpeg/params.h:170 msgid "Avoid B-frames in high motion scenes" msgstr "Vermeide B-Frames in bewegungsintensiven Szenen" # vielleicht etwas zu weit hergeholt #: plugins/ffmpeg/params.h:178 msgid "Luma elimination threshold" msgstr "Luma Grenzwert" #: plugins/ffmpeg/params.h:183 msgid "" "Single coefficient elimination threshold for luminance. Negative values also " "consider dc coefficient. -4 is JVT recommendation" msgstr "" "Schwellwert für die Beseitigung einzelner Luminanz Koeffizienten. Bei " "negativen Werten werden auch DC Koeffizienten miteinbezogen. Die JVT " "Empfehlung ist -4" #: plugins/ffmpeg/params.h:191 msgid "Chroma elimination threshold" msgstr "Chroma Grenzwert" # Farbwerte # etwas zu wissenschaftlich #: plugins/ffmpeg/params.h:196 msgid "" "Single coefficient elimination threshold for chrominamce. Negative values " "also consider dc coefficient. 7 is JVT recommendation" msgstr "" "Schwellwert für die Beseitigung einzelner Chrominanz Koeffizienten. Bei " "negativen Werten werden auch DC Koeffizienten miteinbezogen. Die JVT " "Empfehlung ist 7" # Standartskonformität #: plugins/ffmpeg/params.h:204 msgid "Standards compliance" msgstr "Konformität mit Standards" #: plugins/ffmpeg/params.h:209 msgid "" "2: Strictly conform to a older more strict version of the spec or reference " "software\n" "1: Strictly conform to all the things in the spec no matter what " "consequences\n" "0: Default\n" "-1: Allow unofficial extensions\n" "-2: Allow non standarized experimental things" msgstr "" "2: Strenges Befolgen einer älteren, strengeren Version der Spezifikation " "oder Referenzsoftware\n" "1: Strenges Befolgen der Spezifikation oder Referenzsoftware ungeachtet der " "Konsequenzen\n" "0: Voreinstellung\n" "-1: Erlaube inoffizielle Erweiterungen\n" "-2: Erlaube nicht standardisierte und experimentelle Dinge" #: plugins/ffmpeg/params.h:222 msgid "B quantizer offset" msgstr "B Quantizer Versatz" #: plugins/ffmpeg/params.h:228 msgid "" "Quantizer offset between B-frames and non-B-frames\n" "if > 0 then the last p frame quantizer will be used (q= lastp_q*factor" "+offset)\n" "if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)" msgstr "" "Quantizer Faktor zwischen P-frames und I-frames.\n" "Wenn > 0 dann wird der letzte P Frame Quantizer verwendet (q= " "Letzterp_q*Faktor+Versatz).\n" "Wenn < 0 dann wird normale Ratensteuerung verwendet (q= -Normal_q*Faktor" "+Versatz)" #: plugins/ffmpeg/params.h:240 msgid "Minimum bitrate (0 means arbitrary)" msgstr "Minimale Bitrate (0 bedeutet beliebig)" #: plugins/ffmpeg/params.h:250 msgid "Maximum bitrate (0 means arbitrary)" msgstr "Maximale Bitrate (0 bedeutet beliebig)" #: plugins/ffmpeg/params.h:257 msgid "RC buffer size" msgstr "RC Puffergröße" #: plugins/ffmpeg/params.h:260 msgid "" "Decoder bitstream buffer size in kbits. When encoding with max and/or min " "bitrate, this must be specified." msgstr "" "Decoder Bitstream Puffergröße in kbits. Beim Codieren mit Max und/oder Min " "Bitrate muss dies angegeben werden." #: plugins/ffmpeg/params.h:268 msgid "RC buffer aggressivity" msgstr "RC Puffer Aggressivität" # ..ungs.. #: plugins/ffmpeg/params.h:280 msgid "I quantizer factor" msgstr "I Quantizer Faktor" #: plugins/ffmpeg/params.h:286 msgid "" "Quantizer factor between P-frames and I-frames.\n" "If > 0 then the last P frame quantizer will be used (q= lastp_q*factor" "+offset).\n" "If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)" msgstr "" "Quantizer Faktor zwischen P-frames und I-frames.\n" "Wenn > 0 dann wird der letzte P Frame Quantizer verwendet (q= " "Letzterp_q*Faktor+Versatz).\n" "Wenn < 0 dann wird normale Ratensteuerung verwendet (q= -Normal_q*Faktor" "+Versatz)" # ..ungs.. #: plugins/ffmpeg/params.h:295 msgid "I quantizer offset" msgstr "I Quantizer Versatz" #: plugins/ffmpeg/params.h:301 msgid "Quantizer offset between P-frames and I-frames" msgstr "Quantizer Versatz zwischen P-Frames und I-Frames" #: plugins/ffmpeg/params.h:308 msgid "Initial RC complexity" msgstr "Anfängliche RC Komplexität" #: plugins/ffmpeg/params.h:320 msgid "Luminance masking" msgstr "Helligkeitsmaskierung" #: plugins/ffmpeg/params.h:326 msgid "" "Encode very bright image parts with reduced quality. 0 means disabled, 0-0.3 " "is a sane range." msgstr "" "Codiere sehr helle Bild teile mit verringerter Qualität. 0 heißt " "deaktiviert, 0-0,3 ist ein vernünftiger Bereich." # geht warscheinlich besser #: plugins/ffmpeg/params.h:334 msgid "Temporary complexity masking" msgstr "Maskierung Temporaler Komplexitäten" #: plugins/ffmpeg/params.h:340 msgid "" "Encode very fast moving image parts with reduced quality. 0 means disabled." msgstr "" "Codiere sehr Bewegungsintensive Bild teile mit verringerter Qualität. 0 " "heißt deakiviert" # spatial lassen? #: plugins/ffmpeg/params.h:348 msgid "Spatial complexity masking" msgstr "Maskierung Regionaler Komplexitäten" #: plugins/ffmpeg/params.h:354 msgid "" "Encode very complex image parts with reduced quality. 0 means disabled, " "0-0.5 is a sane range." msgstr "" "Codiere sehr komplexe Bild teile mit verringerter Qualität. 0 heißt " "deaktiviert, 0-0,5 ist ein vernünftiger Bereich." #: plugins/ffmpeg/params.h:362 msgid "Inter block masking" msgstr "Interblock Maskierung" #: plugins/ffmpeg/params.h:368 msgid "" "Encode inter blocks with reduced quality (increases the quality of intra " "blocks). 0 means disabled, 1 will double the bits allocated for intra " "blocks." msgstr "" "Kodiere Inter-Blöcke mit reduzierter Qualität (erhöhe die Qualität von Intra-" "Blöcken). 0 heist abgeschaltet, 1 wird die Zahl der Bits für Intra-Blöcke " "verdoppeln." #: plugins/ffmpeg/params.h:376 msgid "Darkness masking" msgstr "Dunkelheitsmaskierung" #: plugins/ffmpeg/params.h:382 msgid "" "Encode very dark image parts with reduced quality. 0 means disabled, 0-0.3 " "is a sane range." msgstr "" "Codiere sehr dunkle Bild teile mit verringerter Qualität. 0 heißt " "deaktiviert, 0-0,3 ist ein vernünftiger Bereich." #: plugins/ffmpeg/params.h:389 msgid "Precition method" msgstr "Vorhersagemethode" #: plugins/ffmpeg/params.h:393 msgid "Left" msgstr "Links" #: plugins/ffmpeg/params.h:393 msgid "Plane" msgstr "Plane" #: plugins/ffmpeg/params.h:393 msgid "Median" msgstr "Median" #: plugins/ffmpeg/params.h:400 msgid "Minimum MB quantizer" msgstr "Minimaler MB Quantizer" #: plugins/ffmpeg/params.h:411 msgid "Maximum MB quantizer" msgstr "Maximaler MB Quantizer" #: plugins/ffmpeg/params.h:421 msgid "" "SAD: Sum of absolute differences\n" "SSE: Sum of squared errors\n" "SATD: Sum of absolute Hadamard transformed differences\n" "DCT: Sum of absolute DCT transformed differences\n" "PSNR: Sum of squared quantization errors (low quality)\n" "BIT: Number of bits needed for the block\n" "RD: Rate distortion optimal (slow)\n" "ZERO: 0\n" "VSAD: Sum of absolute vertical differences\n" "VSSE: Sum of squared vertical differences\n" "NSSE: Noise preserving sum of squared differences" msgstr "" "SAD: Summe der absoluten Differenzen\n" "SSE: Summe der quadrierten errors\n" "SATD: Summe der absoluten Hadamard transformierten Differenzen\n" "DCT: Summe der absoluten DCT transformierten Differenzen\n" "PSNR: Summe der quadrierten Quantisierungsfehler (niedrige Qualität)\n" "BIT: Zahl der für einen Block benötigten Bits\n" "RD: Ratenverzerrung optimal (langsam)\n" "ZERO: 0\n" "VSAD: Summe der absoluten vertikalen Differenzen\n" "VSSE: Summe der quadrierten vertikalen Differenzen\n" "NSSE: Rauscherhaltende Summe der quadrierten Differenzen" #: plugins/ffmpeg/params.h:441 msgid "Motion estimation compare function." msgstr "Vergleichsfunktion für Bewegungsausgleich." #: plugins/ffmpeg/params.h:448 msgid "Enable chroma ME compare" msgstr "Aktiviere Chroma ME Vergleich." #: plugins/ffmpeg/params.h:457 msgid "Subpixel ME compare function" msgstr "Subpixel ME Vergleichsfunktion" #: plugins/ffmpeg/params.h:461 msgid "Subpixel motion estimation compare function.\n" msgstr "Vergleichsfunktion für Subpixel-Bewegungsausgleich\n" #: plugins/ffmpeg/params.h:468 msgid "Enable chroma subpixel ME compare" msgstr "Aktiviere Chroma subpixel ME Vergleich." #: plugins/ffmpeg/params.h:477 msgid "MB compare function" msgstr "MB Vergleichsfunktion" #: plugins/ffmpeg/params.h:481 msgid "Macroblock compare function.\n" msgstr "Makroblock Vergleichsfunktion.\n" #: plugins/ffmpeg/params.h:487 msgid "Enable chroma macroblock ME compare" msgstr "Aktiviere Chroma Macroblock ME Vergleich." #: plugins/ffmpeg/params.h:496 msgid "ILDCT compare function" msgstr "ILDCT Vergleichsfunktion" #: plugins/ffmpeg/params.h:500 msgid "Interlaced dct compare function.\n" msgstr "Interlaced dct Vergleichsfunktion.\n" #: plugins/ffmpeg/params.h:506 msgid "Enable chroma ILDCT ME compare" msgstr "Aktiviere Chroma ILDCT ME Vergleich." #: plugins/ffmpeg/params.h:515 msgid "ME diamond size & shape" msgstr "ME Diamantgröße und -form" #: plugins/ffmpeg/params.h:520 msgid "Motion estimation diamond size. Negative means shape adaptive." msgstr "Motion Estimation Diamantgröße. Negative bedeutet Formadaptiv." # ??? #: plugins/ffmpeg/params.h:526 msgid "Last predictor count" msgstr "Anzahl letzter Vorhersager " #: plugins/ffmpeg/params.h:531 msgid "" "Amount of motion predictors from the previous frame.\n" "0 (default)\n" "a Will use 2a+1 x 2a+1 macroblock square of motion vector predictors from " "the previous frame." msgstr "" "Anzahl der Vorhersager vom vorherigen Bild. 0 ist Voreinstellung, a wird 2a" "+1 mal 2a+1 Makroblock Quadrat von Bewegungsvektor-Vorhersagern vom " "vorherigen Bild benutzen." #: plugins/ffmpeg/params.h:541 plugins/ffmpeg/codecs.c:149 msgid "ME pre-pass" msgstr "ME pre-pass" #: plugins/ffmpeg/params.h:546 msgid "" "Motion estimation pre-pass\n" "0: disabled\n" "1: only after I-frames\n" "2: always" msgstr "" "Motion estimation pre-pass\n" "0: deaktiviert\n" "1: nur nach I-Frames\n" "2: immer" #: plugins/ffmpeg/params.h:556 msgid "ME pre-pass compare function" msgstr "ME pre-pass Vergleichsfunktion" #: plugins/ffmpeg/params.h:560 msgid "Motion estimation pre-pass compare function.\n" msgstr "Motion estimation pre-pass Vergleichsfunktion.\n" #: plugins/ffmpeg/params.h:567 msgid "Enable chroma ME pre-pass compare" msgstr "Aktiviere Chroma ME pre-pass Vergleich" #: plugins/ffmpeg/params.h:578 msgid "ME pre-pass diamond size & shape" msgstr "ME pre-pass Diamantgröße & -form" #: plugins/ffmpeg/params.h:583 msgid "Motion estimation pre-pass diamond size. Negative means shape adaptive." msgstr "" "Motion Estimation pre-pass Diamantgröße. Negative Werte bedeuten Formadaptiv." #: plugins/ffmpeg/params.h:590 msgid "Subpel ME quality" msgstr "Subpel ME Qualität" #: plugins/ffmpeg/params.h:595 msgid "" "Subpel motion estimation refinement quality (for qpel). Higher values mean " "higher quality but slower encoding." msgstr "" "Verfeinerungsqualität für Subpel Motion Estimation (für qpel). Höhere Werte " "bedeuten bessere Qualität aber langsameres Codieren." #: plugins/ffmpeg/params.h:603 msgid "Motion estimation range" msgstr "Reichweite der Motion Estimation" # suchtiefe #: plugins/ffmpeg/params.h:608 msgid "Motion estimation search range (0 means unlimited)" msgstr "Motion Estimation Suchweite " #: plugins/ffmpeg/params.h:615 msgid "MB decision mode" msgstr "MB Wahlmodus" #: plugins/ffmpeg/params.h:620 msgid "Use compare function" msgstr "Verwende Vergleichsfunktion" #: plugins/ffmpeg/params.h:621 msgid "Fewest bits" msgstr "Wenigste Bits" # klingt blöd #: plugins/ffmpeg/params.h:621 msgid "Rate distoration" msgstr "Ratenverzerrung" #: plugins/ffmpeg/params.h:628 msgid "Scenechange threshold" msgstr "Schwellwert für Szenenwechsel" #: plugins/ffmpeg/params.h:633 msgid "" "Threshold for scene change detection.\n" "Negative values mean more sensitivity (more keyframes)" msgstr "" "Schwellwert für für Erkennung von Szenenwechseln.\n" "Negative Werte bedeuten eine höhere Empfindlichkeit (mehr Keyframes)" #: plugins/ffmpeg/params.h:641 msgid "Minimum lagrange multiplier" msgstr "Minimaler Lagrange-Faktor" #: plugins/ffmpeg/params.h:647 msgid "" "Minimum Lagrange multiplier for ratecontrol. Should possibly be the same as " "minimum quantizer scale." msgstr "" "Minimaler Lagrange Multiplikator für Ratensteuerung. Sollte wenn möglich " "gleich der Minimalen Quantizer Skalierung sein." #: plugins/ffmpeg/params.h:655 msgid "Maximum lagrange multipler" msgstr "Maximaler Lagrange Multiplikator" #: plugins/ffmpeg/params.h:661 msgid "" "Maximum Lagrange multiplier for ratecontrol. Should possibly be the same as " "maximum quantizer scale." msgstr "" "Maximaler Lagrange Multiplikator für Ratensteuerung. Sollte wenn möglich " "gleich der Maximalen Quantizer Skalierung sein." #: plugins/ffmpeg/params.h:668 msgid "Noise reduction" msgstr "Rausch Unterdrückung" #: plugins/ffmpeg/params.h:679 msgid "Initial RC buffer occupancy" msgstr "Anfängliche RC Pufferbelegung" #: plugins/ffmpeg/params.h:682 msgid "" "Number of kilobits which should be loaded into the rc buffer before encoding " "starts. Must not be larger than RC buffer size" msgstr "" "Anzahl an Kilobits die vor dem Codieren in den RC Puffer geladen werden " "sollen. Darf nicht mehr als die RC Puffergröße sein." #: plugins/ffmpeg/params.h:693 msgid "Inter threshold" msgstr "Inter Schwellwert" # bessere übersetzungs für noise shaping? #: plugins/ffmpeg/params.h:702 msgid "Quantizer noise shaping" msgstr "Quantizer Rauschformung" #: plugins/ffmpeg/params.h:707 msgid "" "Choose quantization such that noise will be masked by similar-frequency " "content in the image" msgstr "" "Wähle Quantisierung so dass Rauschen von Bildinhalten mit ähnlichen " "Frequenzen maskiert wird." #: plugins/ffmpeg/params.h:715 msgid "ME Theshold" msgstr "ME Schwellwert" #: plugins/ffmpeg/params.h:720 msgid "" "Motion estimation threshold. under which no motion estimation is performed, " "but instead the user specified motion vectors are used" msgstr "" "Schwellwert für Motion Estimation, unter welchem keine Motion Compensation " "durchgeführt wird und stattdessen vom Nutzer gegebene Bewegungsvektoren " "verwendet werden." #: plugins/ffmpeg/params.h:726 msgid "MB Theshold" msgstr "MB Schwellwert" #: plugins/ffmpeg/params.h:731 msgid "" "Macroblock threshold. under which the user specified macroblock types will " "be used" msgstr "" "Macroblock Schwellwert, unter welchem vom Nutzer gegebene Macroblocktypen " "verwendet werden." #: plugins/ffmpeg/params.h:737 msgid "NSSE weight" msgstr "NSSE Gewicht" #: plugins/ffmpeg/params.h:740 msgid "" "Noise vs. SSE weight for the NSSE comparsion function. 0 is identical to SSE" msgstr "" "Rausch vs SSE Wichtung für die NSSE Vergleichsfunktion. 0 entspricht SSE" #: plugins/ffmpeg/params.h:748 msgid "Border masking" msgstr "Randmaskierung" #: plugins/ffmpeg/params.h:754 msgid "" "Encode image parts near the border with reduced quality. 0 means disabled" msgstr "" "Codiere Bild teile in der Nähe der Ränder mit verringerter Qualität. 0 heißt " "deaktiviert" #: plugins/ffmpeg/params.h:761 msgid "Minimum MB lagrange multipler" msgstr "Minimaler macroblock Lagrange multiplier." #: plugins/ffmpeg/params.h:767 msgid "Minimum macroblock Lagrange multiplier." msgstr "Minimaler macroblock Lagrange multiplier." #: plugins/ffmpeg/params.h:773 msgid "Maximum MB lagrange multipler" msgstr "Maximaler MB Lagrange multiplier." #: plugins/ffmpeg/params.h:779 msgid "Maximum macroblock Lagrange multiplier." msgstr "Maximaler macroblock Lagrange multiplier." # klingt eigenartig #: plugins/ffmpeg/params.h:786 msgid "ME penalty compensation" msgstr "ME Strafenausgleich" #: plugins/ffmpeg/params.h:794 msgid "Bidir refine" msgstr "Bidir Abstimmung" #: plugins/ffmpeg/params.h:804 msgid "BRD scale" msgstr "BRD Skala" #: plugins/ffmpeg/params.h:816 msgid "Scenechange factor" msgstr "Faktor für Szenenwechsel" #: plugins/ffmpeg/params.h:819 msgid "Multiplied by qscale for each frame and added to scene_change_score" msgstr "" "Für jeden Frame mit qscale multipliziert und zu scene_change_score " "hinzuaddiert" #: plugins/ffmpeg/params.h:831 msgid "" "Quantizer for fixed quality encoding. Lower means better, 1 is not " "recommended" msgstr "" "Quantizer für Codieren mit fester Qualität. Niedriger heißt besser, 1 ist " "nicht empfohlen." #: plugins/ffmpeg/params.h:840 msgid "Use fixed quantizer" msgstr "Verwende festen Quantizer" #: plugins/ffmpeg/params.h:843 msgid "Use fixed quality encoding" msgstr "Verwende Codieren mit fester Qualität" #: plugins/ffmpeg/params.h:850 msgid "4 MV per MB allowed" msgstr "4 MV per MB erlaubt" #: plugins/ffmpeg/params.h:853 msgid "" "Allow 4 motion vectors per macroblock (slightly better quality). Works " "better if MB decision mode is \"Fewest bits\" or \"Rate distoration\"." msgstr "" "Erlaube 4 Bewegungsvektoren pro Macroblock (etwas bessere Qualität). Arbeit " "besser wenn der MB Wahlmodus \"Wenigste Bits\" oder \"Ratenverzerrung\" ist." #: plugins/ffmpeg/params.h:860 msgid "Use qpel MC" msgstr "Verwende qpel MC" #: plugins/ffmpeg/params.h:863 msgid "" "Use 1/4 pixel motion compensation. Warning: QPEL is not supported by all " "decoders." msgstr "" "Benutze 1/4 Pixel Bewegungsausgleich. Warning: QPEL wird nicht von allen " "Dekodern unterstützt." #: plugins/ffmpeg/params.h:870 msgid "Use global motion compensation" msgstr "Verwende Globale Motion Compensation" #: plugins/ffmpeg/params.h:873 msgid "Warning: GMC is not supported by all decoders" msgstr "Warnung: GMC wird nicht von allen Decodern unterstützt" #: plugins/ffmpeg/params.h:880 msgid "Always try a MB with MV=<0,0>" msgstr "Versuche immer einen MB mit MV=<0,0>" #: plugins/ffmpeg/params.h:888 msgid "Use data partitioning" msgstr "Verwende Datenpartitionierung" #: plugins/ffmpeg/params.h:891 msgid "" "Use data partitioning for more robustness if the video is for transmitting " "over unreliable channels" msgstr "" "Verwende Datenpartitionierung für erhöhte Robustheit wenn das Video über " "unzuverlässige Kanäle übertragen Wird" #: plugins/ffmpeg/params.h:899 msgid "Grayscale mode" msgstr "Schwarzweß Modus" #: plugins/ffmpeg/params.h:907 msgid "Don't draw edges" msgstr "Zeichne keine Kanten" #: plugins/ffmpeg/params.h:916 msgid "Normalize adaptive quantization" msgstr "Normalisiere adaptive Quantisierung" #: plugins/ffmpeg/params.h:919 msgid "" "When using masking, try to adjust the per macroblock quantizers to maintain " "the desired average" msgstr "" "Bei Verwendung von Maskierung, versuche per Macroblock Quantizer so " "abzustimmen dass der gewünschte Durchschnitt erhalten bleibt." #: plugins/ffmpeg/params.h:926 msgid "Use alternative scantable" msgstr "Verwende alternative Scantabelle" #: plugins/ffmpeg/params.h:936 plugins/ffmpeg/params.h:945 msgid "Use trellis quantization" msgstr "Verwende Trellis Quantisierung" #: plugins/ffmpeg/params.h:939 plugins/ffmpeg/params.h:948 msgid "Use trellis quantization (improves quality)" msgstr "Verwende Trellis Quantisierung (verbessert Qualität)" # ... #: plugins/ffmpeg/params.h:955 msgid "Use only bitexact stuff" msgstr "Verwende nur bitgenaue Sachen" #: plugins/ffmpeg/params.h:958 msgid "Use only bitexact stuff (except (i)dct)" msgstr "Verwende nur bitgenaue Sachen (ausser (i)dct)" #: plugins/ffmpeg/params.h:964 msgid "Advanced intra coding" msgstr "Fortgeschrittlene Intra Codierung" #: plugins/ffmpeg/params.h:972 msgid "MPEG-4 AC prediction" msgstr "MPEG-4 AC Vorhersage" # plural? #: plugins/ffmpeg/params.h:980 msgid "Unlimited motion vector" msgstr "Unbegrenzter Bewegungsvektor" #: plugins/ffmpeg/params.h:988 msgid "CBP RD" msgstr "CBP RD" #: plugins/ffmpeg/params.h:991 msgid "Use rate distortion optimization for cbp" msgstr "Verwende Ratenverzerr Optimierung für cbp" #: plugins/ffmpeg/params.h:997 msgid "QP RD" msgstr "QP RD" #: plugins/ffmpeg/params.h:1000 msgid "Use rate distortion optimization for qp selection" msgstr "Benutze Ratenverzerrungs-Optimierung für qp Auswahl" #: plugins/ffmpeg/params.h:1006 msgid "Alternative inter vlc" msgstr "Alternatives inter vlc" #: plugins/ffmpeg/params.h:1015 msgid "OBMC" msgstr "OBMC" #: plugins/ffmpeg/params.h:1018 msgid "" "Overlapped block motion compensation (only supported with with simple MB " "decision)" msgstr "" "Überlappender Block-Bewegungsausgleich (nur unterstützt mit einfacher MB-" "Entscheidung)" #: plugins/ffmpeg/params.h:1024 msgid "Loop filter" msgstr "Schleifenfilter" #: plugins/ffmpeg/params.h:1032 msgid "H263P slice struct" msgstr "H263P slice struct" #: plugins/ffmpeg/params.h:1041 msgid "Close all GOPs" msgstr "Schließe alle GOPs" #: plugins/ffmpeg/params.h:1049 msgid "Allow fast encoding" msgstr "Erlaube schnelles Codieren" #: plugins/ffmpeg/params.h:1052 msgid "Allow non spec compliant speedup tricks" msgstr "Erlaube Beschleunigungstricks, die nicht der Spezifikation entsprechen" # durchsetzung #: plugins/ffmpeg/params.h:1059 msgid "Strictly enforce GOP size" msgstr "Strenge Einhaltung der GOP Größe" #: plugins/ffmpeg/ffmpeg_common.c:376 msgid "Audio codec not available in your libavcodec installation" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:385 msgid "avcodec_open failed for audio" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:419 msgid "Video codec not available in your libavcodec installation" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:480 msgid "avcodec_open failed for video" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:525 #, fuzzy msgid "Initializing multiplexer failed" msgstr "Initialisierung des Kodierers fehlgeschlagen" #: plugins/ffmpeg/codecs.c:78 msgid "Rate control" msgstr "Ratensteuerung" #: plugins/ffmpeg/codecs.c:92 msgid "Quantizer" msgstr "Quantisierer" #: plugins/ffmpeg/codecs.c:118 msgid "Frame types" msgstr "Frametypen" #: plugins/ffmpeg/codecs.c:135 msgid "Motion estimation" msgstr "Bewegungsabschätzung" #: plugins/ffmpeg/codecs.c:160 msgid "Qpel ME" msgstr "Qpel Bewegungsabschätzung" #: plugins/ffmpeg/codecs.c:171 msgid "Masking" msgstr "Maskierung" #: plugins/ffmpeg/codecs.c:185 msgid "Misc" msgstr "Verschiedenes" #: plugins/ffmpeg/codecs.c:265 plugins/ffmpeg/codecs.c:270 msgid "16 bit PCM" msgstr "16 Bit PCM" #: plugins/ffmpeg/codecs.c:275 plugins/ffmpeg/codecs.c:280 msgid "8 bit PCM" msgstr "8 Bit PCM" #: plugins/ffmpeg/codecs.c:285 msgid "alaw" msgstr "alaw" #: plugins/ffmpeg/codecs.c:290 msgid "mulaw" msgstr "mulaw" #: plugins/ffmpeg/codecs.c:295 msgid "AC3" msgstr "AC3" #: plugins/ffmpeg/codecs.c:301 msgid "MPEG audio layer 2" msgstr "MPEG Audio Layer 2" #: plugins/ffmpeg/codecs.c:307 msgid "Windows media Audio 1" msgstr "Windows Media Audio 1" #: plugins/ffmpeg/codecs.c:313 msgid "Windows media Audio 2" msgstr "Windows Media Audio 2" #: plugins/ffmpeg/codecs.c:319 msgid "MPEG audio layer 3" msgstr "MPEG Audio layer 3" #: plugins/ffmpeg/codecs.c:330 msgid "Motion JPEG" msgstr "Motion JPEG" #: plugins/ffmpeg/codecs.c:337 msgid "MPEG-4" msgstr "MPEG-4" #: plugins/ffmpeg/codecs.c:344 msgid "Divx 3 compatible" msgstr "Divx 3 kompatibel" #: plugins/ffmpeg/codecs.c:351 msgid "MPEG-1 Video" msgstr "MPEG-1 Video" #: plugins/ffmpeg/codecs.c:358 msgid "MPEG-2 Video" msgstr "MPEG-2 Video" #: plugins/ffmpeg/codecs.c:365 msgid "Flash 1" msgstr "Flash 1" #: plugins/ffmpeg/codecs.c:372 msgid "WMV 1" msgstr "WMV 1" #: plugins/ffmpeg/codecs.c:379 msgid "Real Video 1" msgstr "Real Video 1" #: plugins/ffmpeg/codecs.c:387 msgid "WMV 2" msgstr "WMV 2" #: plugins/ffmpeg/codecs.c:596 #, fuzzy, c-format msgid "Audio codec %s is not supported by %s" msgstr "Audiokodierung ist nicht kompatibel mit Format" #: plugins/ffmpeg/codecs.c:634 #, fuzzy, c-format msgid "Video codec %s is not supported by %s" msgstr "Videokodierung ist nicht kompatibel mit Format" #: plugins/ffmpeg/e_ffmpeg_audio.c:90 msgid "FFmpeg audio encoder" msgstr "FFmpeg Audio Kodierer" #: plugins/ffmpeg/e_ffmpeg_audio.c:91 msgid "" "Plugin for encoding various audio formats with ffmpeg (http://www.ffmpeg." "org)." msgstr "" "Plugin zum Erzeugen Verschiedener Audioformate mit ffmpeg (http://www.ffmpeg." "org)." #: plugins/ffmpeg/e_ffmpeg_video.c:64 msgid "FFmpeg video encoder" msgstr "FFmpeg video Kodierer" #: plugins/ffmpeg/e_ffmpeg_video.c:65 msgid "" "Plugin for encoding various video formats with ffmpeg (http://www.ffmpeg." "org)." msgstr "" "Plugin zum Erzeugen Verschiedener Videoformate mit ffmpeg (http://www.ffmpeg." "org)." #: lib/bgflac.c:200 msgid "Bits" msgstr "Bits" #: lib/bgflac.c:207 msgid "Compression Level" msgstr "Kompressionsstufe" #: lib/bgflac.c:212 msgid "" "0: Fastest encoding, biggest files\n" "8: Slowest encoding, smallest files" msgstr "" "0: Schnellstes Kodieren, größte Dateien\n" "8: Langsamstes Kodieren, kleinste Dateien" #: lib/bgshout.c:55 #, fuzzy msgid "Server" msgstr "Stereo" #: lib/bgshout.c:61 #, fuzzy msgid "Port" msgstr "Format" #: lib/bgshout.c:69 msgid "Mount" msgstr "" #: lib/bgshout.c:75 msgid "User" msgstr "" #: lib/bgshout.c:81 msgid "Password" msgstr "" #: lib/bgshout.c:86 msgid "Name" msgstr "" #: lib/bgshout.c:91 #, fuzzy msgid "Description" msgstr "Benutzeroptionen" #: lib/bgshout.c:148 #, fuzzy, c-format msgid "Connecting failed: %s" msgstr "Schreiben in Datei fehlgeschlagen: %s" #: lib/bgshout.c:152 msgid "Connected to icecast server" msgstr "" #~ msgid "Automatic keyframe insertion" #~ msgstr "Automatisches Einfügen von Keyframes" #~ msgid "Keyframe frequency" #~ msgstr "Keyframefrequenz" #~ msgid "Keyframe frequency force" #~ msgstr "Erzwinge Keyframefrequenz" #~ msgid "Keyframe auto threshold" #~ msgstr "Keyframeschwelle" #~ msgid "Keyframe minimum distance" #~ msgstr "Minimaler Abstand zwischen Keyframes" #~ msgid "Quick encode" #~ msgstr "Schnelles Kodieren" #~ msgid "Sharpness" #~ msgstr "Schärfe" #~ msgid "Noise Sensitivity" #~ msgstr "Rauschempfindlichkeit" #~ msgid "theora_encode_init failed" #~ msgstr "theora_encode_init fehlgeschlagen" #~ msgid "Chroma subsampling mode" #~ msgstr "Chroma subsampling Modus" #~ msgid "Encoding bitrate (kbps)" #~ msgstr "Encodierbitrate (kbps)" bplaum-gmerlin-encoders-172394d/po/en@boldquot.header000066400000000000000000000024711513225514200225540ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # bplaum-gmerlin-encoders-172394d/po/en@quot.header000066400000000000000000000022631513225514200217120ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # bplaum-gmerlin-encoders-172394d/po/gmerlin-encoders.pot000066400000000000000000001172701513225514200231130ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Members of the gmerlin project # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: gmerlin-general@lists.sourceforge.net\n" "POT-Creation-Date: 2011-02-12 00:22+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: plugins/faac/e_faac.c:91 msgid "Basic options" msgstr "" #: plugins/faac/e_faac.c:96 msgid "Object type" msgstr "" #: plugins/faac/e_faac.c:105 msgid "MPEG-2 Main profile" msgstr "" #: plugins/faac/e_faac.c:106 msgid "MPEG-2 Low Complexity profile (LC)" msgstr "" #: plugins/faac/e_faac.c:107 msgid "MPEG-4 Main profile" msgstr "" #: plugins/faac/e_faac.c:108 msgid "MPEG-4 Low Complexity profile (LC)" msgstr "" #: plugins/faac/e_faac.c:109 msgid "MPEG-4 Long Term Prediction (LTP)" msgstr "" #: plugins/faac/e_faac.c:114 plugins/lame/e_lame.c:271 plugins/ogg/speex.c:180 #: plugins/yuv4mpeg/mpv_common.c:81 plugins/yuv4mpeg/mpa_common.c:42 msgid "Bitrate (kbps)" msgstr "" #: plugins/faac/e_faac.c:118 msgid "Average bitrate (0: VBR based on quality)" msgstr "" #: plugins/faac/e_faac.c:122 msgid "Quality" msgstr "" #: plugins/faac/e_faac.c:127 msgid "Quantizer quality" msgstr "" #: plugins/faac/e_faac.c:131 msgid "Advanced options" msgstr "" #: plugins/faac/e_faac.c:136 msgid "Block types" msgstr "" #: plugins/faac/e_faac.c:143 msgid "Both" msgstr "" #: plugins/faac/e_faac.c:144 msgid "No short" msgstr "" #: plugins/faac/e_faac.c:145 msgid "No long" msgstr "" #: plugins/faac/e_faac.c:151 msgid "Use temporal noise shaping" msgstr "" #: plugins/faac/e_faac.c:156 msgid "Don't use mid/side coding" msgstr "" #: plugins/faac/e_faac.c:181 msgid "faacEncSetConfiguration failed" msgstr "" #: plugins/faac/e_faac.c:250 plugins/lame/e_lame.c:475 msgid "Write ID3V1.1 tag" msgstr "" #: plugins/faac/e_faac.c:256 plugins/lame/e_lame.c:481 msgid "Write ID3V2 tag" msgstr "" #: plugins/faac/e_faac.c:262 plugins/lame/e_lame.c:487 msgid "ID3V2 Encoding" msgstr "" #: plugins/faac/e_faac.c:267 plugins/lame/e_lame.c:492 msgid "ISO-8859-1" msgstr "" #: plugins/faac/e_faac.c:267 plugins/lame/e_lame.c:492 msgid "UTF-16 LE" msgstr "" #: plugins/faac/e_faac.c:268 plugins/lame/e_lame.c:493 msgid "UTF-16 BE" msgstr "" #: plugins/faac/e_faac.c:268 plugins/lame/e_lame.c:493 msgid "UTF-8" msgstr "" #: plugins/faac/e_faac.c:313 plugins/lame/e_lame.c:540 #, c-format msgid "Cannot open %s: %s" msgstr "" #: plugins/faac/e_faac.c:541 msgid "Faac encoder" msgstr "" #: plugins/faac/e_faac.c:542 msgid "" "Plugin for encoding AAC streams (with ADTS headers). Based on faac (http://" "faac.sourceforge.net)." msgstr "" #: plugins/lame/e_lame.c:220 msgid "General" msgstr "" #: plugins/lame/e_lame.c:225 plugins/ogg/vorbis.c:89 msgid "Bitrate mode" msgstr "" #: plugins/lame/e_lame.c:232 plugins/yuv4mpeg/mpv_common.c:74 msgid "Constant" msgstr "" #: plugins/lame/e_lame.c:233 msgid "Average" msgstr "" #: plugins/lame/e_lame.c:234 plugins/yuv4mpeg/mpv_common.c:74 msgid "Variable" msgstr "" #: plugins/lame/e_lame.c:239 msgid "Stereo mode" msgstr "" #: plugins/lame/e_lame.c:246 msgid "Stereo" msgstr "" #: plugins/lame/e_lame.c:247 msgid "Joint stereo" msgstr "" #: plugins/lame/e_lame.c:248 plugins/ogg/speex.c:150 #: plugins/yuv4mpeg/e_yuv4mpeg.c:154 plugins/yuv4mpeg/mpv_common.c:74 msgid "Auto" msgstr "" #: plugins/lame/e_lame.c:250 msgid "" "Stereo: Completely independent channels\n" "Joint stereo: Improve quality (save bits) by using similarities of the " "channels\n" "Auto (recommended): Select one of the above depending on quality or bitrate " "setting" msgstr "" #: plugins/lame/e_lame.c:256 plugins/ogg/theora.c:162 msgid "Encoding speed" msgstr "" #: plugins/lame/e_lame.c:261 msgid "" "0: Slowest encoding, best quality\n" "9: Fastest encoding, worst quality" msgstr "" #: plugins/lame/e_lame.c:266 msgid "CBR options" msgstr "" #: plugins/lame/e_lame.c:276 msgid "" "Bitrate in kbps. If your selection is no valid mp3 bitrate, we'll choose the " "closest value." msgstr "" #: plugins/lame/e_lame.c:281 msgid "VBR/ABR options" msgstr "" #: plugins/lame/e_lame.c:286 msgid "VBR Quality" msgstr "" #: plugins/lame/e_lame.c:291 msgid "VBR Quality level. 0: best, 9: worst" msgstr "" #: plugins/lame/e_lame.c:295 msgid "ABR overall bitrate (kbps)" msgstr "" #: plugins/lame/e_lame.c:300 msgid "Average bitrate for ABR mode" msgstr "" #: plugins/lame/e_lame.c:304 msgid "ABR min bitrate (kbps)" msgstr "" #: plugins/lame/e_lame.c:309 msgid "" "Minimum bitrate for ABR mode. 0 means let lame decide. If your selection is " "no valid mp3 bitrate, we'll choose the closest value." msgstr "" #: plugins/lame/e_lame.c:314 msgid "ABR max bitrate (kbps)" msgstr "" #: plugins/lame/e_lame.c:319 msgid "" "Maximum bitrate for ABR mode. 0 means let lame decide. If your selection is " "no valid mp3 bitrate, we'll choose the closest value." msgstr "" #: plugins/lame/e_lame.c:349 plugins/lame/e_lame.c:382 msgid "lame_set_VBR_q failed" msgstr "" #: plugins/lame/e_lame.c:353 msgid "lame_set_VBR_mean_bitrate_kbps failed" msgstr "" #: plugins/lame/e_lame.c:365 msgid "lame_set_VBR_min_bitrate_kbps failed" msgstr "" #: plugins/lame/e_lame.c:377 msgid "lame_set_VBR_max_bitrate_kbps failed" msgstr "" #: plugins/lame/e_lame.c:388 msgid "lame_set_brate failed" msgstr "" #: plugins/lame/e_lame.c:395 msgid "lame_init_params failed" msgstr "" #: plugins/lame/e_lame.c:415 msgid "lame_set_VBR failed" msgstr "" #: plugins/lame/e_lame.c:418 msgid "lame_set_bWriteVbrTag failed" msgstr "" #: plugins/lame/e_lame.c:438 msgid "lame_set_mode failed" msgstr "" #: plugins/lame/e_lame.c:444 msgid "lame_set_quality failed" msgstr "" #: plugins/lame/e_lame.c:607 msgid "lame_set_in_samplerate failed" msgstr "" #: plugins/lame/e_lame.c:609 msgid "lame_set_num_channels failed" msgstr "" #: plugins/lame/e_lame.c:612 msgid "lame_set_scale failed" msgstr "" #: plugins/lame/e_lame.c:771 msgid "Lame mp3 encoder" msgstr "" #: plugins/lame/e_lame.c:772 msgid "" "Encoder for mp3 files. Based on lame (http://www.mp3dev.org). Supports CBR, " "ABR and VBR as well as ID3V1 and ID3V2 tags." msgstr "" #: plugins/ogg/flac.c:112 msgid "Got no Flac ID page" msgstr "" #: plugins/ogg/flac.c:117 plugins/ogg/flac.c:159 #, c-format msgid "Writing to file failed: %s" msgstr "" #: plugins/ogg/flac.c:251 msgid "FLAC__stream_encoder_init failed" msgstr "" #: plugins/ogg/flac.c:262 msgid "FLAC__stream_encoder_init_stream failed" msgstr "" #: plugins/ogg/flac.c:333 plugins/flac/e_flac.c:481 msgid "Flac encoder" msgstr "" #: plugins/ogg/e_speex.c:68 plugins/ogg/speex.c:583 msgid "Speex encoder" msgstr "" #: plugins/ogg/e_speex.c:69 msgid "Encoder for Speex files" msgstr "" #: plugins/ogg/speex.c:146 msgid "Speex mode" msgstr "" #: plugins/ogg/speex.c:150 msgid "Narrowband" msgstr "" #: plugins/ogg/speex.c:150 msgid "Wideband" msgstr "" #: plugins/ogg/speex.c:151 msgid "Ultra-wideband" msgstr "" #: plugins/ogg/speex.c:152 msgid "" "Encoding mode. If you select Auto, the mode will be taken from the " "samplerate." msgstr "" #: plugins/ogg/speex.c:156 msgid "Quality (10: best)" msgstr "" #: plugins/ogg/speex.c:164 msgid "Encoding complexity" msgstr "" #: plugins/ogg/speex.c:172 msgid "Frames per Ogg packet" msgstr "" #: plugins/ogg/speex.c:185 msgid "" "Bitrate (in kbps). Set to 0 for seleting the standard bitrates for the " "encoding mode." msgstr "" #: plugins/ogg/speex.c:189 msgid "Variable bitrate" msgstr "" #: plugins/ogg/speex.c:194 msgid "Average bitrate (kbps)" msgstr "" #: plugins/ogg/speex.c:199 msgid "Average bitrate (in kbps). Set to 0 for disabling ABR." msgstr "" #: plugins/ogg/speex.c:203 msgid "Use voice activity detection" msgstr "" #: plugins/ogg/speex.c:208 msgid "Enable file-based discontinuous transmission" msgstr "" #: plugins/ogg/speex.c:434 msgid "Got no Speex ID page" msgstr "" #: plugins/ogg/e_theora.c:167 plugins/ogg/theora.c:846 msgid "Theora encoder" msgstr "" #: plugins/ogg/e_theora.c:168 msgid "Encoder for Theora files. Audio can be Vorbis, Flac or Speex." msgstr "" #: plugins/ogg/e_flacogg.c:68 msgid "Flac in Ogg encoder" msgstr "" #: plugins/ogg/e_flacogg.c:69 msgid "" "Encoder for flac streams in Ogg containers. Based on libflac (http://flac." "sourceforge.net)" msgstr "" #: plugins/ogg/b_ogg.c:167 msgid "Ogg Broadcaster" msgstr "" #: plugins/ogg/b_ogg.c:168 msgid "" "Broadcaster for Ogg streams using libshout. Supports vorbis, theora and " "speex." msgstr "" #: plugins/ogg/ogg_common.c:103 #, c-format msgid "Cannot open file %s: %s" msgstr "" #: plugins/ogg/ogg_common.c:413 plugins/ffmpeg/codecs.c:443 #: plugins/ffmpeg/codecs.c:453 msgid "Codec" msgstr "" #: plugins/ogg/vorbis.c:93 msgid "VBR" msgstr "" #: plugins/ogg/vorbis.c:93 msgid "VBR (bitrate)" msgstr "" #: plugins/ogg/vorbis.c:93 msgid "Managed" msgstr "" #: plugins/ogg/vorbis.c:94 msgid "" "Bitrate mode:\n" "VBR: You specify a quality and (optionally) a minimum and maximum bitrate\n" "VBR (bitrate): The specified nominal bitrate will be used for selecting the " "encoder mode.\n" "Managed: You specify a nominal bitrate and (optionally) a minimum and " "maximum bitrate\n" "VBR is recommended, managed bitrate might result in a worse quality" msgstr "" #: plugins/ogg/vorbis.c:102 msgid "Nominal bitrate (kbps)" msgstr "" #: plugins/ogg/vorbis.c:107 msgid "Nominal bitrate (in kbps) for managed mode" msgstr "" #: plugins/ogg/vorbis.c:111 msgid "VBR Quality (10: best)" msgstr "" #: plugins/ogg/vorbis.c:117 msgid "" "Quality for VBR mode\n" "10: best (largest output file)\n" "0: worst (smallest output file)" msgstr "" #: plugins/ogg/vorbis.c:123 plugins/ffmpeg/params.h:237 msgid "Minimum bitrate (kbps)" msgstr "" #: plugins/ogg/vorbis.c:128 msgid "" "Optional minimum bitrate (in kbps)\n" "0 = unspecified" msgstr "" #: plugins/ogg/vorbis.c:133 plugins/ffmpeg/params.h:247 msgid "Maximum bitrate (kbps)" msgstr "" #: plugins/ogg/vorbis.c:138 msgid "" "Optional maximum bitrate (in kbps)\n" "0 = unspecified" msgstr "" #: plugins/ogg/vorbis.c:275 plugins/ogg/vorbis.c:389 msgid "Got no Vorbis ID page" msgstr "" #: plugins/ogg/vorbis.c:569 plugins/ogg/e_vorbis.c:88 msgid "Vorbis encoder" msgstr "" #: plugins/ogg/theora.c:105 msgid "Use constant bitrate" msgstr "" #: plugins/ogg/theora.c:107 msgid "" "For constant bitrate, choose a target bitrate. For variable bitrate, choose " "a nominal quality." msgstr "" #: plugins/ogg/theora.c:111 msgid "Target bitrate (kbps)" msgstr "" #: plugins/ogg/theora.c:119 msgid "Nominal quality" msgstr "" #: plugins/ogg/theora.c:125 msgid "" "Quality for VBR mode\n" "63: best (largest output file)\n" "0: worst (smallest output file)" msgstr "" #: plugins/ogg/theora.c:131 msgid "Maximum keyframe interval" msgstr "" #: plugins/ogg/theora.c:140 msgid "Enable frame dropping" msgstr "" #: plugins/ogg/theora.c:143 msgid "" "Drop frames to keep within bitrate buffer constraints. This can have a " "severe impact on quality, but is the only way to ensure that bitrate targets " "are met at low rates during sudden bursts of activity." msgstr "" #: plugins/ogg/theora.c:147 msgid "Don't bank excess bits for later use" msgstr "" #: plugins/ogg/theora.c:150 msgid "" "Ignore bitrate buffer overflows. If the encoder uses so few bits that the " "reservoir of available bits overflows, ignore the excess. The encoder will " "not try to use these extra bits in future frames. At high rates this may " "cause the result to be undersized, but allows a client to play the stream " "using a finite buffer; it should normally be enabled." msgstr "" #: plugins/ogg/theora.c:154 msgid "Don't try to make up shortfalls later" msgstr "" #: plugins/ogg/theora.c:157 msgid "" "Ignore bitrate buffer underflows. If the encoder uses so many bits that the " "reservoir of available bits underflows, ignore the deficit. The encoder will " "not try to make up these extra bits in future frames. At low rates this may " "cause the result to be oversized; it should normally be disabled." msgstr "" #: plugins/ogg/theora.c:168 msgid "" "Higher speed levels favor quicker encoding over better quality per bit. " "Depending on the encoding mode, and the internal algorithms used, quality " "may actually improve, but in this case bitrate will also likely increase. In " "any case, overall rate/distortion performance will probably decrease." msgstr "" #: plugins/ogg/theora.c:367 msgid "Got no theora ID page" msgstr "" #: plugins/ogg/theora.c:480 msgid "th_encode_alloc failed" msgstr "" #: plugins/ogg/theora.c:530 msgid "Got no Theora ID page" msgstr "" #: plugins/ogg/theora.c:539 #, c-format msgid "Got %d header packets instead of 3" msgstr "" #: plugins/ogg/theora.c:574 plugins/ogg/theora.c:595 #, c-format msgid "couldn't open stats file %s" msgstr "" #: plugins/ogg/theora.c:584 msgid "getting 2 pass header failed" msgstr "" #: plugins/ogg/theora.c:607 msgid "couldn't read stats data" msgstr "" #: plugins/ogg/theora.c:642 plugins/ogg/theora.c:782 msgid "Theora encoder produced no packet" msgstr "" #: plugins/ogg/theora.c:655 plugins/ogg/theora.c:765 msgid "Writing theora packet failed" msgstr "" #: plugins/ogg/theora.c:684 msgid "passing 2 pass data failed" msgstr "" #: plugins/ogg/theora.c:710 plugins/ogg/theora.c:809 msgid "getting 2 pass data failed" msgstr "" #: plugins/ogg/theora.c:737 msgid "First packet isn't a keyframe" msgstr "" #: plugins/ogg/theora.c:791 plugins/ogg/theora.c:822 msgid "Writing packet failed" msgstr "" #: plugins/ogg/e_vorbis.c:89 msgid "Encoder for Vorbis files" msgstr "" #: plugins/flac/e_flac.c:83 msgid "Write vorbis comment" msgstr "" #: plugins/flac/e_flac.c:86 msgid "Write Vorbis comment containing metadata to the file" msgstr "" #: plugins/flac/e_flac.c:90 msgid "Write seek table" msgstr "" #: plugins/flac/e_flac.c:93 msgid "Write seektable (strongly recommended)" msgstr "" #: plugins/flac/e_flac.c:97 msgid "Entries in the seektable" msgstr "" #: plugins/flac/e_flac.c:102 msgid "" "Maximum number of entries in the seek table. Default is 100, larger numbers " "result in shorter seeking times but also in larger files." msgstr "" #: plugins/flac/e_flac.c:214 #, c-format msgid "Initializing encoder failed: %s" msgstr "" #: plugins/flac/e_flac.c:217 msgid "Initializing encoder failed" msgstr "" #: plugins/flac/e_flac.c:482 msgid "Encoder for flac files. Based on libflac (http://flac.sourceforge.net)" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:141 msgid "Chroma mode" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:155 msgid "4:2:0 (MPEG-1/JPEG)" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:156 msgid "4:2:0 (MPEG-2)" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:157 msgid "4:2:0 (PAL DV)" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:158 msgid "4:4:4" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:159 msgid "4:2:2" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:160 msgid "4:1:1" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:161 msgid "Greyscale" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:162 msgid "4:4:4:4 (YUVA)" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:164 msgid "" "Set the chroma mode of the output file. Auto means to take the format most " "similar to the source." msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:254 msgid "yuv4mpeg2 encoder" msgstr "" #: plugins/yuv4mpeg/e_yuv4mpeg.c:255 msgid "" "Encoder for yuv4mpeg files. Based on mjpegtools (http://mjpeg.sourceforge." "net)." msgstr "" #: plugins/yuv4mpeg/mpv_common.c:58 plugins/yuv4mpeg/e_mpeg.c:666 #: plugins/ffmpeg/ffmpeg_common.c:43 msgid "Format" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:62 plugins/yuv4mpeg/e_mpeg.c:670 msgid "MPEG-1 (generic)" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:62 plugins/yuv4mpeg/e_mpeg.c:671 msgid "MPEG-2 (generic)" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:63 msgid "VCD" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:63 msgid "SVCD" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:63 msgid "DVD (for dvdauthor)" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:65 msgid "" "Sets the MPEG flavour. Note, that for VCD, SVCD and DVD, you MUST provide " "valid frame sizes" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:70 msgid "Bitrate Mode" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:75 msgid "" "Specify constant or variable bitrate. For \"Auto\", constant bitrate will be " "used for MPEG-1, variable bitrate will be used for MPEG-2. For formats, " "which require CBR, this option is ignored" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:86 msgid "" "Video bitrate in kbps. For VBR, it's the maximum bitrate. If the format " "requires a fixed bitrate (e.g. VCD) this option is ignored" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:91 msgid "Quantization" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:96 msgid "" "Minimum quantization for VBR. Lower numbers mean higher quality. For CBR, " "this option is ignored." msgstr "" #: plugins/yuv4mpeg/mpv_common.c:100 msgid "Quantization matrices" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:105 msgid "Default" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:105 msgid "KVCD" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:106 msgid "tmpegenc" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:106 msgid "Hi-Res" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:111 msgid "Number of B-Frames" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:116 msgid "" "Specify the number of B-frames between 2 P/I frames. More B-frames slow down " "encoding and increase memory usage, but might give better compression " "results. For VCD, this option is ignored, since the VCD standard requires 2 " "B-frames, no matter if you like them or not." msgstr "" #: plugins/yuv4mpeg/mpv_common.c:122 msgid "User options" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:124 msgid "" "Enter further commandline options for mpeg2enc here. Check the mpeg2enc " "manual page for details" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:194 msgid "Cannot find mpeg2enc executable" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:292 plugins/yuv4mpeg/mpv_common.c:316 msgid "Unknown MPEG format" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:311 msgid "Mixed interlacing not supported (yet)" msgstr "" #: plugins/yuv4mpeg/mpv_common.c:434 msgid "Inserting sequence end code failed" msgstr "" #: plugins/yuv4mpeg/e_mpegaudio.c:129 plugins/yuv4mpeg/mpa_common.c:100 msgid "Cannot find mp2enc executable" msgstr "" #: plugins/yuv4mpeg/e_mpegaudio.c:183 plugins/yuv4mpeg/e_mpegvideo.c:164 #: plugins/yuv4mpeg/e_mpeg.c:611 plugins/yuv4mpeg/e_mpeg.c:627 #, c-format msgid "Removing %s" msgstr "" #: plugins/yuv4mpeg/e_mpegaudio.c:204 msgid "MPEG-1 layer 1/2 audio encoder" msgstr "" #: plugins/yuv4mpeg/e_mpegaudio.c:205 msgid "" "Encoder for elementary MPEG-1 layer 1/2 audio streams. Based on mjpegtools " "(http://mjpeg.sourceforge.net)." msgstr "" #: plugins/yuv4mpeg/y4m_common.c:130 #, c-format msgid "Writing stream header failed: %s" msgstr "" #: plugins/yuv4mpeg/e_mpegvideo.c:198 msgid "MPEG-1/2 video encoder" msgstr "" #: plugins/yuv4mpeg/e_mpegvideo.c:199 msgid "" "Encoder for elementary MPEG-1/2 video streams. Based on mjpegtools (http://" "mjpeg.sourceforge.net)." msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:120 msgid "Cannot find mpeg2enc exectuable" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:125 msgid "Cannot find mp2enc exectuable" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:130 plugins/yuv4mpeg/e_mpeg.c:535 msgid "Cannot find mplex exectuable" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:547 #, c-format msgid "Video sync offset: %" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:670 msgid "MPEG-1 (VCD)" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:671 msgid "MPEG-2 (SVCD)" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:672 msgid "DVD (NAV)" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:672 msgid "DVD" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:673 msgid "" "Output format. Note that for some output formats (e.g. VCD), you MUST use " "proper settings for the audio and video streams also, since this isn't done " "automatically" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:677 msgid "Directory for temporary files" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:679 msgid "Leave empty to use the same directory as the final output file" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:683 msgid "Additional stream 1" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:685 plugins/yuv4mpeg/e_mpeg.c:692 #: plugins/yuv4mpeg/e_mpeg.c:699 msgid "" "Additional stream to multiplex into the final output file. Use this if you " "want e.g. create mp3 or AC3 audio with some other encoder" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:690 msgid "Additional stream 2" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:697 msgid "Additional stream 3" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:778 msgid "MPEG 1/2 program/system stream encoder" msgstr "" #: plugins/yuv4mpeg/e_mpeg.c:779 msgid "" "Encoder for regular .mpg files as well as VCD and DVD streams. Based on " "mjpegtools (http://mjpeg.sourceforge.net)" msgstr "" #: plugins/yuv4mpeg/mpa_common.c:50 msgid "Layer (1 or 2)" msgstr "" #: plugins/yuv4mpeg/mpa_common.c:55 msgid "Audio layer" msgstr "" #: plugins/yuv4mpeg/mpa_common.c:59 msgid "VCD Compatible" msgstr "" #: plugins/yuv4mpeg/mpa_common.c:62 msgid "" "Make VCD compliant output. This forces layer II, 224 kbps and 44.1 KHz stereo" msgstr "" #: plugins/yuv4mpeg/mpa_common.c:200 #, c-format msgid "Bitrate %d kbps unsupported, switching to %d kbps" msgstr "" #: plugins/yuv4mpeg/mpa_common.c:256 #, c-format msgid "Samplerate %d unsupported, switching to %d" msgstr "" #: plugins/ffmpeg/e_ffmpeg.c:161 msgid "FFmpeg audio/video encoder" msgstr "" #: plugins/ffmpeg/e_ffmpeg.c:162 msgid "" "Plugin for encoding various audio/video formats with ffmpeg (http://www." "ffmpeg.org)." msgstr "" #: plugins/ffmpeg/params.h:33 plugins/ffmpeg/params.h:42 #: plugins/ffmpeg/codecs.c:35 plugins/ffmpeg/codecs.c:46 #: plugins/ffmpeg/codecs.c:57 plugins/ffmpeg/codecs.c:68 msgid "Bit rate (kbps)" msgstr "" #: plugins/ffmpeg/params.h:51 msgid "Bitrate tolerance (kbps)" msgstr "" #: plugins/ffmpeg/params.h:54 msgid "" "Number of bits the bitstream is allowed to diverge from the reference. " "Unused for constant quantizer encoding" msgstr "" #: plugins/ffmpeg/params.h:62 msgid "Motion estimation method" msgstr "" #: plugins/ffmpeg/params.h:66 msgid "Zero" msgstr "" #: plugins/ffmpeg/params.h:66 msgid "Phods" msgstr "" #: plugins/ffmpeg/params.h:66 msgid "Log" msgstr "" #: plugins/ffmpeg/params.h:67 msgid "X1" msgstr "" #: plugins/ffmpeg/params.h:67 msgid "Epzs" msgstr "" #: plugins/ffmpeg/params.h:67 msgid "Full" msgstr "" #: plugins/ffmpeg/params.h:74 msgid "GOP size (0 = intra only)" msgstr "" #: plugins/ffmpeg/params.h:85 msgid "Quantizer compression" msgstr "" #: plugins/ffmpeg/params.h:91 msgid "Amount of qscale change between easy & hard scenes" msgstr "" #: plugins/ffmpeg/params.h:98 msgid "Quantizer blur" msgstr "" #: plugins/ffmpeg/params.h:104 msgid "Amount of qscale smoothing over time" msgstr "" #: plugins/ffmpeg/params.h:111 msgid "Minimum quantizer scale" msgstr "" #: plugins/ffmpeg/params.h:122 msgid "Maximum quantizer scale" msgstr "" #: plugins/ffmpeg/params.h:133 msgid "Maximum quantizer difference" msgstr "" #: plugins/ffmpeg/params.h:138 msgid "Maximum quantizer difference between frames" msgstr "" #: plugins/ffmpeg/params.h:145 msgid "Max B-Frames" msgstr "" #: plugins/ffmpeg/params.h:150 msgid "Maximum number of B-frames between non B-frames" msgstr "" #: plugins/ffmpeg/params.h:157 msgid "B quantizer factor" msgstr "" #: plugins/ffmpeg/params.h:163 msgid "Quantizer factor between B-frames and non-B-frames" msgstr "" #: plugins/ffmpeg/params.h:170 msgid "Avoid B-frames in high motion scenes" msgstr "" #: plugins/ffmpeg/params.h:178 msgid "Luma elimination threshold" msgstr "" #: plugins/ffmpeg/params.h:183 msgid "" "Single coefficient elimination threshold for luminance. Negative values also " "consider dc coefficient. -4 is JVT recommendation" msgstr "" #: plugins/ffmpeg/params.h:191 msgid "Chroma elimination threshold" msgstr "" #: plugins/ffmpeg/params.h:196 msgid "" "Single coefficient elimination threshold for chrominamce. Negative values " "also consider dc coefficient. 7 is JVT recommendation" msgstr "" #: plugins/ffmpeg/params.h:204 msgid "Standards compliance" msgstr "" #: plugins/ffmpeg/params.h:209 msgid "" "2: Strictly conform to a older more strict version of the spec or reference " "software\n" "1: Strictly conform to all the things in the spec no matter what " "consequences\n" "0: Default\n" "-1: Allow unofficial extensions\n" "-2: Allow non standarized experimental things" msgstr "" #: plugins/ffmpeg/params.h:222 msgid "B quantizer offset" msgstr "" #: plugins/ffmpeg/params.h:228 msgid "" "Quantizer offset between B-frames and non-B-frames\n" "if > 0 then the last p frame quantizer will be used (q= lastp_q*factor" "+offset)\n" "if < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)" msgstr "" #: plugins/ffmpeg/params.h:240 msgid "Minimum bitrate (0 means arbitrary)" msgstr "" #: plugins/ffmpeg/params.h:250 msgid "Maximum bitrate (0 means arbitrary)" msgstr "" #: plugins/ffmpeg/params.h:257 msgid "RC buffer size" msgstr "" #: plugins/ffmpeg/params.h:260 msgid "" "Decoder bitstream buffer size in kbits. When encoding with max and/or min " "bitrate, this must be specified." msgstr "" #: plugins/ffmpeg/params.h:268 msgid "RC buffer aggressivity" msgstr "" #: plugins/ffmpeg/params.h:280 msgid "I quantizer factor" msgstr "" #: plugins/ffmpeg/params.h:286 msgid "" "Quantizer factor between P-frames and I-frames.\n" "If > 0 then the last P frame quantizer will be used (q= lastp_q*factor" "+offset).\n" "If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset)" msgstr "" #: plugins/ffmpeg/params.h:295 msgid "I quantizer offset" msgstr "" #: plugins/ffmpeg/params.h:301 msgid "Quantizer offset between P-frames and I-frames" msgstr "" #: plugins/ffmpeg/params.h:308 msgid "Initial RC complexity" msgstr "" #: plugins/ffmpeg/params.h:320 msgid "Luminance masking" msgstr "" #: plugins/ffmpeg/params.h:326 msgid "" "Encode very bright image parts with reduced quality. 0 means disabled, 0-0.3 " "is a sane range." msgstr "" #: plugins/ffmpeg/params.h:334 msgid "Temporary complexity masking" msgstr "" #: plugins/ffmpeg/params.h:340 msgid "" "Encode very fast moving image parts with reduced quality. 0 means disabled." msgstr "" #: plugins/ffmpeg/params.h:348 msgid "Spatial complexity masking" msgstr "" #: plugins/ffmpeg/params.h:354 msgid "" "Encode very complex image parts with reduced quality. 0 means disabled, 0-" "0.5 is a sane range." msgstr "" #: plugins/ffmpeg/params.h:362 msgid "Inter block masking" msgstr "" #: plugins/ffmpeg/params.h:368 msgid "" "Encode inter blocks with reduced quality (increases the quality of intra " "blocks). 0 means disabled, 1 will double the bits allocated for intra " "blocks." msgstr "" #: plugins/ffmpeg/params.h:376 msgid "Darkness masking" msgstr "" #: plugins/ffmpeg/params.h:382 msgid "" "Encode very dark image parts with reduced quality. 0 means disabled, 0-0.3 " "is a sane range." msgstr "" #: plugins/ffmpeg/params.h:389 msgid "Precition method" msgstr "" #: plugins/ffmpeg/params.h:393 msgid "Left" msgstr "" #: plugins/ffmpeg/params.h:393 msgid "Plane" msgstr "" #: plugins/ffmpeg/params.h:393 msgid "Median" msgstr "" #: plugins/ffmpeg/params.h:400 msgid "Minimum MB quantizer" msgstr "" #: plugins/ffmpeg/params.h:411 msgid "Maximum MB quantizer" msgstr "" #: plugins/ffmpeg/params.h:421 msgid "" "SAD: Sum of absolute differences\n" "SSE: Sum of squared errors\n" "SATD: Sum of absolute Hadamard transformed differences\n" "DCT: Sum of absolute DCT transformed differences\n" "PSNR: Sum of squared quantization errors (low quality)\n" "BIT: Number of bits needed for the block\n" "RD: Rate distortion optimal (slow)\n" "ZERO: 0\n" "VSAD: Sum of absolute vertical differences\n" "VSSE: Sum of squared vertical differences\n" "NSSE: Noise preserving sum of squared differences" msgstr "" #: plugins/ffmpeg/params.h:441 msgid "Motion estimation compare function." msgstr "" #: plugins/ffmpeg/params.h:448 msgid "Enable chroma ME compare" msgstr "" #: plugins/ffmpeg/params.h:457 msgid "Subpixel ME compare function" msgstr "" #: plugins/ffmpeg/params.h:461 msgid "Subpixel motion estimation compare function.\n" msgstr "" #: plugins/ffmpeg/params.h:468 msgid "Enable chroma subpixel ME compare" msgstr "" #: plugins/ffmpeg/params.h:477 msgid "MB compare function" msgstr "" #: plugins/ffmpeg/params.h:481 msgid "Macroblock compare function.\n" msgstr "" #: plugins/ffmpeg/params.h:487 msgid "Enable chroma macroblock ME compare" msgstr "" #: plugins/ffmpeg/params.h:496 msgid "ILDCT compare function" msgstr "" #: plugins/ffmpeg/params.h:500 msgid "Interlaced dct compare function.\n" msgstr "" #: plugins/ffmpeg/params.h:506 msgid "Enable chroma ILDCT ME compare" msgstr "" #: plugins/ffmpeg/params.h:515 msgid "ME diamond size & shape" msgstr "" #: plugins/ffmpeg/params.h:520 msgid "Motion estimation diamond size. Negative means shape adaptive." msgstr "" #: plugins/ffmpeg/params.h:526 msgid "Last predictor count" msgstr "" #: plugins/ffmpeg/params.h:531 msgid "" "Amount of motion predictors from the previous frame.\n" "0 (default)\n" "a Will use 2a+1 x 2a+1 macroblock square of motion vector predictors from " "the previous frame." msgstr "" #: plugins/ffmpeg/params.h:541 plugins/ffmpeg/codecs.c:149 msgid "ME pre-pass" msgstr "" #: plugins/ffmpeg/params.h:546 msgid "" "Motion estimation pre-pass\n" "0: disabled\n" "1: only after I-frames\n" "2: always" msgstr "" #: plugins/ffmpeg/params.h:556 msgid "ME pre-pass compare function" msgstr "" #: plugins/ffmpeg/params.h:560 msgid "Motion estimation pre-pass compare function.\n" msgstr "" #: plugins/ffmpeg/params.h:567 msgid "Enable chroma ME pre-pass compare" msgstr "" #: plugins/ffmpeg/params.h:578 msgid "ME pre-pass diamond size & shape" msgstr "" #: plugins/ffmpeg/params.h:583 msgid "Motion estimation pre-pass diamond size. Negative means shape adaptive." msgstr "" #: plugins/ffmpeg/params.h:590 msgid "Subpel ME quality" msgstr "" #: plugins/ffmpeg/params.h:595 msgid "" "Subpel motion estimation refinement quality (for qpel). Higher values mean " "higher quality but slower encoding." msgstr "" #: plugins/ffmpeg/params.h:603 msgid "Motion estimation range" msgstr "" #: plugins/ffmpeg/params.h:608 msgid "Motion estimation search range (0 means unlimited)" msgstr "" #: plugins/ffmpeg/params.h:615 msgid "MB decision mode" msgstr "" #: plugins/ffmpeg/params.h:620 msgid "Use compare function" msgstr "" #: plugins/ffmpeg/params.h:621 msgid "Fewest bits" msgstr "" #: plugins/ffmpeg/params.h:621 msgid "Rate distoration" msgstr "" #: plugins/ffmpeg/params.h:628 msgid "Scenechange threshold" msgstr "" #: plugins/ffmpeg/params.h:633 msgid "" "Threshold for scene change detection.\n" "Negative values mean more sensitivity (more keyframes)" msgstr "" #: plugins/ffmpeg/params.h:641 msgid "Minimum lagrange multiplier" msgstr "" #: plugins/ffmpeg/params.h:647 msgid "" "Minimum Lagrange multiplier for ratecontrol. Should possibly be the same as " "minimum quantizer scale." msgstr "" #: plugins/ffmpeg/params.h:655 msgid "Maximum lagrange multipler" msgstr "" #: plugins/ffmpeg/params.h:661 msgid "" "Maximum Lagrange multiplier for ratecontrol. Should possibly be the same as " "maximum quantizer scale." msgstr "" #: plugins/ffmpeg/params.h:668 msgid "Noise reduction" msgstr "" #: plugins/ffmpeg/params.h:679 msgid "Initial RC buffer occupancy" msgstr "" #: plugins/ffmpeg/params.h:682 msgid "" "Number of kilobits which should be loaded into the rc buffer before encoding " "starts. Must not be larger than RC buffer size" msgstr "" #: plugins/ffmpeg/params.h:693 msgid "Inter threshold" msgstr "" #: plugins/ffmpeg/params.h:702 msgid "Quantizer noise shaping" msgstr "" #: plugins/ffmpeg/params.h:707 msgid "" "Choose quantization such that noise will be masked by similar-frequency " "content in the image" msgstr "" #: plugins/ffmpeg/params.h:715 msgid "ME Theshold" msgstr "" #: plugins/ffmpeg/params.h:720 msgid "" "Motion estimation threshold. under which no motion estimation is performed, " "but instead the user specified motion vectors are used" msgstr "" #: plugins/ffmpeg/params.h:726 msgid "MB Theshold" msgstr "" #: plugins/ffmpeg/params.h:731 msgid "" "Macroblock threshold. under which the user specified macroblock types will " "be used" msgstr "" #: plugins/ffmpeg/params.h:737 msgid "NSSE weight" msgstr "" #: plugins/ffmpeg/params.h:740 msgid "" "Noise vs. SSE weight for the NSSE comparsion function. 0 is identical to SSE" msgstr "" #: plugins/ffmpeg/params.h:748 msgid "Border masking" msgstr "" #: plugins/ffmpeg/params.h:754 msgid "" "Encode image parts near the border with reduced quality. 0 means disabled" msgstr "" #: plugins/ffmpeg/params.h:761 msgid "Minimum MB lagrange multipler" msgstr "" #: plugins/ffmpeg/params.h:767 msgid "Minimum macroblock Lagrange multiplier." msgstr "" #: plugins/ffmpeg/params.h:773 msgid "Maximum MB lagrange multipler" msgstr "" #: plugins/ffmpeg/params.h:779 msgid "Maximum macroblock Lagrange multiplier." msgstr "" #: plugins/ffmpeg/params.h:786 msgid "ME penalty compensation" msgstr "" #: plugins/ffmpeg/params.h:794 msgid "Bidir refine" msgstr "" #: plugins/ffmpeg/params.h:804 msgid "BRD scale" msgstr "" #: plugins/ffmpeg/params.h:816 msgid "Scenechange factor" msgstr "" #: plugins/ffmpeg/params.h:819 msgid "Multiplied by qscale for each frame and added to scene_change_score" msgstr "" #: plugins/ffmpeg/params.h:831 msgid "" "Quantizer for fixed quality encoding. Lower means better, 1 is not " "recommended" msgstr "" #: plugins/ffmpeg/params.h:840 msgid "Use fixed quantizer" msgstr "" #: plugins/ffmpeg/params.h:843 msgid "Use fixed quality encoding" msgstr "" #: plugins/ffmpeg/params.h:850 msgid "4 MV per MB allowed" msgstr "" #: plugins/ffmpeg/params.h:853 msgid "" "Allow 4 motion vectors per macroblock (slightly better quality). Works " "better if MB decision mode is \"Fewest bits\" or \"Rate distoration\"." msgstr "" #: plugins/ffmpeg/params.h:860 msgid "Use qpel MC" msgstr "" #: plugins/ffmpeg/params.h:863 msgid "" "Use 1/4 pixel motion compensation. Warning: QPEL is not supported by all " "decoders." msgstr "" #: plugins/ffmpeg/params.h:870 msgid "Use global motion compensation" msgstr "" #: plugins/ffmpeg/params.h:873 msgid "Warning: GMC is not supported by all decoders" msgstr "" #: plugins/ffmpeg/params.h:880 msgid "Always try a MB with MV=<0,0>" msgstr "" #: plugins/ffmpeg/params.h:888 msgid "Use data partitioning" msgstr "" #: plugins/ffmpeg/params.h:891 msgid "" "Use data partitioning for more robustness if the video is for transmitting " "over unreliable channels" msgstr "" #: plugins/ffmpeg/params.h:899 msgid "Grayscale mode" msgstr "" #: plugins/ffmpeg/params.h:907 msgid "Don't draw edges" msgstr "" #: plugins/ffmpeg/params.h:916 msgid "Normalize adaptive quantization" msgstr "" #: plugins/ffmpeg/params.h:919 msgid "" "When using masking, try to adjust the per macroblock quantizers to maintain " "the desired average" msgstr "" #: plugins/ffmpeg/params.h:926 msgid "Use alternative scantable" msgstr "" #: plugins/ffmpeg/params.h:936 plugins/ffmpeg/params.h:945 msgid "Use trellis quantization" msgstr "" #: plugins/ffmpeg/params.h:939 plugins/ffmpeg/params.h:948 msgid "Use trellis quantization (improves quality)" msgstr "" #: plugins/ffmpeg/params.h:955 msgid "Use only bitexact stuff" msgstr "" #: plugins/ffmpeg/params.h:958 msgid "Use only bitexact stuff (except (i)dct)" msgstr "" #: plugins/ffmpeg/params.h:964 msgid "Advanced intra coding" msgstr "" #: plugins/ffmpeg/params.h:972 msgid "MPEG-4 AC prediction" msgstr "" #: plugins/ffmpeg/params.h:980 msgid "Unlimited motion vector" msgstr "" #: plugins/ffmpeg/params.h:988 msgid "CBP RD" msgstr "" #: plugins/ffmpeg/params.h:991 msgid "Use rate distortion optimization for cbp" msgstr "" #: plugins/ffmpeg/params.h:997 msgid "QP RD" msgstr "" #: plugins/ffmpeg/params.h:1000 msgid "Use rate distortion optimization for qp selection" msgstr "" #: plugins/ffmpeg/params.h:1006 msgid "Alternative inter vlc" msgstr "" #: plugins/ffmpeg/params.h:1015 msgid "OBMC" msgstr "" #: plugins/ffmpeg/params.h:1018 msgid "" "Overlapped block motion compensation (only supported with with simple MB " "decision)" msgstr "" #: plugins/ffmpeg/params.h:1024 msgid "Loop filter" msgstr "" #: plugins/ffmpeg/params.h:1032 msgid "H263P slice struct" msgstr "" #: plugins/ffmpeg/params.h:1041 msgid "Close all GOPs" msgstr "" #: plugins/ffmpeg/params.h:1049 msgid "Allow fast encoding" msgstr "" #: plugins/ffmpeg/params.h:1052 msgid "Allow non spec compliant speedup tricks" msgstr "" #: plugins/ffmpeg/params.h:1059 msgid "Strictly enforce GOP size" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:376 msgid "Audio codec not available in your libavcodec installation" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:385 msgid "avcodec_open failed for audio" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:419 msgid "Video codec not available in your libavcodec installation" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:480 msgid "avcodec_open failed for video" msgstr "" #: plugins/ffmpeg/ffmpeg_common.c:525 msgid "Initializing multiplexer failed" msgstr "" #: plugins/ffmpeg/codecs.c:78 msgid "Rate control" msgstr "" #: plugins/ffmpeg/codecs.c:92 msgid "Quantizer" msgstr "" #: plugins/ffmpeg/codecs.c:118 msgid "Frame types" msgstr "" #: plugins/ffmpeg/codecs.c:135 msgid "Motion estimation" msgstr "" #: plugins/ffmpeg/codecs.c:160 msgid "Qpel ME" msgstr "" #: plugins/ffmpeg/codecs.c:171 msgid "Masking" msgstr "" #: plugins/ffmpeg/codecs.c:185 msgid "Misc" msgstr "" #: plugins/ffmpeg/codecs.c:265 plugins/ffmpeg/codecs.c:270 msgid "16 bit PCM" msgstr "" #: plugins/ffmpeg/codecs.c:275 plugins/ffmpeg/codecs.c:280 msgid "8 bit PCM" msgstr "" #: plugins/ffmpeg/codecs.c:285 msgid "alaw" msgstr "" #: plugins/ffmpeg/codecs.c:290 msgid "mulaw" msgstr "" #: plugins/ffmpeg/codecs.c:295 msgid "AC3" msgstr "" #: plugins/ffmpeg/codecs.c:301 msgid "MPEG audio layer 2" msgstr "" #: plugins/ffmpeg/codecs.c:307 msgid "Windows media Audio 1" msgstr "" #: plugins/ffmpeg/codecs.c:313 msgid "Windows media Audio 2" msgstr "" #: plugins/ffmpeg/codecs.c:319 msgid "MPEG audio layer 3" msgstr "" #: plugins/ffmpeg/codecs.c:330 msgid "Motion JPEG" msgstr "" #: plugins/ffmpeg/codecs.c:337 msgid "MPEG-4" msgstr "" #: plugins/ffmpeg/codecs.c:344 msgid "Divx 3 compatible" msgstr "" #: plugins/ffmpeg/codecs.c:351 msgid "MPEG-1 Video" msgstr "" #: plugins/ffmpeg/codecs.c:358 msgid "MPEG-2 Video" msgstr "" #: plugins/ffmpeg/codecs.c:365 msgid "Flash 1" msgstr "" #: plugins/ffmpeg/codecs.c:372 msgid "WMV 1" msgstr "" #: plugins/ffmpeg/codecs.c:379 msgid "Real Video 1" msgstr "" #: plugins/ffmpeg/codecs.c:387 msgid "WMV 2" msgstr "" #: plugins/ffmpeg/codecs.c:596 #, c-format msgid "Audio codec %s is not supported by %s" msgstr "" #: plugins/ffmpeg/codecs.c:634 #, c-format msgid "Video codec %s is not supported by %s" msgstr "" #: plugins/ffmpeg/e_ffmpeg_audio.c:90 msgid "FFmpeg audio encoder" msgstr "" #: plugins/ffmpeg/e_ffmpeg_audio.c:91 msgid "" "Plugin for encoding various audio formats with ffmpeg (http://www.ffmpeg." "org)." msgstr "" #: plugins/ffmpeg/e_ffmpeg_video.c:64 msgid "FFmpeg video encoder" msgstr "" #: plugins/ffmpeg/e_ffmpeg_video.c:65 msgid "" "Plugin for encoding various video formats with ffmpeg (http://www.ffmpeg." "org)." msgstr "" #: lib/bgflac.c:200 msgid "Bits" msgstr "" #: lib/bgflac.c:207 msgid "Compression Level" msgstr "" #: lib/bgflac.c:212 msgid "" "0: Fastest encoding, biggest files\n" "8: Slowest encoding, smallest files" msgstr "" #: lib/bgshout.c:55 msgid "Server" msgstr "" #: lib/bgshout.c:61 msgid "Port" msgstr "" #: lib/bgshout.c:69 msgid "Mount" msgstr "" #: lib/bgshout.c:75 msgid "User" msgstr "" #: lib/bgshout.c:81 msgid "Password" msgstr "" #: lib/bgshout.c:86 msgid "Name" msgstr "" #: lib/bgshout.c:91 msgid "Description" msgstr "" #: lib/bgshout.c:148 #, c-format msgid "Connecting failed: %s" msgstr "" #: lib/bgshout.c:152 msgid "Connected to icecast server" msgstr "" bplaum-gmerlin-encoders-172394d/po/insert-header.sin000066400000000000000000000012401513225514200223640ustar00rootroot00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } bplaum-gmerlin-encoders-172394d/po/quot.sed000066400000000000000000000002311513225514200206030ustar00rootroot00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g bplaum-gmerlin-encoders-172394d/po/remove-potcdate.sin000066400000000000000000000006601513225514200227350ustar00rootroot00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } bplaum-gmerlin-encoders-172394d/update_copyright.sh000077500000000000000000000003661513225514200224220ustar00rootroot00000000000000#!/bin/sh NEW_YEAR=`date +%Y` OLD_YEAR=`echo "$NEW_YEAR - 1" | bc` OLD_YEARS="2001 - $OLD_YEAR" NEW_YEARS="2001 - $NEW_YEAR" echo "Replacing \"$OLD_YEARS\" with \"$NEW_YEARS\"" find . -name '*.[ch]' -exec sed -i "s/$OLD_YEARS/$NEW_YEARS/g" {} \; bplaum-gmerlin-encoders-172394d/utils/000077500000000000000000000000001513225514200176445ustar00rootroot00000000000000bplaum-gmerlin-encoders-172394d/utils/Makefile.am000066400000000000000000000000271513225514200216770ustar00rootroot00000000000000EXTRA_DIST = cpuinfo.c bplaum-gmerlin-encoders-172394d/utils/cpuinfo.c000066400000000000000000000150561513225514200214620ustar00rootroot00000000000000/***************************************************************** * gmerlin-encoders - encoder plugins for gmerlin * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * *****************************************************************/ /* * cpuinfo.c from the MPlayer project's TOOLS/ directory * * This program is used by the top level cpuinfo.sh script during ./configure * for systems which do not have /proc/cpuinfo. The output of this program is * formatted the same as 'cat /proc/cpuinfo'. * * NOTE: Only for the X86 cpu family. */ #include #include #include #include #include #ifdef __MINGW32__ #include void gettimeofday(struct timeval* t,void* timezone) { struct timeb timebuffer; ftime( &timebuffer ); t->tv_sec=timebuffer.time; t->tv_usec=1000*timebuffer.millitm; } #define MISSING_USLEEP #define sleep(t) _sleep(1000*t); #endif #ifdef M_UNIX typedef long long int64_t; #define MISSING_USLEEP #else #include #endif typedef struct cpuid_regs { unsigned int eax; unsigned int ebx; unsigned int ecx; unsigned int edx; } cpuid_regs_t; static cpuid_regs_t cpuid(int func) { cpuid_regs_t regs; #define CPUID ".byte 0x0f, 0xa2; " asm("push %%ebx; " "movl %4,%%eax; " CPUID "movl %%eax,%0; movl %%ebx,%1; movl %%ecx,%2; movl %%edx,%3;" "pop %%ebx" : "=m" (regs.eax), "=m" (regs.ebx), "=m" (regs.ecx), "=m" (regs.edx) : "g" (func) : "%eax", "%ecx", "%edx"); return regs; } static int64_t rdtsc(void) { unsigned int i, j; #define RDTSC ".byte 0x0f, 0x31; " asm(RDTSC : "=a"(i), "=d"(j) : ); return ((int64_t)j<<32) + (int64_t)i; } static void store32(char *d, unsigned int v) { d[0] = v & 0xff; d[1] = (v >> 8) & 0xff; d[2] = (v >> 16) & 0xff; d[3] = (v >> 24) & 0xff; } int main(int argc, char **argv) { cpuid_regs_t regs, regs_ext; char idstr[13]; unsigned max_cpuid; unsigned max_ext_cpuid; unsigned int amd_flags; unsigned int cpuType, cpuModel; char *model_name = "Unknown CPU"; int i; char processor_name[49]; regs = cpuid(0); max_cpuid = regs.eax; /* printf("%d CPUID function codes\n", max_cpuid+1); */ store32(idstr+0, regs.ebx); store32(idstr+4, regs.edx); store32(idstr+8, regs.ecx); idstr[12] = 0; printf("vendor_id\t: %s\n", idstr); if (strcmp(idstr, "GenuineIntel") == 0) model_name = "Unknown Intel CPU"; else if (strcmp(idstr, "AuthenticAMD") == 0) model_name = "Unknown AMD CPU"; regs_ext = cpuid((1<<31) + 0); max_ext_cpuid = regs_ext.eax; if (max_ext_cpuid >= (1<<31) + 1) { regs_ext = cpuid((1<<31) + 1); amd_flags = regs_ext.edx; if (max_ext_cpuid >= (1<<31) + 4) { for (i = 2; i <= 4; i++) { regs_ext = cpuid((1<<31) + i); store32(processor_name + (i-2)*16, regs_ext.eax); store32(processor_name + (i-2)*16 + 4, regs_ext.ebx); store32(processor_name + (i-2)*16 + 8, regs_ext.ecx); store32(processor_name + (i-2)*16 + 12, regs_ext.edx); } processor_name[48] = 0; model_name = processor_name; } } else { amd_flags = 0; } if (max_cpuid >= 1) { static struct { int bit; char *desc;; char *description; } cap[] = { { 0, "fpu", "Floating-point unit on-chip" }, { 1, "vme", "Virtual Mode Enhancements" }, { 2, "de", "Debugging Extension" }, { 3, "pse", "Page Size Extension" }, { 4, "tsc", "Time Stamp Counter" }, { 5, "msr", "Pentium Processor MSR" }, { 6, "pae", "Physical Address Extension" }, { 7, "mce", "Machine Check Exception" }, { 8, "cx8", "CMPXCHG8B Instruction Supported" }, { 9, "apic", "On-chip CPIC Hardware Enabled" }, { 11, "sep", "SYSENTER and SYSEXIT" }, { 12, "mtrr", "Memory Type Range Registers" }, { 13, "pge", "PTE Global Bit" }, { 14, "mca", "Machine Check Architecture" }, { 15, "cmov", "Conditional Move/Compare Instruction" }, { 16, "pat", "Page Attribute Table" }, { 17, "pse36", "Page Size Extension 36-bit" }, { 18, "psn", "Processor Serial Number" }, { 19, "cflsh", "CFLUSH instruction" }, { 21, "ds", "Debug Store" }, { 22, "acpi", "Thermal Monitor and Clock Ctrl" }, { 23, "mmx", "MMX Technology" }, { 24, "fxsr", "FXSAVE/FXRSTOR" }, { 25, "sse", "SSE Extensions" }, { 26, "sse2", "SSE2 Extensions" }, { 27, "ss", "Self Snoop" }, { 29, "tm", "Therm. Monitor" }, { -1 } }; static struct { int bit; char *desc;; char *description; } cap_amd[] = { { 22, "mmxext","MMX Technology (AMD Extensions)" }, { 30, "3dnowext","3Dnow! Extensions" }, { 31, "3dnow", "3Dnow!" }, { 32, "k6_mtrr", "Memory Type Range Registers" }, { -1 } }; int i; regs = cpuid(1); cpuType = (regs.eax >> 8) & 0xf; cpuModel = (regs.eax >> 4) & 0xf; if (cpuType == 0xf) cpuType = 0xf + ((regs.eax >> 20) & 0xf); // extended family if (cpuType == 0xf || cpuType == 6) cpuModel |= ((regs.eax >> 16) & 0xf) << 4; printf("cpu family\t: %d\n" "model\t\t: %d\n" "stepping\t: %d\n" , cpuType, cpuModel, regs.eax & 0xf); printf("flags\t\t:"); for (i = 0; cap[i].bit >= 0; i++) { if (regs.edx & (1 << cap[i].bit)) { printf(" %s", cap[i].desc); } } for (i = 0; cap_amd[i].bit >= 0; i++) { if (amd_flags & (1 << cap_amd[i].bit)) { printf(" %s", cap_amd[i].desc); } } printf("\n"); if (regs.edx & (1 << 4)) { int64_t tsc_start, tsc_end; struct timeval tv_start, tv_end; int usec_delay; tsc_start = rdtsc(); gettimeofday(&tv_start, NULL); #ifdef MISSING_USLEEP sleep(1); #else usleep(100000); #endif tsc_end = rdtsc(); gettimeofday(&tv_end, NULL); usec_delay = 1000000 * (tv_end.tv_sec - tv_start.tv_sec) + (tv_end.tv_usec - tv_start.tv_usec); printf("cpu MHz\t\t: %.3f\n", (double)(tsc_end-tsc_start) / usec_delay); } } printf("model name\t: %s\n", model_name); exit(0); }