Hi,
august wrote:
[...]
> I guess that is what I don't understand. Why treat encoding differently
> than decoding?
Encoders have to fulfill one single goal: Produce a spec compliant file.
The available libraries (including libavformat) are very good at this.
Decoding is different: You must support all variants of media files, broken
encoders, truncated files, proprietary crap etc. Media file formats are a
desasterous mess. Then you must support input from other sources than
regular files and seek to random positions whenever possible. Quite a
different challenge :)
[...]
> Maybe I am just looking for symmetry where it is not actually there, but
> my dream is to have some API like gavl/gmerlin_avdecoder as a
> gavl/gmerlin_avencoder .
>
> Something like:
> -------------------------------------------------------
> bgav_t *outfile;
>
> bgav_open(outfile, video_format, audio_format);
>
> // do some setup stuff...
> bgav_endocode_params encode_params;
> encode_params.bitrate=2000;
> encode_params.iframe=30;
> encode_params.quality=0.4;
This will already fail because many of these parameters vary from codec to
codec. You must only try to support the parameters of both H.264 and Dirac
in the same struct to produce quite a mess :)
libgmerlin has a parameter setting mechanism where available parameters are
obtained at runtime from the plugin. Configuration happens mostly with GUI
widgets,
but they can also set from commandline arguments.
> bgav_set_encoding_params(outfile, encode_params);
>
>
> while( imaginary_loop ) {
> // generate audio/video in loop
> bgav_write_audio(outfile, audio_frame, audio_stream);
> bgav_write_video(outfile, video_frame, video_stream);
> }
Once you set up an encoding plugin properly, you'll have something this.
> // do some followup, shut things down
>
> bgav_close(outfile);
>
> ------------------------------------------------
>
>
> I assume that can be done with gmerlin in some other way. I've been
> looking into the source and doku for a while now, and admit I am slow,
Or the source is too complicated :)
> but any suggestions on where to look or how I could do that using the
> gmerlin plugin encoders?
These are basically the steps:
1. Create a configuration registry
2. Create a plugin registry
3. Load an encoder plugin
4. Open the encoder
5. Add audio and video streams
6. Set per-stream encoding parameters
7. Start the encoder
8. Write A/V frames in a loop
9. Clean up.
Burkhard
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general