5f2065e6392ea9c9e0573bf4203c8f2a89a548a1
[libav.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 avio_flush(s->pb);
30 return 0;
31 }
32
33 /* Note: Do not forget to add new entries to the Makefile as well. */
34
35 #if CONFIG_AC3_MUXER
36 AVOutputFormat ff_ac3_muxer = {
37 .name = "ac3",
38 .long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
39 .mime_type = "audio/x-ac3",
40 .extensions = "ac3",
41 .audio_codec = CODEC_ID_AC3,
42 .video_codec = CODEC_ID_NONE,
43 .write_packet = ff_raw_write_packet,
44 .flags= AVFMT_NOTIMESTAMPS,
45 };
46 #endif
47
48 #if CONFIG_DIRAC_MUXER
49 AVOutputFormat ff_dirac_muxer = {
50 .name = "dirac",
51 .long_name = NULL_IF_CONFIG_SMALL("raw Dirac"),
52 .extensions = "drc",
53 .audio_codec = CODEC_ID_NONE,
54 .video_codec = CODEC_ID_DIRAC,
55 .write_packet = ff_raw_write_packet,
56 .flags= AVFMT_NOTIMESTAMPS,
57 };
58 #endif
59
60 #if CONFIG_DNXHD_MUXER
61 AVOutputFormat ff_dnxhd_muxer = {
62 .name = "dnxhd",
63 .long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
64 .extensions = "dnxhd",
65 .audio_codec = CODEC_ID_NONE,
66 .video_codec = CODEC_ID_DNXHD,
67 .write_packet = ff_raw_write_packet,
68 .flags= AVFMT_NOTIMESTAMPS,
69 };
70 #endif
71
72 #if CONFIG_DTS_MUXER
73 AVOutputFormat ff_dts_muxer = {
74 .name = "dts",
75 .long_name = NULL_IF_CONFIG_SMALL("raw DTS"),
76 .mime_type = "audio/x-dca",
77 .extensions = "dts",
78 .audio_codec = CODEC_ID_DTS,
79 .video_codec = CODEC_ID_NONE,
80 .write_packet = ff_raw_write_packet,
81 .flags= AVFMT_NOTIMESTAMPS,
82 };
83 #endif
84
85 #if CONFIG_EAC3_MUXER
86 AVOutputFormat ff_eac3_muxer = {
87 .name = "eac3",
88 .long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
89 .mime_type = "audio/x-eac3",
90 .extensions = "eac3",
91 .audio_codec = CODEC_ID_EAC3,
92 .video_codec = CODEC_ID_NONE,
93 .write_packet = ff_raw_write_packet,
94 .flags= AVFMT_NOTIMESTAMPS,
95 };
96 #endif
97
98 #if CONFIG_G722_MUXER
99 AVOutputFormat ff_g722_muxer = {
100 .name = "g722",
101 .long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
102 .mime_type = "audio/G722",
103 .extensions = "g722",
104 .audio_codec = CODEC_ID_ADPCM_G722,
105 .video_codec = CODEC_ID_NONE,
106 .write_packet = ff_raw_write_packet,
107 .flags= AVFMT_NOTIMESTAMPS,
108 };
109 #endif
110
111 #if CONFIG_H261_MUXER
112 AVOutputFormat ff_h261_muxer = {
113 .name = "h261",
114 .long_name = NULL_IF_CONFIG_SMALL("raw H.261"),
115 .mime_type = "video/x-h261",
116 .extensions = "h261",
117 .audio_codec = CODEC_ID_NONE,
118 .video_codec = CODEC_ID_H261,
119 .write_packet = ff_raw_write_packet,
120 .flags= AVFMT_NOTIMESTAMPS,
121 };
122 #endif
123
124 #if CONFIG_H263_MUXER
125 AVOutputFormat ff_h263_muxer = {
126 .name = "h263",
127 .long_name = NULL_IF_CONFIG_SMALL("raw H.263"),
128 .mime_type = "video/x-h263",
129 .extensions = "h263",
130 .audio_codec = CODEC_ID_NONE,
131 .video_codec = CODEC_ID_H263,
132 .write_packet = ff_raw_write_packet,
133 .flags= AVFMT_NOTIMESTAMPS,
134 };
135 #endif
136
137 #if CONFIG_H264_MUXER
138 AVOutputFormat ff_h264_muxer = {
139 .name = "h264",
140 .long_name = NULL_IF_CONFIG_SMALL("raw H.264 video format"),
141 .extensions = "h264",
142 .audio_codec = CODEC_ID_NONE,
143 .video_codec = CODEC_ID_H264,
144 .write_packet = ff_raw_write_packet,
145 .flags= AVFMT_NOTIMESTAMPS,
146 };
147 #endif
148
149 #if CONFIG_CAVSVIDEO_MUXER
150 AVOutputFormat ff_cavsvideo_muxer = {
151 .name = "cavsvideo",
152 .long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
153 .extensions = "cavs",
154 .audio_codec = CODEC_ID_NONE,
155 .video_codec = CODEC_ID_CAVS,
156 .write_packet = ff_raw_write_packet,
157 .flags= AVFMT_NOTIMESTAMPS,
158 };
159 #endif
160
161 #if CONFIG_M4V_MUXER
162 AVOutputFormat ff_m4v_muxer = {
163 .name = "m4v",
164 .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
165 .extensions = "m4v",
166 .audio_codec = CODEC_ID_NONE,
167 .video_codec = CODEC_ID_MPEG4,
168 .write_packet = ff_raw_write_packet,
169 .flags= AVFMT_NOTIMESTAMPS,
170 };
171 #endif
172
173 #if CONFIG_MJPEG_MUXER
174 AVOutputFormat ff_mjpeg_muxer = {
175 .name = "mjpeg",
176 .long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
177 .mime_type = "video/x-mjpeg",
178 .extensions = "mjpg,mjpeg",
179 .audio_codec = CODEC_ID_NONE,
180 .video_codec = CODEC_ID_MJPEG,
181 .write_packet = ff_raw_write_packet,
182 .flags= AVFMT_NOTIMESTAMPS,
183 };
184 #endif
185
186 #if CONFIG_MLP_MUXER
187 AVOutputFormat ff_mlp_muxer = {
188 .name = "mlp",
189 .long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
190 .extensions = "mlp",
191 .audio_codec = CODEC_ID_MLP,
192 .video_codec = CODEC_ID_NONE,
193 .write_packet = ff_raw_write_packet,
194 .flags= AVFMT_NOTIMESTAMPS,
195 };
196 #endif
197
198 #if CONFIG_SRT_MUXER
199 AVOutputFormat ff_srt_muxer = {
200 .name = "srt",
201 .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle format"),
202 .mime_type = "application/x-subrip",
203 .extensions = "srt",
204 .write_packet = ff_raw_write_packet,
205 .flags = AVFMT_NOTIMESTAMPS,
206 .subtitle_codec = CODEC_ID_SRT,
207 };
208 #endif
209
210 #if CONFIG_TRUEHD_MUXER
211 AVOutputFormat ff_truehd_muxer = {
212 .name = "truehd",
213 .long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
214 .extensions = "thd",
215 .audio_codec = CODEC_ID_TRUEHD,
216 .video_codec = CODEC_ID_NONE,
217 .write_packet = ff_raw_write_packet,
218 .flags= AVFMT_NOTIMESTAMPS,
219 };
220 #endif
221
222 #if CONFIG_MPEG1VIDEO_MUXER
223 AVOutputFormat ff_mpeg1video_muxer = {
224 .name = "mpeg1video",
225 .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
226 .mime_type = "video/x-mpeg",
227 .extensions = "mpg,mpeg,m1v",
228 .audio_codec = CODEC_ID_NONE,
229 .video_codec = CODEC_ID_MPEG1VIDEO,
230 .write_packet = ff_raw_write_packet,
231 .flags= AVFMT_NOTIMESTAMPS,
232 };
233 #endif
234
235 #if CONFIG_MPEG2VIDEO_MUXER
236 AVOutputFormat ff_mpeg2video_muxer = {
237 .name = "mpeg2video",
238 .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
239 .extensions = "m2v",
240 .audio_codec = CODEC_ID_NONE,
241 .video_codec = CODEC_ID_MPEG2VIDEO,
242 .write_packet = ff_raw_write_packet,
243 .flags= AVFMT_NOTIMESTAMPS,
244 };
245 #endif
246
247 #if CONFIG_RAWVIDEO_MUXER
248 AVOutputFormat ff_rawvideo_muxer = {
249 .name = "rawvideo",
250 .long_name = NULL_IF_CONFIG_SMALL("raw video format"),
251 .extensions = "yuv,rgb",
252 .audio_codec = CODEC_ID_NONE,
253 .video_codec = CODEC_ID_RAWVIDEO,
254 .write_packet = ff_raw_write_packet,
255 .flags= AVFMT_NOTIMESTAMPS,
256 };
257 #endif