libavformat/rawenc.c
Go to the documentation of this file.
1 /*
2  * RAW muxers
3  * Copyright (c) 2001 Fabrice Bellard
4  * Copyright (c) 2005 Alex Beregszaszi
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg 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  * FFmpeg 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 FFmpeg; 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 
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_G723_1_MUXER
135 AVOutputFormat ff_g723_1_muxer = {
136  .name = "g723_1",
137  .long_name = NULL_IF_CONFIG_SMALL("raw G.723.1"),
138  .mime_type = "audio/g723",
139  .extensions = "tco,rco",
140  .audio_codec = AV_CODEC_ID_G723_1,
141  .video_codec = AV_CODEC_ID_NONE,
142  .write_packet = ff_raw_write_packet,
143  .flags = AVFMT_NOTIMESTAMPS,
144 };
145 #endif
146 
147 #if CONFIG_H261_MUXER
148 AVOutputFormat ff_h261_muxer = {
149  .name = "h261",
150  .long_name = NULL_IF_CONFIG_SMALL("raw H.261"),
151  .mime_type = "video/x-h261",
152  .extensions = "h261",
153  .audio_codec = AV_CODEC_ID_NONE,
154  .video_codec = AV_CODEC_ID_H261,
155  .write_packet = ff_raw_write_packet,
156  .flags = AVFMT_NOTIMESTAMPS,
157 };
158 #endif
159 
160 #if CONFIG_H263_MUXER
161 AVOutputFormat ff_h263_muxer = {
162  .name = "h263",
163  .long_name = NULL_IF_CONFIG_SMALL("raw H.263"),
164  .mime_type = "video/x-h263",
165  .extensions = "h263",
166  .audio_codec = AV_CODEC_ID_NONE,
167  .video_codec = AV_CODEC_ID_H263,
168  .write_packet = ff_raw_write_packet,
169  .flags = AVFMT_NOTIMESTAMPS,
170 };
171 #endif
172 
173 #if CONFIG_H264_MUXER
174 AVOutputFormat ff_h264_muxer = {
175  .name = "h264",
176  .long_name = NULL_IF_CONFIG_SMALL("raw H.264 video"),
177  .extensions = "h264",
178  .audio_codec = AV_CODEC_ID_NONE,
179  .video_codec = AV_CODEC_ID_H264,
180  .write_packet = ff_raw_write_packet,
181  .flags = AVFMT_NOTIMESTAMPS,
182 };
183 #endif
184 
185 #if CONFIG_M4V_MUXER
186 AVOutputFormat ff_m4v_muxer = {
187  .name = "m4v",
188  .long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
189  .extensions = "m4v",
190  .audio_codec = AV_CODEC_ID_NONE,
191  .video_codec = AV_CODEC_ID_MPEG4,
192  .write_packet = ff_raw_write_packet,
193  .flags = AVFMT_NOTIMESTAMPS,
194 };
195 #endif
196 
197 #if CONFIG_MJPEG_MUXER
198 AVOutputFormat ff_mjpeg_muxer = {
199  .name = "mjpeg",
200  .long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
201  .mime_type = "video/x-mjpeg",
202  .extensions = "mjpg,mjpeg",
203  .audio_codec = AV_CODEC_ID_NONE,
204  .video_codec = AV_CODEC_ID_MJPEG,
205  .write_packet = ff_raw_write_packet,
206  .flags = AVFMT_NOTIMESTAMPS,
207 };
208 #endif
209 
210 #if CONFIG_MLP_MUXER
211 AVOutputFormat ff_mlp_muxer = {
212  .name = "mlp",
213  .long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
214  .extensions = "mlp",
215  .audio_codec = AV_CODEC_ID_MLP,
216  .video_codec = AV_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 = AV_CODEC_ID_NONE,
229  .video_codec = AV_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 = AV_CODEC_ID_NONE,
241  .video_codec = AV_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"),
251  .extensions = "yuv,rgb",
252  .audio_codec = AV_CODEC_ID_NONE,
253  .video_codec = AV_CODEC_ID_RAWVIDEO,
254  .write_packet = ff_raw_write_packet,
255  .flags = AVFMT_NOTIMESTAMPS,
256 };
257 #endif
258 
259 #if CONFIG_TRUEHD_MUXER
260 AVOutputFormat ff_truehd_muxer = {
261  .name = "truehd",
262  .long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
263  .extensions = "thd",
264  .audio_codec = AV_CODEC_ID_TRUEHD,
265  .video_codec = AV_CODEC_ID_NONE,
266  .write_packet = ff_raw_write_packet,
267  .flags = AVFMT_NOTIMESTAMPS,
268 };
269 #endif
270 
271 #if CONFIG_VC1_MUXER
272 AVOutputFormat ff_vc1_muxer = {
273  .name = "vc1",
274  .long_name = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
275  .extensions = "vc1",
276  .audio_codec = AV_CODEC_ID_NONE,
277  .video_codec = AV_CODEC_ID_VC1,
278  .write_packet = ff_raw_write_packet,
279  .flags = AVFMT_NOTIMESTAMPS,
280 };
281 #endif
const char * s
Definition: avisynth_c.h:668
Format I/O context.
Definition: avformat.h:944
static AVPacket pkt
Definition: demuxing.c:56
uint8_t * data
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition: aviobuf.c:173
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Definition: avformat.h:378
int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
preferred ID for MPEG-1/2 video decoding
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:352
AVIOContext * pb
I/O context.
Definition: avformat.h:977
Main libavformat public API header.
This structure stores compressed data.