cmdutils: allow matching by metadata in stream specifiers
[ffmpeg.git] / libavformat / rawenc.c
1 /*
2  * RAW muxers
3  * Copyright (c) 2001 Fabrice Bellard
4  * Copyright (c) 2005 Alex Beregszaszi
5  *
6  * This file is part of Libav.
7  *
8  * Libav is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * Libav is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with Libav; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22
23 #include "avformat.h"
24 #include "rawenc.h"
25
26 int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
27 {
28     avio_write(s->pb, pkt->data, pkt->size);
29     return 0;
30 }
31
32 /* Note: Do not forget to add new entries to the Makefile as well. */
33
34 #if CONFIG_AC3_MUXER
35 AVOutputFormat ff_ac3_muxer = {
36     .name              = "ac3",
37     .long_name         = NULL_IF_CONFIG_SMALL("raw AC-3"),
38     .mime_type         = "audio/x-ac3",
39     .extensions        = "ac3",
40     .audio_codec       = AV_CODEC_ID_AC3,
41     .video_codec       = AV_CODEC_ID_NONE,
42     .write_packet      = ff_raw_write_packet,
43     .flags             = AVFMT_NOTIMESTAMPS,
44 };
45 #endif
46
47 #if CONFIG_ADX_MUXER
48 AVOutputFormat ff_adx_muxer = {
49     .name              = "adx",
50     .long_name         = NULL_IF_CONFIG_SMALL("CRI ADX"),
51     .extensions        = "adx",
52     .audio_codec       = AV_CODEC_ID_ADPCM_ADX,
53     .video_codec       = AV_CODEC_ID_NONE,
54     .write_packet      = ff_raw_write_packet,
55     .flags             = AVFMT_NOTIMESTAMPS,
56 };
57 #endif
58
59 #if CONFIG_CAVSVIDEO_MUXER
60 AVOutputFormat ff_cavsvideo_muxer = {
61     .name              = "cavsvideo",
62     .long_name         = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
63     .extensions        = "cavs",
64     .audio_codec       = AV_CODEC_ID_NONE,
65     .video_codec       = AV_CODEC_ID_CAVS,
66     .write_packet      = ff_raw_write_packet,
67     .flags             = AVFMT_NOTIMESTAMPS,
68 };
69 #endif
70
71 #if CONFIG_DIRAC_MUXER
72 AVOutputFormat ff_dirac_muxer = {
73     .name              = "dirac",
74     .long_name         = NULL_IF_CONFIG_SMALL("raw Dirac"),
75     .extensions        = "drc",
76     .audio_codec       = AV_CODEC_ID_NONE,
77     .video_codec       = AV_CODEC_ID_DIRAC,
78     .write_packet      = ff_raw_write_packet,
79     .flags             = AVFMT_NOTIMESTAMPS,
80 };
81 #endif
82
83 #if CONFIG_DNXHD_MUXER
84 AVOutputFormat ff_dnxhd_muxer = {
85     .name              = "dnxhd",
86     .long_name         = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
87     .extensions        = "dnxhd",
88     .audio_codec       = AV_CODEC_ID_NONE,
89     .video_codec       = AV_CODEC_ID_DNXHD,
90     .write_packet      = ff_raw_write_packet,
91     .flags             = AVFMT_NOTIMESTAMPS,
92 };
93 #endif
94
95 #if CONFIG_DTS_MUXER
96 AVOutputFormat ff_dts_muxer = {
97     .name              = "dts",
98     .long_name         = NULL_IF_CONFIG_SMALL("raw DTS"),
99     .mime_type         = "audio/x-dca",
100     .extensions        = "dts",
101     .audio_codec       = AV_CODEC_ID_DTS,
102     .video_codec       = AV_CODEC_ID_NONE,
103     .write_packet      = ff_raw_write_packet,
104     .flags             = AVFMT_NOTIMESTAMPS,
105 };
106 #endif
107
108 #if CONFIG_EAC3_MUXER
109 AVOutputFormat ff_eac3_muxer = {
110     .name              = "eac3",
111     .long_name         = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
112     .mime_type         = "audio/x-eac3",
113     .extensions        = "eac3",
114     .audio_codec       = AV_CODEC_ID_EAC3,
115     .video_codec       = AV_CODEC_ID_NONE,
116     .write_packet      = ff_raw_write_packet,
117     .flags             = AVFMT_NOTIMESTAMPS,
118 };
119 #endif
120
121 #if CONFIG_G722_MUXER
122 AVOutputFormat ff_g722_muxer = {
123     .name              = "g722",
124     .long_name         = NULL_IF_CONFIG_SMALL("raw G.722"),
125     .mime_type         = "audio/G722",
126     .extensions        = "g722",
127     .audio_codec       = AV_CODEC_ID_ADPCM_G722,
128     .video_codec       = AV_CODEC_ID_NONE,
129     .write_packet      = ff_raw_write_packet,
130     .flags             = AVFMT_NOTIMESTAMPS,
131 };
132 #endif
133
134 #if CONFIG_H261_MUXER
135 AVOutputFormat ff_h261_muxer = {
136     .name              = "h261",
137     .long_name         = NULL_IF_CONFIG_SMALL("raw H.261"),
138     .mime_type         = "video/x-h261",
139     .extensions        = "h261",
140     .audio_codec       = AV_CODEC_ID_NONE,
141     .video_codec       = AV_CODEC_ID_H261,
142     .write_packet      = ff_raw_write_packet,
143     .flags             = AVFMT_NOTIMESTAMPS,
144 };
145 #endif
146
147 #if CONFIG_H263_MUXER
148 AVOutputFormat ff_h263_muxer = {
149     .name              = "h263",
150     .long_name         = NULL_IF_CONFIG_SMALL("raw H.263"),
151     .mime_type         = "video/x-h263",
152     .extensions        = "h263",
153     .audio_codec       = AV_CODEC_ID_NONE,
154     .video_codec       = AV_CODEC_ID_H263,
155     .write_packet      = ff_raw_write_packet,
156     .flags             = AVFMT_NOTIMESTAMPS,
157 };
158 #endif
159
160 #if CONFIG_H264_MUXER
161 AVOutputFormat ff_h264_muxer = {
162     .name              = "h264",
163     .long_name         = NULL_IF_CONFIG_SMALL("raw H.264 video"),
164     .extensions        = "h264",
165     .audio_codec       = AV_CODEC_ID_NONE,
166     .video_codec       = AV_CODEC_ID_H264,
167     .write_packet      = ff_raw_write_packet,
168     .flags             = AVFMT_NOTIMESTAMPS,
169 };
170 #endif
171
172 #if CONFIG_HEVC_MUXER
173 AVOutputFormat ff_hevc_muxer = {
174     .name              = "hevc",
175     .long_name         = NULL_IF_CONFIG_SMALL("raw HEVC video"),
176     .extensions        = "hevc",
177     .audio_codec       = AV_CODEC_ID_NONE,
178     .video_codec       = AV_CODEC_ID_HEVC,
179     .write_packet      = ff_raw_write_packet,
180     .flags             = AVFMT_NOTIMESTAMPS,
181 };
182 #endif
183
184 #if CONFIG_M4V_MUXER
185 AVOutputFormat ff_m4v_muxer = {
186     .name              = "m4v",
187     .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
188     .extensions        = "m4v",
189     .audio_codec       = AV_CODEC_ID_NONE,
190     .video_codec       = AV_CODEC_ID_MPEG4,
191     .write_packet      = ff_raw_write_packet,
192     .flags             = AVFMT_NOTIMESTAMPS,
193 };
194 #endif
195
196 #if CONFIG_MJPEG_MUXER
197 AVOutputFormat ff_mjpeg_muxer = {
198     .name              = "mjpeg",
199     .long_name         = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
200     .mime_type         = "video/x-mjpeg",
201     .extensions        = "mjpg,mjpeg",
202     .audio_codec       = AV_CODEC_ID_NONE,
203     .video_codec       = AV_CODEC_ID_MJPEG,
204     .write_packet      = ff_raw_write_packet,
205     .flags             = AVFMT_NOTIMESTAMPS,
206 };
207 #endif
208
209 #if CONFIG_MLP_MUXER
210 AVOutputFormat ff_mlp_muxer = {
211     .name              = "mlp",
212     .long_name         = NULL_IF_CONFIG_SMALL("raw MLP"),
213     .extensions        = "mlp",
214     .audio_codec       = AV_CODEC_ID_MLP,
215     .video_codec       = AV_CODEC_ID_NONE,
216     .write_packet      = ff_raw_write_packet,
217     .flags             = AVFMT_NOTIMESTAMPS,
218 };
219 #endif
220
221 #if CONFIG_MPEG1VIDEO_MUXER
222 AVOutputFormat ff_mpeg1video_muxer = {
223     .name              = "mpeg1video",
224     .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
225     .mime_type         = "video/x-mpeg",
226     .extensions        = "mpg,mpeg,m1v",
227     .audio_codec       = AV_CODEC_ID_NONE,
228     .video_codec       = AV_CODEC_ID_MPEG1VIDEO,
229     .write_packet      = ff_raw_write_packet,
230     .flags             = AVFMT_NOTIMESTAMPS,
231 };
232 #endif
233
234 #if CONFIG_MPEG2VIDEO_MUXER
235 AVOutputFormat ff_mpeg2video_muxer = {
236     .name              = "mpeg2video",
237     .long_name         = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
238     .extensions        = "m2v",
239     .audio_codec       = AV_CODEC_ID_NONE,
240     .video_codec       = AV_CODEC_ID_MPEG2VIDEO,
241     .write_packet      = ff_raw_write_packet,
242     .flags             = AVFMT_NOTIMESTAMPS,
243 };
244 #endif
245
246 #if CONFIG_RAWVIDEO_MUXER
247 AVOutputFormat ff_rawvideo_muxer = {
248     .name              = "rawvideo",
249     .long_name         = NULL_IF_CONFIG_SMALL("raw video"),
250     .extensions        = "yuv,rgb",
251     .audio_codec       = AV_CODEC_ID_NONE,
252     .video_codec       = AV_CODEC_ID_RAWVIDEO,
253     .write_packet      = ff_raw_write_packet,
254     .flags             = AVFMT_NOTIMESTAMPS,
255 };
256 #endif
257
258 #if CONFIG_SRT_MUXER
259 AVOutputFormat ff_srt_muxer = {
260     .name              = "srt",
261     .long_name         = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
262     .mime_type         = "application/x-subrip",
263     .extensions        = "srt",
264     .write_packet      = ff_raw_write_packet,
265     .flags             = AVFMT_NOTIMESTAMPS,
266     .subtitle_codec    = AV_CODEC_ID_SRT,
267 };
268 #endif
269
270 #if CONFIG_TRUEHD_MUXER
271 AVOutputFormat ff_truehd_muxer = {
272     .name              = "truehd",
273     .long_name         = NULL_IF_CONFIG_SMALL("raw TrueHD"),
274     .extensions        = "thd",
275     .audio_codec       = AV_CODEC_ID_TRUEHD,
276     .video_codec       = AV_CODEC_ID_NONE,
277     .write_packet      = ff_raw_write_packet,
278     .flags             = AVFMT_NOTIMESTAMPS,
279 };
280 #endif