File: e_ffmpeg_video.c

package info (click to toggle)
gmerlin-encoders 2.0.0~svn6278-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,076 kB
  • sloc: ansic: 15,264; sh: 662; makefile: 364; sed: 16
file content (98 lines) | stat: -rw-r--r-- 3,302 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*****************************************************************
 * gmerlin-encoders - encoder plugins for gmerlin
 *
 * Copyright (c) 2001 - 2012 Members of the Gmerlin project
 * gmerlin-general@lists.sourceforge.net
 * http://gmerlin.sourceforge.net
 *
 * 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 <http://www.gnu.org/licenses/>.
 * *****************************************************************/

#include <config.h>
#include <gmerlin/translation.h>

#include "ffmpeg_common.h"


static const ffmpeg_format_info_t formats[] =
  {
    {
      .name =       "MPEG-1 video",
      .short_name = "mpeg1video",
      .extension =  "m1v",
      .max_video_streams = 1,
      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG1VIDEO,
                                           AV_CODEC_ID_NONE },
      .flags = FLAG_CONSTANT_FRAMERATE | FLAG_PIPE,
    },
    {
      .name =       "MPEG-2 video",
      .short_name = "mpeg2video",
      .extension =  "m2v",
      .max_video_streams = 1,
      .video_codecs = (enum AVCodecID[]){  AV_CODEC_ID_MPEG2VIDEO,
                                         AV_CODEC_ID_NONE },
      .flags = FLAG_CONSTANT_FRAMERATE | FLAG_PIPE,
    },
    { /* End of formats */ }
  };

static void * create_ffmpeg()
  {
  return bg_ffmpeg_create(formats);
  }

const bg_encoder_plugin_t the_plugin =
  {
    .common =
    {
      BG_LOCALE,
      .name =           "e_ffmpeg_video",       /* Unique short name */
      .long_name =      TRS("FFmpeg video encoder"),
      .description =    TRS("Plugin for encoding various video formats with 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,
    },
    
    .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;