FFmpeg
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 
25 #include "libavutil/intreadwrite.h"
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 
57 static int adx_write_trailer(AVFormatContext *s)
58 {
59  AVIOContext *pb = s->pb;
60  AVCodecParameters *par = s->streams[0]->codecpar;
61 
62  if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
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
182 static 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
386 static 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
411 static 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
436 static 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_M4V_MUXER
477  .p.name = "m4v",
478  .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
479  .p.extensions = "m4v",
480  .p.audio_codec = AV_CODEC_ID_NONE,
481  .p.video_codec = AV_CODEC_ID_MPEG4,
482  .p.subtitle_codec = AV_CODEC_ID_NONE,
483  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
485  .write_packet = ff_raw_write_packet,
486  .p.flags = AVFMT_NOTIMESTAMPS,
487 };
488 #endif
489 
490 #if CONFIG_MJPEG_MUXER
492  .p.name = "mjpeg",
493  .p.long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
494  .p.mime_type = "video/x-mjpeg",
495  .p.extensions = "mjpg,mjpeg",
496  .p.audio_codec = AV_CODEC_ID_NONE,
497  .p.video_codec = AV_CODEC_ID_MJPEG,
498  .p.subtitle_codec = AV_CODEC_ID_NONE,
499  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
501  .write_packet = ff_raw_write_packet,
502  .p.flags = AVFMT_NOTIMESTAMPS,
503 };
504 #endif
505 
506 #if CONFIG_MLP_MUXER
508  .p.name = "mlp",
509  .p.long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
510  .p.extensions = "mlp",
511  .p.audio_codec = AV_CODEC_ID_MLP,
512  .p.video_codec = AV_CODEC_ID_NONE,
513  .p.subtitle_codec = AV_CODEC_ID_NONE,
514  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
516  .write_packet = ff_raw_write_packet,
517  .p.flags = AVFMT_NOTIMESTAMPS,
518 };
519 #endif
520 
521 #if CONFIG_MP2_MUXER
523  .p.name = "mp2",
524  .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
525  .p.mime_type = "audio/mpeg",
526  .p.extensions = "mp2,m2a,mpa",
527  .p.audio_codec = AV_CODEC_ID_MP2,
528  .p.video_codec = AV_CODEC_ID_NONE,
529  .p.subtitle_codec = AV_CODEC_ID_NONE,
530  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
532  .write_packet = ff_raw_write_packet,
533  .p.flags = AVFMT_NOTIMESTAMPS,
534 };
535 #endif
536 
537 #if CONFIG_MPEG1VIDEO_MUXER
539  .p.name = "mpeg1video",
540  .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
541  .p.mime_type = "video/mpeg",
542  .p.extensions = "mpg,mpeg,m1v",
543  .p.audio_codec = AV_CODEC_ID_NONE,
544  .p.video_codec = AV_CODEC_ID_MPEG1VIDEO,
545  .p.subtitle_codec = AV_CODEC_ID_NONE,
546  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
548  .write_packet = ff_raw_write_packet,
549  .p.flags = AVFMT_NOTIMESTAMPS,
550 };
551 #endif
552 
553 #if CONFIG_MPEG2VIDEO_MUXER
555  .p.name = "mpeg2video",
556  .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
557  .p.extensions = "m2v",
558  .p.audio_codec = AV_CODEC_ID_NONE,
559  .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
560  .p.subtitle_codec = AV_CODEC_ID_NONE,
561  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
563  .write_packet = ff_raw_write_packet,
564  .p.flags = AVFMT_NOTIMESTAMPS,
565 };
566 #endif
567 
568 #if CONFIG_OBU_MUXER
569 static int obu_check_bitstream(AVFormatContext *s, AVStream *st,
570  const AVPacket *pkt)
571 {
572  return ff_stream_add_bitstream_filter(st, "av1_metadata", "td=insert");
573 }
574 
576  .p.name = "obu",
577  .p.long_name = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"),
578  .p.extensions = "obu",
579  .p.audio_codec = AV_CODEC_ID_NONE,
580  .p.video_codec = AV_CODEC_ID_AV1,
581  .p.subtitle_codec = AV_CODEC_ID_NONE,
582  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
584  .write_packet = ff_raw_write_packet,
585  .check_bitstream = obu_check_bitstream,
586  .p.flags = AVFMT_NOTIMESTAMPS,
587 };
588 #endif
589 
590 #if CONFIG_RAWVIDEO_MUXER
592  .p.name = "rawvideo",
593  .p.long_name = NULL_IF_CONFIG_SMALL("raw video"),
594  .p.extensions = "yuv,rgb",
595  .p.audio_codec = AV_CODEC_ID_NONE,
596  .p.video_codec = AV_CODEC_ID_RAWVIDEO,
597  .p.subtitle_codec = AV_CODEC_ID_NONE,
598  .write_packet = ff_raw_write_packet,
599  .p.flags = AVFMT_NOTIMESTAMPS,
600 };
601 #endif
602 
603 #if CONFIG_SBC_MUXER
605  .p.name = "sbc",
606  .p.long_name = NULL_IF_CONFIG_SMALL("raw SBC"),
607  .p.mime_type = "audio/x-sbc",
608  .p.extensions = "sbc,msbc",
609  .p.audio_codec = AV_CODEC_ID_SBC,
610  .p.video_codec = AV_CODEC_ID_NONE,
611  .p.subtitle_codec = AV_CODEC_ID_NONE,
612  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
614  .write_packet = ff_raw_write_packet,
615  .p.flags = AVFMT_NOTIMESTAMPS,
616 };
617 #endif
618 
619 #if CONFIG_TRUEHD_MUXER
621  .p.name = "truehd",
622  .p.long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
623  .p.extensions = "thd",
624  .p.audio_codec = AV_CODEC_ID_TRUEHD,
625  .p.video_codec = AV_CODEC_ID_NONE,
626  .p.subtitle_codec = AV_CODEC_ID_NONE,
627  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
629  .write_packet = ff_raw_write_packet,
630  .p.flags = AVFMT_NOTIMESTAMPS,
631 };
632 #endif
633 
634 #if CONFIG_VC1_MUXER
636  .p.name = "vc1",
637  .p.long_name = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
638  .p.extensions = "vc1",
639  .p.audio_codec = AV_CODEC_ID_NONE,
640  .p.video_codec = AV_CODEC_ID_VC1,
641  .p.subtitle_codec = AV_CODEC_ID_NONE,
642  .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
644  .write_packet = ff_raw_write_packet,
645  .p.flags = AVFMT_NOTIMESTAMPS,
646 };
647 #endif
ff_aptx_hd_muxer
const FFOutputFormat ff_aptx_hd_muxer
ff_dfpwm_muxer
const FFOutputFormat ff_dfpwm_muxer
AV_CODEC_ID_AC3
@ AV_CODEC_ID_AC3
Definition: codec_id.h:450
ff_dirac_muxer
const FFOutputFormat ff_dirac_muxer
AVOutputFormat::name
const char * name
Definition: avformat.h:510
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
ff_aptx_muxer
const FFOutputFormat ff_aptx_muxer
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:47
ff_avs2_muxer
const FFOutputFormat ff_avs2_muxer
AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:479
AV_CODEC_ID_DIRAC
@ AV_CODEC_ID_DIRAC
Definition: codec_id.h:168
int64_t
long long int64_t
Definition: coverity.c:34
AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: codec_id.h:65
ff_mp2_muxer
const FFOutputFormat ff_mp2_muxer
AV_CODEC_ID_MPEG4
@ AV_CODEC_ID_MPEG4
Definition: codec_id.h:64
ff_g723_1_muxer
const FFOutputFormat ff_g723_1_muxer
AVPacket::data
uint8_t * data
Definition: packet.h:539
ff_g726le_muxer
const FFOutputFormat ff_g726le_muxer
AV_CODEC_ID_AVS2
@ AV_CODEC_ID_AVS2
Definition: codec_id.h:248
ff_h261_muxer
const FFOutputFormat ff_h261_muxer
AV_CODEC_ID_ADPCM_G722
@ AV_CODEC_ID_ADPCM_G722
Definition: codec_id.h:401
FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
#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
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:328
AV_CODEC_ID_TRUEHD
@ AV_CODEC_ID_TRUEHD
Definition: codec_id.h:491
FFOutputFormat::p
AVOutputFormat p
The public AVOutputFormat.
Definition: mux.h:65
AV_CODEC_ID_H261
@ AV_CODEC_ID_H261
Definition: codec_id.h:55
ff_adx_muxer
const FFOutputFormat ff_adx_muxer
ff_data_muxer
const FFOutputFormat ff_data_muxer
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:494
ff_dts_muxer
const FFOutputFormat ff_dts_muxer
AV_CODEC_ID_SBC
@ AV_CODEC_ID_SBC
Definition: codec_id.h:534
pkt
AVPacket * pkt
Definition: movenc.c:60
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
av_cold
#define av_cold
Definition: attributes.h:90
AV_CODEC_ID_ADPCM_G726
@ AV_CODEC_ID_ADPCM_G726
Definition: codec_id.h:384
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_CODEC_ID_EVC
@ AV_CODEC_ID_EVC
Definition: codec_id.h:325
AV_CODEC_ID_MP2
@ AV_CODEC_ID_MP2
Definition: codec_id.h:447
ff_cavsvideo_muxer
const FFOutputFormat ff_cavsvideo_muxer
ff_g726_muxer
const FFOutputFormat ff_g726_muxer
ff_raw_write_packet
int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: rawenc.c:31
AV_CODEC_ID_CODEC2
@ AV_CODEC_ID_CODEC2
Definition: codec_id.h:514
AV_CODEC_ID_H264
@ AV_CODEC_ID_H264
Definition: codec_id.h:79
ff_ac3_muxer
const FFOutputFormat ff_ac3_muxer
if
if(ret)
Definition: filter_design.txt:179
ff_sbc_muxer
const FFOutputFormat ff_sbc_muxer
AV_CODEC_ID_AVS3
@ AV_CODEC_ID_AVS3
Definition: codec_id.h:250
AVFormatContext
Format I/O context.
Definition: avformat.h:1300
ff_eac3_muxer
const FFOutputFormat ff_eac3_muxer
ff_m4v_muxer
const FFOutputFormat ff_m4v_muxer
NULL
#define NULL
Definition: coverity.c:32
AV_CODEC_ID_AV1
@ AV_CODEC_ID_AV1
Definition: codec_id.h:284
ff_evc_muxer
const FFOutputFormat ff_evc_muxer
AV_CODEC_ID_G723_1
@ AV_CODEC_ID_G723_1
Definition: codec_id.h:499
FFOutputFormat
Definition: mux.h:61
ff_vc1_muxer
const FFOutputFormat ff_vc1_muxer
AVCodecParameters::ch_layout
AVChannelLayout ch_layout
Audio only.
Definition: codec_par.h:180
AV_CODEC_ID_MPEG1VIDEO
@ AV_CODEC_ID_MPEG1VIDEO
Definition: codec_id.h:53
AV_CODEC_ID_GSM
@ AV_CODEC_ID_GSM
as in Berlin toast format
Definition: codec_id.h:465
AV_CODEC_ID_EAC3
@ AV_CODEC_ID_EAC3
Definition: codec_id.h:487
AVIOContext
Bytestream IO Context.
Definition: avio.h:160
AV_CODEC_ID_ADPCM_ADX
@ AV_CODEC_ID_ADPCM_ADX
Definition: codec_id.h:382
AVPacket::size
int size
Definition: packet.h:540
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
ff_dnxhd_muxer
const FFOutputFormat ff_dnxhd_muxer
AVIOContext::seekable
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
Definition: avio.h:261
ff_mlp_muxer
const FFOutputFormat ff_mlp_muxer
AV_CODEC_ID_DTS
@ AV_CODEC_ID_DTS
Definition: codec_id.h:451
AV_CODEC_ID_H263
@ AV_CODEC_ID_H263
Definition: codec_id.h:56
AV_RB32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
Definition: bytestream.h:96
avio_write
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition: aviobuf.c:201
avio_wb32
void avio_wb32(AVIOContext *s, unsigned int val)
Definition: aviobuf.c:365
AV_CODEC_ID_VVC
@ AV_CODEC_ID_VVC
Definition: codec_id.h:252
ff_mjpeg_muxer
const FFOutputFormat ff_mjpeg_muxer
ff_vvc_muxer
const FFOutputFormat ff_vvc_muxer
rawenc.h
AV_CODEC_ID_MJPEG
@ AV_CODEC_ID_MJPEG
Definition: codec_id.h:59
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
ff_h263_muxer
const FFOutputFormat ff_h263_muxer
AV_CODEC_ID_CAVS
@ AV_CODEC_ID_CAVS
Definition: codec_id.h:139
ff_avs3_muxer
const FFOutputFormat ff_avs3_muxer
FF_OFMT_FLAG_MAX_ONE_OF_EACH
#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
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition: codec_id.h:228
AV_CODEC_ID_VC1
@ AV_CODEC_ID_VC1
Definition: codec_id.h:122
ff_truehd_muxer
const FFOutputFormat ff_truehd_muxer
AVStream
Stream structure.
Definition: avformat.h:748
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:231
avformat.h
ff_obu_muxer
const FFOutputFormat ff_obu_muxer
ff_hevc_muxer
const FFOutputFormat ff_hevc_muxer
AV_CODEC_ID_ADPCM_G726LE
@ AV_CODEC_ID_ADPCM_G726LE
Definition: codec_id.h:408
AVIO_SEEKABLE_NORMAL
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition: avio.h:41
ff_g722_muxer
const FFOutputFormat ff_g722_muxer
ff_codec2raw_muxer
const FFOutputFormat ff_codec2raw_muxer
ff_gsm_muxer
const FFOutputFormat ff_gsm_muxer
AVPacket
This structure stores compressed data.
Definition: packet.h:516
ff_mpeg1video_muxer
const FFOutputFormat ff_mpeg1video_muxer
AV_CODEC_ID_DFPWM
@ AV_CODEC_ID_DFPWM
Definition: codec_id.h:543
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
ff_rawvideo_muxer
const FFOutputFormat ff_rawvideo_muxer
AV_CODEC_ID_APTX
@ AV_CODEC_ID_APTX
Definition: codec_id.h:532
AV_RB24
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
Definition: bytestream.h:97
ff_h264_muxer
const FFOutputFormat ff_h264_muxer
AV_CODEC_ID_MPEG2VIDEO
@ AV_CODEC_ID_MPEG2VIDEO
preferred ID for MPEG-1/2 video decoding
Definition: codec_id.h:54
ff_stream_add_bitstream_filter
int ff_stream_add_bitstream_filter(AVStream *st, const char *name, const char *args)
Add a bitstream filter to a stream.
Definition: mux.c:1354
AV_CODEC_ID_APTX_HD
@ AV_CODEC_ID_APTX_HD
Definition: codec_id.h:533
AV_CODEC_ID_DNXHD
@ AV_CODEC_ID_DNXHD
Definition: codec_id.h:151
AV_CODEC_ID_MLP
@ AV_CODEC_ID_MLP
Definition: codec_id.h:476
ff_mpeg2video_muxer
const FFOutputFormat ff_mpeg2video_muxer
mux.h