ffmpeg2theora.h 2.57 KB
Newer Older
Jan Gerber's avatar
Jan Gerber committed
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef _F2T_FFMPEG2THEORA_H_
#define _F2T_FFMPEG2THEORA_H_

#include "subtitles.h"

typedef struct ff2theora_subtitle{
    char *text;
    size_t len;
    double t0;
    double t1;
} ff2theora_subtitle;

typedef struct ff2theora_kate_stream{
14
    /* this block valid for subtitles loaded from a file */
Jan Gerber's avatar
Jan Gerber committed
15
16
17
    const char *filename;
    size_t num_subtitles;
    ff2theora_subtitle *subtitles;
18
19
20
21
22

    /* this block valid for subtitles coming from the source video */
    int stream_index;

    /* this block valid for all subtitle sources */
Jan Gerber's avatar
Jan Gerber committed
23
    size_t subtitles_count; /* total subtitles output so far */
24
    char *subtitles_encoding;
Jan Gerber's avatar
Jan Gerber committed
25
26
27
28
29
30
31
32
33
34
    char subtitles_language[16];
    char subtitles_category[16];
} ff2theora_kate_stream;

typedef struct ff2theora{
    AVFormatContext *context;
    int video_index;
    int audio_index;

    int deinterlace;
Jan Gerber's avatar
Jan Gerber committed
35
36
    int soft_target;
    int buf_delay;
Jan Gerber's avatar
Jan Gerber committed
37
    int vhook;
38
    int disable_video;
Jan Gerber's avatar
Jan Gerber committed
39
    int no_upscaling;
40

Jan Gerber's avatar
Jan Gerber committed
41
42
43
44
45
46
47
48
    int audiostream;
    int sample_rate;
    int channels;
    int disable_audio;
    float audio_quality;
    int audio_bitrate;
    int preset;

49
50
    int disable_subtitles;

Jan Gerber's avatar
Jan Gerber committed
51
    int videostream;
Jan Gerber's avatar
Jan Gerber committed
52
53
54
55
56
57
58
59
    int picture_width;
    int picture_height;
    double fps;
    struct SwsContext *sws_colorspace_ctx; /* for image resampling/resizing */
    struct SwsContext *sws_scale_ctx; /* for image resampling/resizing */
    ReSampleContext *audio_resample_ctx;
    ogg_int32_t aspect_numerator;
    ogg_int32_t aspect_denominator;
Jan Gerber's avatar
Jan Gerber committed
60
    double frame_aspect;
61
62
    int max_x;
    int max_y;
Jan Gerber's avatar
Jan Gerber committed
63
64
65
66

    int pix_fmt;
    int video_quality;
    int video_bitrate;
Jan Gerber's avatar
Jan Gerber committed
67
    ogg_uint32_t keyint;
Jan Gerber's avatar
Jan Gerber committed
68
69
    char pp_mode[255];

70
    AVRational force_input_fps;
Jan Gerber's avatar
Jan Gerber committed
71
72
73
74
75
76
77
78
79
80
81
82
83
84
    int sync;

    /* cropping */
    int frame_topBand;
    int frame_bottomBand;
    int frame_leftBand;
    int frame_rightBand;

    int frame_width;
    int frame_height;
    int frame_x_offset;
    int frame_y_offset;

    /* In seconds */
85
86
    double start_time;
    double end_time;
Jan Gerber's avatar
Jan Gerber committed
87
88

    AVRational framerate_new;
Jan Gerber's avatar
Jan Gerber committed
89
    AVRational framerate;
Jan Gerber's avatar
Jan Gerber committed
90
91
92
93
94
95
96

    double pts_offset; /* between given input pts and calculated output pts */
    int64_t frame_count; /* total video frames output so far */
    int64_t sample_count; /* total audio samples output so far */

    size_t n_kate_streams;
    ff2theora_kate_stream *kate_streams;
97
98

    int ignore_non_utf8;
Jan Gerber's avatar
Jan Gerber committed
99
100
101
102
103
104
105
106
107
    // ffmpeg2theora --nosound -f dv -H 32000 -S 0 -v 8 -x 384 -y 288 -G 1.5 input.dv
    double video_gamma;
    double video_bright;
    double video_contr;
    double video_satur;
    int y_lut_used;
    int uv_lut_used;
    unsigned char y_lut[256];
    unsigned char uv_lut[256];
Jan Gerber's avatar
Jan Gerber committed
108

Jan Gerber's avatar
Jan Gerber committed
109
110
111
112
}
*ff2theora;

#endif