6011
|
1 /*
|
|
2 * MOV, 3GP, MP4 muxer
|
|
3 * Copyright (c) 2003 Thomas Raivio
|
|
4 * Copyright (c) 2004 Gildas Bazin <gbazin at videolan dot org>
|
|
5 * Copyright (c) 2009 Baptiste Coudurier <baptiste dot coudurier at gmail dot com>
|
|
6 *
|
|
7 * This file is part of FFmpeg.
|
|
8 *
|
|
9 * FFmpeg is free software; you can redistribute it and/or
|
|
10 * modify it under the terms of the GNU Lesser General Public
|
|
11 * License as published by the Free Software Foundation; either
|
|
12 * version 2.1 of the License, or (at your option) any later version.
|
|
13 *
|
|
14 * FFmpeg is distributed in the hope that it will be useful,
|
|
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
17 * Lesser General Public License for more details.
|
|
18 *
|
|
19 * You should have received a copy of the GNU Lesser General Public
|
|
20 * License along with FFmpeg; if not, write to the Free Software
|
|
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
22 */
|
|
23
|
|
24 #ifndef AVFORMAT_MOVENC_H
|
|
25 #define AVFORMAT_MOVENC_H
|
|
26
|
|
27 #include "avformat.h"
|
|
28
|
|
29 #define MOV_INDEX_CLUSTER_SIZE 16384
|
|
30 #define MOV_TIMESCALE 1000
|
|
31
|
|
32 #define MODE_MP4 0x01
|
|
33 #define MODE_MOV 0x02
|
|
34 #define MODE_3GP 0x04
|
|
35 #define MODE_PSP 0x08 // example working PSP command line:
|
|
36 // ffmpeg -i testinput.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4
|
|
37 #define MODE_3G2 0x10
|
|
38 #define MODE_IPOD 0x20
|
|
39
|
|
40 typedef struct MOVIentry {
|
|
41 unsigned int size;
|
|
42 uint64_t pos;
|
|
43 unsigned int samplesInChunk;
|
|
44 unsigned int entries;
|
|
45 int cts;
|
|
46 int64_t dts;
|
|
47 #define MOV_SYNC_SAMPLE 0x0001
|
|
48 #define MOV_PARTIAL_SYNC_SAMPLE 0x0002
|
|
49 uint32_t flags;
|
|
50 } MOVIentry;
|
|
51
|
|
52 typedef struct MOVIndex {
|
|
53 int mode;
|
|
54 int entry;
|
|
55 unsigned timescale;
|
|
56 uint64_t time;
|
|
57 int64_t trackDuration;
|
|
58 long sampleCount;
|
|
59 long sampleSize;
|
|
60 int hasKeyframes;
|
|
61 #define MOV_TRACK_CTTS 0x0001
|
|
62 #define MOV_TRACK_STPS 0x0002
|
|
63 uint32_t flags;
|
|
64 int language;
|
|
65 int trackID;
|
|
66 int tag; ///< stsd fourcc
|
|
67 AVCodecContext *enc;
|
|
68
|
|
69 int vosLen;
|
|
70 uint8_t *vosData;
|
|
71 MOVIentry *cluster;
|
|
72 int audio_vbr;
|
|
73 int height; ///< active picture (w/o VBI) height for D-10/IMX
|
|
74 uint32_t tref_tag;
|
|
75 int tref_id; ///< trackID of the referenced track
|
|
76 } MOVTrack;
|
|
77
|
|
78 typedef struct MOVMuxContext {
|
|
79 int mode;
|
|
80 int64_t time;
|
|
81 int nb_streams;
|
|
82 int chapter_track; ///< qt chapter track number
|
|
83 int64_t mdat_pos;
|
|
84 uint64_t mdat_size;
|
|
85 MOVTrack *tracks;
|
|
86 } MOVMuxContext;
|
|
87
|
|
88 #endif /* AVFORMAT_MOVENC_H */
|