FFmpeg
Loading...
Searching...
No Matches
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 "config_components.h"
24
26
27#include "avformat.h"
28#include "rawenc.h"
29#include "mux.h"
30
32{
33 avio_write(s->pb, pkt->data, pkt->size);
34 return 0;
35}
36
37/* Note: Do not forget to add new entries to the Makefile as well. */
38
39#if CONFIG_AC3_MUXER
41 .p.name = "ac3",
42 .p.long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
43 .p.mime_type = "audio/x-ac3",
44 .p.extensions = "ac3",
45 .p.audio_codec = AV_CODEC_ID_AC3,
46 .p.video_codec = AV_CODEC_ID_NONE,
47 .p.subtitle_codec = AV_CODEC_ID_NONE,
48 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
50 .write_packet = ff_raw_write_packet,
51 .p.flags = AVFMT_NOTIMESTAMPS,
52};
53#endif
54
55#if CONFIG_ADX_MUXER
56
57static int adx_write_trailer(AVFormatContext *s)
58{
59 AVIOContext *pb = s->pb;
60 AVCodecParameters *par = s->streams[0]->codecpar;
61
63 int64_t file_size = avio_tell(pb);
64 uint64_t sample_count = (file_size - 36) / par->ch_layout.nb_channels / 18 * 32;
65 if (sample_count <= UINT32_MAX) {
66 avio_seek(pb, 12, SEEK_SET);
67 avio_wb32(pb, sample_count);
68 avio_seek(pb, file_size, SEEK_SET);
69 }
70 }
71
72 return 0;
73}
74
76 .p.name = "adx",
77 .p.long_name = NULL_IF_CONFIG_SMALL("CRI ADX"),
78 .p.extensions = "adx",
79 .p.audio_codec = AV_CODEC_ID_ADPCM_ADX,
80 .p.video_codec = AV_CODEC_ID_NONE,
81 .p.subtitle_codec = AV_CODEC_ID_NONE,
82 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
84 .write_packet = ff_raw_write_packet,
85 .write_trailer = adx_write_trailer,
86 .p.flags = AVFMT_NOTIMESTAMPS,
87};
88#endif
89
90#if CONFIG_APTX_MUXER
92 .p.name = "aptx",
93 .p.long_name = NULL_IF_CONFIG_SMALL("raw aptX (Audio Processing Technology for Bluetooth)"),
94 .p.extensions = "aptx",
95 .p.audio_codec = AV_CODEC_ID_APTX,
96 .p.video_codec = AV_CODEC_ID_NONE,
97 .p.subtitle_codec = AV_CODEC_ID_NONE,
98 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
100 .write_packet = ff_raw_write_packet,
101 .p.flags = AVFMT_NOTIMESTAMPS,
102};
103#endif
104
105#if CONFIG_APTX_HD_MUXER
107 .p.name = "aptx_hd",
108 .p.long_name = NULL_IF_CONFIG_SMALL("raw aptX HD (Audio Processing Technology for Bluetooth)"),
109 .p.extensions = "aptxhd",
110 .p.audio_codec = AV_CODEC_ID_APTX_HD,
111 .p.video_codec = AV_CODEC_ID_NONE,
112 .p.subtitle_codec = AV_CODEC_ID_NONE,
113 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
115 .write_packet = ff_raw_write_packet,
116 .p.flags = AVFMT_NOTIMESTAMPS,
117};
118#endif
119
120#if CONFIG_AVS2_MUXER
122 .p.name = "avs2",
123 .p.long_name = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"),
124 .p.extensions = "avs,avs2",
125 .p.audio_codec = AV_CODEC_ID_NONE,
126 .p.video_codec = AV_CODEC_ID_AVS2,
127 .p.subtitle_codec = AV_CODEC_ID_NONE,
128 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
130 .write_packet = ff_raw_write_packet,
131 .p.flags = AVFMT_NOTIMESTAMPS,
132};
133#endif
134
135#if CONFIG_AVS3_MUXER
137 .p.name = "avs3",
138 .p.long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"),
139 .p.extensions = "avs3",
140 .p.audio_codec = AV_CODEC_ID_NONE,
141 .p.video_codec = AV_CODEC_ID_AVS3,
142 .p.subtitle_codec = AV_CODEC_ID_NONE,
143 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
145 .write_packet = ff_raw_write_packet,
146 .p.flags = AVFMT_NOTIMESTAMPS,
147};
148#endif
149
150
151#if CONFIG_CAVSVIDEO_MUXER
153 .p.name = "cavsvideo",
154 .p.long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
155 .p.extensions = "cavs",
156 .p.audio_codec = AV_CODEC_ID_NONE,
157 .p.video_codec = AV_CODEC_ID_CAVS,
158 .p.subtitle_codec = AV_CODEC_ID_NONE,
159 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
161 .write_packet = ff_raw_write_packet,
162 .p.flags = AVFMT_NOTIMESTAMPS,
163};
164#endif
165
166#if CONFIG_CODEC2RAW_MUXER
168 .p.name = "codec2raw",
169 .p.long_name = NULL_IF_CONFIG_SMALL("raw codec2 muxer"),
170 .p.audio_codec = AV_CODEC_ID_CODEC2,
171 .p.video_codec = AV_CODEC_ID_NONE,
172 .p.subtitle_codec = AV_CODEC_ID_NONE,
173 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
175 .write_packet = ff_raw_write_packet,
176 .p.flags = AVFMT_NOTIMESTAMPS,
177};
178#endif
179
180
181#if CONFIG_DATA_MUXER
182static av_cold int force_one_stream(AVFormatContext *s)
183{
184 if (s->nb_streams != 1) {
185 av_log(s, AV_LOG_ERROR, "This muxer supports only one stream.\n");
186 return AVERROR(EINVAL);
187 }
188 return 0;
189}
190
192 .p.name = "data",
193 .p.long_name = NULL_IF_CONFIG_SMALL("raw data"),
194 .init = force_one_stream,
195 .write_packet = ff_raw_write_packet,
196 .p.flags = AVFMT_NOTIMESTAMPS,
197};
198#endif
199
200#if CONFIG_DFPWM_MUXER
202 .p.name = "dfpwm",
203 .p.long_name = NULL_IF_CONFIG_SMALL("raw DFPWM1a"),
204 .p.extensions = "dfpwm",
205 .p.audio_codec = AV_CODEC_ID_DFPWM,
206 .p.video_codec = AV_CODEC_ID_NONE,
207 .p.subtitle_codec = AV_CODEC_ID_NONE,
208 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
210 .write_packet = ff_raw_write_packet,
211 .p.flags = AVFMT_NOTIMESTAMPS,
212};
213#endif
214
215#if CONFIG_DIRAC_MUXER
217 .p.name = "dirac",
218 .p.long_name = NULL_IF_CONFIG_SMALL("raw Dirac"),
219 .p.extensions = "drc,vc2",
220 .p.audio_codec = AV_CODEC_ID_NONE,
221 .p.video_codec = AV_CODEC_ID_DIRAC,
222 .p.subtitle_codec = AV_CODEC_ID_NONE,
223 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
225 .write_packet = ff_raw_write_packet,
226 .p.flags = AVFMT_NOTIMESTAMPS,
227};
228#endif
229
230#if CONFIG_DNXHD_MUXER
232 .p.name = "dnxhd",
233 .p.long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
234 .p.extensions = "dnxhd,dnxhr",
235 .p.audio_codec = AV_CODEC_ID_NONE,
236 .p.video_codec = AV_CODEC_ID_DNXHD,
237 .p.subtitle_codec = AV_CODEC_ID_NONE,
238 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
240 .write_packet = ff_raw_write_packet,
241 .p.flags = AVFMT_NOTIMESTAMPS,
242};
243#endif
244
245#if CONFIG_DTS_MUXER
247 .p.name = "dts",
248 .p.long_name = NULL_IF_CONFIG_SMALL("raw DTS"),
249 .p.mime_type = "audio/x-dca",
250 .p.extensions = "dts",
251 .p.audio_codec = AV_CODEC_ID_DTS,
252 .p.video_codec = AV_CODEC_ID_NONE,
253 .p.subtitle_codec = AV_CODEC_ID_NONE,
254 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
256 .write_packet = ff_raw_write_packet,
257 .p.flags = AVFMT_NOTIMESTAMPS,
258};
259#endif
260
261#if CONFIG_EAC3_MUXER
263 .p.name = "eac3",
264 .p.long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
265 .p.mime_type = "audio/x-eac3",
266 .p.extensions = "eac3,ec3",
267 .p.audio_codec = AV_CODEC_ID_EAC3,
268 .p.video_codec = AV_CODEC_ID_NONE,
269 .p.subtitle_codec = AV_CODEC_ID_NONE,
270 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
272 .write_packet = ff_raw_write_packet,
273 .p.flags = AVFMT_NOTIMESTAMPS,
274};
275#endif
276
277#if CONFIG_G722_MUXER
279 .p.name = "g722",
280 .p.long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
281 .p.mime_type = "audio/G722",
282 .p.extensions = "g722",
283 .p.audio_codec = AV_CODEC_ID_ADPCM_G722,
284 .p.video_codec = AV_CODEC_ID_NONE,
285 .p.subtitle_codec = AV_CODEC_ID_NONE,
286 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
288 .write_packet = ff_raw_write_packet,
289 .p.flags = AVFMT_NOTIMESTAMPS,
290};
291#endif
292
293#if CONFIG_G723_1_MUXER
295 .p.name = "g723_1",
296 .p.long_name = NULL_IF_CONFIG_SMALL("raw G.723.1"),
297 .p.mime_type = "audio/g723",
298 .p.extensions = "tco,rco",
299 .p.audio_codec = AV_CODEC_ID_G723_1,
300 .p.video_codec = AV_CODEC_ID_NONE,
301 .p.subtitle_codec = AV_CODEC_ID_NONE,
302 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
304 .write_packet = ff_raw_write_packet,
305 .p.flags = AVFMT_NOTIMESTAMPS,
306};
307#endif
308
309#if CONFIG_G726_MUXER
311 .p.name = "g726",
312 .p.long_name = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"),
313 .p.audio_codec = AV_CODEC_ID_ADPCM_G726,
314 .p.video_codec = AV_CODEC_ID_NONE,
315 .p.subtitle_codec = AV_CODEC_ID_NONE,
316 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
318 .write_packet = ff_raw_write_packet,
319 .p.flags = AVFMT_NOTIMESTAMPS,
320};
321#endif
322
323#if CONFIG_G726LE_MUXER
325 .p.name = "g726le",
326 .p.long_name = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"),
327 .p.audio_codec = AV_CODEC_ID_ADPCM_G726LE,
328 .p.video_codec = AV_CODEC_ID_NONE,
329 .p.subtitle_codec = AV_CODEC_ID_NONE,
330 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
332 .write_packet = ff_raw_write_packet,
333 .p.flags = AVFMT_NOTIMESTAMPS,
334};
335#endif
336
337#if CONFIG_GSM_MUXER
339 .p.name = "gsm",
340 .p.long_name = NULL_IF_CONFIG_SMALL("raw GSM"),
341 .p.mime_type = "audio/x-gsm",
342 .p.extensions = "gsm",
343 .p.audio_codec = AV_CODEC_ID_GSM,
344 .p.video_codec = AV_CODEC_ID_NONE,
345 .p.subtitle_codec = AV_CODEC_ID_NONE,
346 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
348 .write_packet = ff_raw_write_packet,
349 .p.flags = AVFMT_NOTIMESTAMPS,
350};
351#endif
352
353#if CONFIG_H261_MUXER
355 .p.name = "h261",
356 .p.long_name = NULL_IF_CONFIG_SMALL("raw H.261"),
357 .p.mime_type = "video/x-h261",
358 .p.extensions = "h261",
359 .p.audio_codec = AV_CODEC_ID_NONE,
360 .p.video_codec = AV_CODEC_ID_H261,
361 .p.subtitle_codec = AV_CODEC_ID_NONE,
362 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
364 .write_packet = ff_raw_write_packet,
365 .p.flags = AVFMT_NOTIMESTAMPS,
366};
367#endif
368
369#if CONFIG_H263_MUXER
371 .p.name = "h263",
372 .p.long_name = NULL_IF_CONFIG_SMALL("raw H.263"),
373 .p.mime_type = "video/x-h263",
374 .p.extensions = "h263",
375 .p.audio_codec = AV_CODEC_ID_NONE,
376 .p.video_codec = AV_CODEC_ID_H263,
377 .p.subtitle_codec = AV_CODEC_ID_NONE,
378 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
380 .write_packet = ff_raw_write_packet,
381 .p.flags = AVFMT_NOTIMESTAMPS,
382};
383#endif
384
385#if CONFIG_H264_MUXER
386static int h264_check_bitstream(AVFormatContext *s, AVStream *st,
387 const AVPacket *pkt)
388{
389 if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
390 AV_RB24(pkt->data) != 0x000001)
391 return ff_stream_add_bitstream_filter(st, "h264_mp4toannexb", NULL);
392 return 1;
393}
394
396 .p.name = "h264",
397 .p.long_name = NULL_IF_CONFIG_SMALL("raw H.264 video"),
398 .p.extensions = "h264,264",
399 .p.audio_codec = AV_CODEC_ID_NONE,
400 .p.video_codec = AV_CODEC_ID_H264,
401 .p.subtitle_codec = AV_CODEC_ID_NONE,
402 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
404 .write_packet = ff_raw_write_packet,
405 .check_bitstream = h264_check_bitstream,
406 .p.flags = AVFMT_NOTIMESTAMPS,
407};
408#endif
409
410#if CONFIG_VVC_MUXER
411static int vvc_check_bitstream(AVFormatContext *s, AVStream *st,
412 const AVPacket *pkt)
413{
414 if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
415 AV_RB24(pkt->data) != 0x000001)
416 return ff_stream_add_bitstream_filter(st, "vvc_mp4toannexb", NULL);
417 return 1;
418}
419
421 .p.name = "vvc",
422 .p.long_name = NULL_IF_CONFIG_SMALL("raw H.266/VVC video"),
423 .p.extensions = "vvc,h266,266",
424 .p.audio_codec = AV_CODEC_ID_NONE,
425 .p.video_codec = AV_CODEC_ID_VVC,
426 .p.subtitle_codec = AV_CODEC_ID_NONE,
427 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
429 .write_packet = ff_raw_write_packet,
430 .check_bitstream = vvc_check_bitstream,
431 .p.flags = AVFMT_NOTIMESTAMPS,
432};
433#endif
434
435#if CONFIG_HEVC_MUXER
436static int hevc_check_bitstream(AVFormatContext *s, AVStream *st,
437 const AVPacket *pkt)
438{
439 if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
440 AV_RB24(pkt->data) != 0x000001)
441 return ff_stream_add_bitstream_filter(st, "hevc_mp4toannexb", NULL);
442 return 1;
443}
444
446 .p.name = "hevc",
447 .p.long_name = NULL_IF_CONFIG_SMALL("raw HEVC video"),
448 .p.extensions = "hevc,h265,265",
449 .p.audio_codec = AV_CODEC_ID_NONE,
450 .p.video_codec = AV_CODEC_ID_HEVC,
451 .p.subtitle_codec = AV_CODEC_ID_NONE,
452 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
454 .write_packet = ff_raw_write_packet,
455 .check_bitstream = hevc_check_bitstream,
456 .p.flags = AVFMT_NOTIMESTAMPS,
457};
458#endif
459
460#if CONFIG_EVC_MUXER
462 .p.name = "evc",
463 .p.long_name = NULL_IF_CONFIG_SMALL("raw EVC video"),
464 .p.extensions = "evc",
465 .p.audio_codec = AV_CODEC_ID_NONE,
466 .p.video_codec = AV_CODEC_ID_EVC,
467 .p.subtitle_codec = AV_CODEC_ID_NONE,
468 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
470 .write_packet = ff_raw_write_packet,
471 .p.flags = AVFMT_NOTIMESTAMPS,
472};
473#endif
474
475#if CONFIG_LCEVC_MUXER
476static int lcevc_check_bitstream(AVFormatContext *s, AVStream *st,
477 const AVPacket *pkt)
478{
479 if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
480 AV_RB24(pkt->data) != 0x000001)
481 return ff_stream_add_bitstream_filter(st, "lcevc_metadata", NULL);
482 return 1;
483}
484
486 .p.name = "lcevc",
487 .p.long_name = NULL_IF_CONFIG_SMALL("raw LCEVC video"),
488 .p.extensions = "lcevc",
489 .p.audio_codec = AV_CODEC_ID_NONE,
490 .p.video_codec = AV_CODEC_ID_LCEVC,
491 .p.subtitle_codec = AV_CODEC_ID_NONE,
492 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
494 .write_packet = ff_raw_write_packet,
495 .check_bitstream = lcevc_check_bitstream,
496 .p.flags = AVFMT_NOTIMESTAMPS,
497};
498#endif
499
500#if CONFIG_M4V_MUXER
502 .p.name = "m4v",
503 .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
504 .p.extensions = "m4v",
505 .p.audio_codec = AV_CODEC_ID_NONE,
506 .p.video_codec = AV_CODEC_ID_MPEG4,
507 .p.subtitle_codec = AV_CODEC_ID_NONE,
508 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
510 .write_packet = ff_raw_write_packet,
511 .p.flags = AVFMT_NOTIMESTAMPS,
512};
513#endif
514
515#if CONFIG_MJPEG_MUXER
517 .p.name = "mjpeg",
518 .p.long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
519 .p.mime_type = "video/x-mjpeg",
520 .p.extensions = "mjpg,mjpeg",
521 .p.audio_codec = AV_CODEC_ID_NONE,
522 .p.video_codec = AV_CODEC_ID_MJPEG,
523 .p.subtitle_codec = AV_CODEC_ID_NONE,
524 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
526 .write_packet = ff_raw_write_packet,
527 .p.flags = AVFMT_NOTIMESTAMPS,
528};
529#endif
530
531#if CONFIG_MLP_MUXER
533 .p.name = "mlp",
534 .p.long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
535 .p.extensions = "mlp",
536 .p.audio_codec = AV_CODEC_ID_MLP,
537 .p.video_codec = AV_CODEC_ID_NONE,
538 .p.subtitle_codec = AV_CODEC_ID_NONE,
539 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
541 .write_packet = ff_raw_write_packet,
542 .p.flags = AVFMT_NOTIMESTAMPS,
543};
544#endif
545
546#if CONFIG_MP2_MUXER
548 .p.name = "mp2",
549 .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
550 .p.mime_type = "audio/mpeg",
551 .p.extensions = "mp2,m2a,mpa",
552 .p.audio_codec = AV_CODEC_ID_MP2,
553 .p.video_codec = AV_CODEC_ID_NONE,
554 .p.subtitle_codec = AV_CODEC_ID_NONE,
555 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
557 .write_packet = ff_raw_write_packet,
558 .p.flags = AVFMT_NOTIMESTAMPS,
559};
560#endif
561
562#if CONFIG_MPEG1VIDEO_MUXER
564 .p.name = "mpeg1video",
565 .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
566 .p.mime_type = "video/mpeg",
567 .p.extensions = "mpg,mpeg,m1v",
568 .p.audio_codec = AV_CODEC_ID_NONE,
569 .p.video_codec = AV_CODEC_ID_MPEG1VIDEO,
570 .p.subtitle_codec = AV_CODEC_ID_NONE,
571 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
573 .write_packet = ff_raw_write_packet,
574 .p.flags = AVFMT_NOTIMESTAMPS,
575};
576#endif
577
578#if CONFIG_MPEG2VIDEO_MUXER
580 .p.name = "mpeg2video",
581 .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
582 .p.extensions = "m2v",
583 .p.audio_codec = AV_CODEC_ID_NONE,
584 .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
585 .p.subtitle_codec = AV_CODEC_ID_NONE,
586 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
588 .write_packet = ff_raw_write_packet,
589 .p.flags = AVFMT_NOTIMESTAMPS,
590};
591#endif
592
593#if CONFIG_OBU_MUXER
594static int obu_check_bitstream(AVFormatContext *s, AVStream *st,
595 const AVPacket *pkt)
596{
597 return ff_stream_add_bitstream_filter(st, "av1_metadata", "td=insert");
598}
599
601 .p.name = "obu",
602 .p.long_name = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"),
603 .p.extensions = "obu",
604 .p.audio_codec = AV_CODEC_ID_NONE,
605 .p.video_codec = AV_CODEC_ID_AV1,
606 .p.subtitle_codec = AV_CODEC_ID_NONE,
607 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
609 .write_packet = ff_raw_write_packet,
610 .check_bitstream = obu_check_bitstream,
611 .p.flags = AVFMT_NOTIMESTAMPS,
612};
613#endif
614
615#if CONFIG_RAWVIDEO_MUXER
617 .p.name = "rawvideo",
618 .p.long_name = NULL_IF_CONFIG_SMALL("raw video"),
619 .p.extensions = "yuv,rgb",
620 .p.audio_codec = AV_CODEC_ID_NONE,
621 .p.video_codec = AV_CODEC_ID_RAWVIDEO,
622 .p.subtitle_codec = AV_CODEC_ID_NONE,
623 .write_packet = ff_raw_write_packet,
624 .p.flags = AVFMT_NOTIMESTAMPS,
625};
626#endif
627
628#if CONFIG_SBC_MUXER
630 .p.name = "sbc",
631 .p.long_name = NULL_IF_CONFIG_SMALL("raw SBC"),
632 .p.mime_type = "audio/x-sbc",
633 .p.extensions = "sbc,msbc",
634 .p.audio_codec = AV_CODEC_ID_SBC,
635 .p.video_codec = AV_CODEC_ID_NONE,
636 .p.subtitle_codec = AV_CODEC_ID_NONE,
637 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
639 .write_packet = ff_raw_write_packet,
640 .p.flags = AVFMT_NOTIMESTAMPS,
641};
642#endif
643
644#if CONFIG_TRUEHD_MUXER
646 .p.name = "truehd",
647 .p.long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
648 .p.extensions = "thd",
649 .p.audio_codec = AV_CODEC_ID_TRUEHD,
650 .p.video_codec = AV_CODEC_ID_NONE,
651 .p.subtitle_codec = AV_CODEC_ID_NONE,
652 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
654 .write_packet = ff_raw_write_packet,
655 .p.flags = AVFMT_NOTIMESTAMPS,
656};
657#endif
658
659#if CONFIG_VC1_MUXER
661 .p.name = "vc1",
662 .p.long_name = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
663 .p.extensions = "vc1",
664 .p.audio_codec = AV_CODEC_ID_NONE,
665 .p.video_codec = AV_CODEC_ID_VC1,
666 .p.subtitle_codec = AV_CODEC_ID_NONE,
667 .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
669 .write_packet = ff_raw_write_packet,
670 .p.flags = AVFMT_NOTIMESTAMPS,
671};
672#endif
const FFOutputFormat ff_mpeg2video_muxer
const FFOutputFormat ff_eac3_muxer
const FFOutputFormat ff_gsm_muxer
const FFOutputFormat ff_avs2_muxer
const FFOutputFormat ff_h264_muxer
const FFOutputFormat ff_m4v_muxer
const FFOutputFormat ff_mjpeg_muxer
const FFOutputFormat ff_h261_muxer
const FFOutputFormat ff_h263_muxer
const FFOutputFormat ff_sbc_muxer
const FFOutputFormat ff_data_muxer
const FFOutputFormat ff_dnxhd_muxer
const FFOutputFormat ff_mpeg1video_muxer
const FFOutputFormat ff_mp2_muxer
const FFOutputFormat ff_evc_muxer
const FFOutputFormat ff_vc1_muxer
const FFOutputFormat ff_aptx_hd_muxer
const FFOutputFormat ff_dts_muxer
const FFOutputFormat ff_mlp_muxer
const FFOutputFormat ff_ac3_muxer
const FFOutputFormat ff_aptx_muxer
const FFOutputFormat ff_dfpwm_muxer
const FFOutputFormat ff_vvc_muxer
const FFOutputFormat ff_cavsvideo_muxer
const FFOutputFormat ff_g722_muxer
const FFOutputFormat ff_avs3_muxer
const FFOutputFormat ff_dirac_muxer
const FFOutputFormat ff_g726_muxer
const FFOutputFormat ff_hevc_muxer
const FFOutputFormat ff_rawvideo_muxer
const FFOutputFormat ff_lcevc_muxer
const FFOutputFormat ff_codec2raw_muxer
const FFOutputFormat ff_truehd_muxer
const FFOutputFormat ff_adx_muxer
const FFOutputFormat ff_g723_1_muxer
const FFOutputFormat ff_obu_muxer
const FFOutputFormat ff_g726le_muxer
Main libavformat public API header.
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition avformat.h:500
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition aviobuf.c:236
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition avio.h:41
void avio_wb32(AVIOContext *s, unsigned int val)
Definition aviobuf.c:368
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition avio.h:507
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition aviobuf.c:206
#define s(width, name)
Definition cbs_vp9.c:198
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
static AVPacket * pkt
@ AV_CODEC_ID_DIRAC
Definition codec_id.h:166
@ AV_CODEC_ID_G723_1
Definition codec_id.h:511
@ AV_CODEC_ID_AVS3
Definition codec_id.h:245
@ AV_CODEC_ID_H261
Definition codec_id.h:53
@ AV_CODEC_ID_EAC3
Definition codec_id.h:499
@ AV_CODEC_ID_RAWVIDEO
Definition codec_id.h:63
@ AV_CODEC_ID_LCEVC
Definition codec_id.h:615
@ AV_CODEC_ID_GSM
as in Berlin toast format
Definition codec_id.h:477
@ AV_CODEC_ID_ADPCM_G722
Definition codec_id.h:402
@ AV_CODEC_ID_H264
Definition codec_id.h:77
@ AV_CODEC_ID_SBC
Definition codec_id.h:546
@ AV_CODEC_ID_APTX
Definition codec_id.h:544
@ AV_CODEC_ID_NONE
Definition codec_id.h:48
@ AV_CODEC_ID_VVC
Definition codec_id.h:247
@ AV_CODEC_ID_APTX_HD
Definition codec_id.h:545
@ AV_CODEC_ID_ADPCM_G726LE
Definition codec_id.h:409
@ AV_CODEC_ID_AV1
Definition codec_id.h:275
@ AV_CODEC_ID_ADPCM_ADX
Definition codec_id.h:383
@ AV_CODEC_ID_VC1
Definition codec_id.h:120
@ AV_CODEC_ID_CAVS
Definition codec_id.h:137
@ AV_CODEC_ID_CODEC2
Definition codec_id.h:526
@ AV_CODEC_ID_MP2
Definition codec_id.h:459
@ AV_CODEC_ID_DTS
Definition codec_id.h:463
@ AV_CODEC_ID_HEVC
Definition codec_id.h:223
@ AV_CODEC_ID_ADPCM_G726
Definition codec_id.h:385
@ AV_CODEC_ID_TRUEHD
Definition codec_id.h:503
@ AV_CODEC_ID_H263
Definition codec_id.h:54
@ AV_CODEC_ID_AC3
Definition codec_id.h:462
@ AV_CODEC_ID_DNXHD
Definition codec_id.h:149
@ AV_CODEC_ID_MLP
Definition codec_id.h:488
@ AV_CODEC_ID_MPEG4
Definition codec_id.h:62
@ AV_CODEC_ID_MJPEG
Definition codec_id.h:57
@ AV_CODEC_ID_AVS2
Definition codec_id.h:243
@ AV_CODEC_ID_EVC
Definition codec_id.h:316
@ AV_CODEC_ID_DFPWM
Definition codec_id.h:555
@ AV_CODEC_ID_MPEG1VIDEO
Definition codec_id.h:51
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition codec_id.h:52
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
#define AV_RB32(p)
#define AV_RB24(x)
int ff_stream_add_bitstream_filter(AVStream *st, const char *name, const char *args)
Add a bitstream filter to a stream.
Definition mux.c:1339
int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition rawenc.c:31
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:97
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
Definition mux.h:50
#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
If this flag is set, then the only permitted audio/video/subtitle codec ids are AVOutputFormat....
Definition mux.h:59
int nb_channels
Number of channels in this layout.
This struct describes the properties of an encoded stream.
Definition codec_par.h:49
AVChannelLayout ch_layout
The channel layout and number of channels.
Definition codec_par.h:207
Format I/O context.
Definition avformat.h:1401
Bytestream IO Context.
Definition avio.h:160
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
Definition avio.h:261
This structure stores compressed data.
Definition packet.h:587
Stream structure.
Definition avformat.h:768
#define av_log(a,...)