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 
38 {
39  if (s->nb_streams != 1) {
40  av_log(s, AV_LOG_ERROR, "%s files have exactly one stream\n",
41  s->oformat->name);
42  return AVERROR(EINVAL);
43  }
44  if ( s->oformat->audio_codec != AV_CODEC_ID_NONE
45  && s->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) {
46  av_log(s, AV_LOG_ERROR, "%s files have exactly one audio stream\n",
47  s->oformat->name);
48  return AVERROR(EINVAL);
49  }
50  if ( s->oformat->video_codec != AV_CODEC_ID_NONE
51  && s->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
52  av_log(s, AV_LOG_ERROR, "%s files have exactly one video stream\n",
53  s->oformat->name);
54  return AVERROR(EINVAL);
55  }
56  return 0;
57 }
58 
59 /* Note: Do not forget to add new entries to the Makefile as well. */
60 
61 #if CONFIG_AC3_MUXER
63  .p.name = "ac3",
64  .p.long_name = NULL_IF_CONFIG_SMALL("raw AC-3"),
65  .p.mime_type = "audio/x-ac3",
66  .p.extensions = "ac3",
67  .p.audio_codec = AV_CODEC_ID_AC3,
68  .p.video_codec = AV_CODEC_ID_NONE,
69  .init = force_one_stream,
70  .write_packet = ff_raw_write_packet,
71  .p.flags = AVFMT_NOTIMESTAMPS,
72 };
73 #endif
74 
75 #if CONFIG_ADX_MUXER
76 
77 static int adx_write_trailer(AVFormatContext *s)
78 {
79  AVIOContext *pb = s->pb;
80  AVCodecParameters *par = s->streams[0]->codecpar;
81 
82  if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
83  int64_t file_size = avio_tell(pb);
84  uint64_t sample_count = (file_size - 36) / par->ch_layout.nb_channels / 18 * 32;
85  if (sample_count <= UINT32_MAX) {
86  avio_seek(pb, 12, SEEK_SET);
87  avio_wb32(pb, sample_count);
88  avio_seek(pb, file_size, SEEK_SET);
89  }
90  }
91 
92  return 0;
93 }
94 
96  .p.name = "adx",
97  .p.long_name = NULL_IF_CONFIG_SMALL("CRI ADX"),
98  .p.extensions = "adx",
99  .p.audio_codec = AV_CODEC_ID_ADPCM_ADX,
100  .p.video_codec = AV_CODEC_ID_NONE,
101  .init = force_one_stream,
102  .write_packet = ff_raw_write_packet,
103  .write_trailer = adx_write_trailer,
104  .p.flags = AVFMT_NOTIMESTAMPS,
105 };
106 #endif
107 
108 #if CONFIG_APTX_MUXER
110  .p.name = "aptx",
111  .p.long_name = NULL_IF_CONFIG_SMALL("raw aptX (Audio Processing Technology for Bluetooth)"),
112  .p.extensions = "aptx",
113  .p.audio_codec = AV_CODEC_ID_APTX,
114  .p.video_codec = AV_CODEC_ID_NONE,
115  .init = force_one_stream,
116  .write_packet = ff_raw_write_packet,
117  .p.flags = AVFMT_NOTIMESTAMPS,
118 };
119 #endif
120 
121 #if CONFIG_APTX_HD_MUXER
123  .p.name = "aptx_hd",
124  .p.long_name = NULL_IF_CONFIG_SMALL("raw aptX HD (Audio Processing Technology for Bluetooth)"),
125  .p.extensions = "aptxhd",
126  .p.audio_codec = AV_CODEC_ID_APTX_HD,
127  .p.video_codec = AV_CODEC_ID_NONE,
128  .init = force_one_stream,
129  .write_packet = ff_raw_write_packet,
130  .p.flags = AVFMT_NOTIMESTAMPS,
131 };
132 #endif
133 
134 #if CONFIG_AVS2_MUXER
136  .p.name = "avs2",
137  .p.long_name = NULL_IF_CONFIG_SMALL("raw AVS2-P2/IEEE1857.4 video"),
138  .p.extensions = "avs,avs2",
139  .p.audio_codec = AV_CODEC_ID_NONE,
140  .p.video_codec = AV_CODEC_ID_AVS2,
141  .init = force_one_stream,
142  .write_packet = ff_raw_write_packet,
143  .p.flags = AVFMT_NOTIMESTAMPS,
144 };
145 #endif
146 
147 #if CONFIG_AVS3_MUXER
149  .p.name = "avs3",
150  .p.long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"),
151  .p.extensions = "avs3",
152  .p.audio_codec = AV_CODEC_ID_NONE,
153  .p.video_codec = AV_CODEC_ID_AVS3,
154  .init = force_one_stream,
155  .write_packet = ff_raw_write_packet,
156  .p.flags = AVFMT_NOTIMESTAMPS,
157 };
158 #endif
159 
160 
161 #if CONFIG_CAVSVIDEO_MUXER
163  .p.name = "cavsvideo",
164  .p.long_name = NULL_IF_CONFIG_SMALL("raw Chinese AVS (Audio Video Standard) video"),
165  .p.extensions = "cavs",
166  .p.audio_codec = AV_CODEC_ID_NONE,
167  .p.video_codec = AV_CODEC_ID_CAVS,
168  .init = force_one_stream,
169  .write_packet = ff_raw_write_packet,
170  .p.flags = AVFMT_NOTIMESTAMPS,
171 };
172 #endif
173 
174 #if CONFIG_CODEC2RAW_MUXER
176  .p.name = "codec2raw",
177  .p.long_name = NULL_IF_CONFIG_SMALL("raw codec2 muxer"),
178  .p.audio_codec = AV_CODEC_ID_CODEC2,
179  .p.video_codec = AV_CODEC_ID_NONE,
180  .init = force_one_stream,
181  .write_packet = ff_raw_write_packet,
182  .p.flags = AVFMT_NOTIMESTAMPS,
183 };
184 #endif
185 
186 
187 #if CONFIG_DATA_MUXER
189  .p.name = "data",
190  .p.long_name = NULL_IF_CONFIG_SMALL("raw data"),
191  .init = force_one_stream,
192  .write_packet = ff_raw_write_packet,
193  .p.flags = AVFMT_NOTIMESTAMPS,
194 };
195 #endif
196 
197 #if CONFIG_DFPWM_MUXER
199  .p.name = "dfpwm",
200  .p.long_name = NULL_IF_CONFIG_SMALL("raw DFPWM1a"),
201  .p.extensions = "dfpwm",
202  .p.audio_codec = AV_CODEC_ID_DFPWM,
203  .p.video_codec = AV_CODEC_ID_NONE,
204  .init = force_one_stream,
205  .write_packet = ff_raw_write_packet,
206  .p.flags = AVFMT_NOTIMESTAMPS,
207 };
208 #endif
209 
210 #if CONFIG_DIRAC_MUXER
212  .p.name = "dirac",
213  .p.long_name = NULL_IF_CONFIG_SMALL("raw Dirac"),
214  .p.extensions = "drc,vc2",
215  .p.audio_codec = AV_CODEC_ID_NONE,
216  .p.video_codec = AV_CODEC_ID_DIRAC,
217  .init = force_one_stream,
218  .write_packet = ff_raw_write_packet,
219  .p.flags = AVFMT_NOTIMESTAMPS,
220 };
221 #endif
222 
223 #if CONFIG_DNXHD_MUXER
225  .p.name = "dnxhd",
226  .p.long_name = NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
227  .p.extensions = "dnxhd,dnxhr",
228  .p.audio_codec = AV_CODEC_ID_NONE,
229  .p.video_codec = AV_CODEC_ID_DNXHD,
230  .init = force_one_stream,
231  .write_packet = ff_raw_write_packet,
232  .p.flags = AVFMT_NOTIMESTAMPS,
233 };
234 #endif
235 
236 #if CONFIG_DTS_MUXER
238  .p.name = "dts",
239  .p.long_name = NULL_IF_CONFIG_SMALL("raw DTS"),
240  .p.mime_type = "audio/x-dca",
241  .p.extensions = "dts",
242  .p.audio_codec = AV_CODEC_ID_DTS,
243  .p.video_codec = AV_CODEC_ID_NONE,
244  .init = force_one_stream,
245  .write_packet = ff_raw_write_packet,
246  .p.flags = AVFMT_NOTIMESTAMPS,
247 };
248 #endif
249 
250 #if CONFIG_EAC3_MUXER
252  .p.name = "eac3",
253  .p.long_name = NULL_IF_CONFIG_SMALL("raw E-AC-3"),
254  .p.mime_type = "audio/x-eac3",
255  .p.extensions = "eac3,ec3",
256  .p.audio_codec = AV_CODEC_ID_EAC3,
257  .p.video_codec = AV_CODEC_ID_NONE,
258  .init = force_one_stream,
259  .write_packet = ff_raw_write_packet,
260  .p.flags = AVFMT_NOTIMESTAMPS,
261 };
262 #endif
263 
264 #if CONFIG_G722_MUXER
266  .p.name = "g722",
267  .p.long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
268  .p.mime_type = "audio/G722",
269  .p.extensions = "g722",
270  .p.audio_codec = AV_CODEC_ID_ADPCM_G722,
271  .p.video_codec = AV_CODEC_ID_NONE,
272  .init = force_one_stream,
273  .write_packet = ff_raw_write_packet,
274  .p.flags = AVFMT_NOTIMESTAMPS,
275 };
276 #endif
277 
278 #if CONFIG_G723_1_MUXER
280  .p.name = "g723_1",
281  .p.long_name = NULL_IF_CONFIG_SMALL("raw G.723.1"),
282  .p.mime_type = "audio/g723",
283  .p.extensions = "tco,rco",
284  .p.audio_codec = AV_CODEC_ID_G723_1,
285  .p.video_codec = AV_CODEC_ID_NONE,
286  .init = force_one_stream,
287  .write_packet = ff_raw_write_packet,
288  .p.flags = AVFMT_NOTIMESTAMPS,
289 };
290 #endif
291 
292 #if CONFIG_G726_MUXER
294  .p.name = "g726",
295  .p.long_name = NULL_IF_CONFIG_SMALL("raw big-endian G.726 (\"left-justified\")"),
296  .p.audio_codec = AV_CODEC_ID_ADPCM_G726,
297  .p.video_codec = AV_CODEC_ID_NONE,
298  .init = force_one_stream,
299  .write_packet = ff_raw_write_packet,
300  .p.flags = AVFMT_NOTIMESTAMPS,
301 };
302 #endif
303 
304 #if CONFIG_G726LE_MUXER
306  .p.name = "g726le",
307  .p.long_name = NULL_IF_CONFIG_SMALL("raw little-endian G.726 (\"right-justified\")"),
308  .p.audio_codec = AV_CODEC_ID_ADPCM_G726LE,
309  .p.video_codec = AV_CODEC_ID_NONE,
310  .init = force_one_stream,
311  .write_packet = ff_raw_write_packet,
312  .p.flags = AVFMT_NOTIMESTAMPS,
313 };
314 #endif
315 
316 #if CONFIG_GSM_MUXER
318  .p.name = "gsm",
319  .p.long_name = NULL_IF_CONFIG_SMALL("raw GSM"),
320  .p.mime_type = "audio/x-gsm",
321  .p.extensions = "gsm",
322  .p.audio_codec = AV_CODEC_ID_GSM,
323  .p.video_codec = AV_CODEC_ID_NONE,
324  .init = force_one_stream,
325  .write_packet = ff_raw_write_packet,
326  .p.flags = AVFMT_NOTIMESTAMPS,
327 };
328 #endif
329 
330 #if CONFIG_H261_MUXER
332  .p.name = "h261",
333  .p.long_name = NULL_IF_CONFIG_SMALL("raw H.261"),
334  .p.mime_type = "video/x-h261",
335  .p.extensions = "h261",
336  .p.audio_codec = AV_CODEC_ID_NONE,
337  .p.video_codec = AV_CODEC_ID_H261,
338  .init = force_one_stream,
339  .write_packet = ff_raw_write_packet,
340  .p.flags = AVFMT_NOTIMESTAMPS,
341 };
342 #endif
343 
344 #if CONFIG_H263_MUXER
346  .p.name = "h263",
347  .p.long_name = NULL_IF_CONFIG_SMALL("raw H.263"),
348  .p.mime_type = "video/x-h263",
349  .p.extensions = "h263",
350  .p.audio_codec = AV_CODEC_ID_NONE,
351  .p.video_codec = AV_CODEC_ID_H263,
352  .init = force_one_stream,
353  .write_packet = ff_raw_write_packet,
354  .p.flags = AVFMT_NOTIMESTAMPS,
355 };
356 #endif
357 
358 #if CONFIG_H264_MUXER
359 static int h264_check_bitstream(AVFormatContext *s, AVStream *st,
360  const AVPacket *pkt)
361 {
362  if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
363  AV_RB24(pkt->data) != 0x000001)
364  return ff_stream_add_bitstream_filter(st, "h264_mp4toannexb", NULL);
365  return 1;
366 }
367 
369  .p.name = "h264",
370  .p.long_name = NULL_IF_CONFIG_SMALL("raw H.264 video"),
371  .p.extensions = "h264,264",
372  .p.audio_codec = AV_CODEC_ID_NONE,
373  .p.video_codec = AV_CODEC_ID_H264,
374  .init = force_one_stream,
375  .write_packet = ff_raw_write_packet,
376  .check_bitstream = h264_check_bitstream,
377  .p.flags = AVFMT_NOTIMESTAMPS,
378 };
379 #endif
380 
381 #if CONFIG_VVC_MUXER
382 static int vvc_check_bitstream(AVFormatContext *s, AVStream *st,
383  const AVPacket *pkt)
384 {
385  if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
386  AV_RB24(pkt->data) != 0x000001)
387  return ff_stream_add_bitstream_filter(st, "vvc_mp4toannexb", NULL);
388  return 1;
389 }
390 
392  .p.name = "vvc",
393  .p.long_name = NULL_IF_CONFIG_SMALL("raw H.266/VVC video"),
394  .p.extensions = "vvc,h266,266",
395  .p.audio_codec = AV_CODEC_ID_NONE,
396  .p.video_codec = AV_CODEC_ID_VVC,
397  .init = force_one_stream,
398  .write_packet = ff_raw_write_packet,
399  .check_bitstream = vvc_check_bitstream,
400  .p.flags = AVFMT_NOTIMESTAMPS,
401 };
402 #endif
403 
404 #if CONFIG_HEVC_MUXER
405 static int hevc_check_bitstream(AVFormatContext *s, AVStream *st,
406  const AVPacket *pkt)
407 {
408  if (pkt->size >= 5 && AV_RB32(pkt->data) != 0x0000001 &&
409  AV_RB24(pkt->data) != 0x000001)
410  return ff_stream_add_bitstream_filter(st, "hevc_mp4toannexb", NULL);
411  return 1;
412 }
413 
415  .p.name = "hevc",
416  .p.long_name = NULL_IF_CONFIG_SMALL("raw HEVC video"),
417  .p.extensions = "hevc,h265,265",
418  .p.audio_codec = AV_CODEC_ID_NONE,
419  .p.video_codec = AV_CODEC_ID_HEVC,
420  .init = force_one_stream,
421  .write_packet = ff_raw_write_packet,
422  .check_bitstream = hevc_check_bitstream,
423  .p.flags = AVFMT_NOTIMESTAMPS,
424 };
425 #endif
426 
427 #if CONFIG_EVC_MUXER
429  .p.name = "evc",
430  .p.long_name = NULL_IF_CONFIG_SMALL("raw EVC video"),
431  .p.extensions = "evc",
432  .p.audio_codec = AV_CODEC_ID_NONE,
433  .p.video_codec = AV_CODEC_ID_EVC,
434  .init = force_one_stream,
435  .write_packet = ff_raw_write_packet,
436  .p.flags = AVFMT_NOTIMESTAMPS,
437 };
438 #endif
439 
440 #if CONFIG_M4V_MUXER
442  .p.name = "m4v",
443  .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-4 video"),
444  .p.extensions = "m4v",
445  .p.audio_codec = AV_CODEC_ID_NONE,
446  .p.video_codec = AV_CODEC_ID_MPEG4,
447  .init = force_one_stream,
448  .write_packet = ff_raw_write_packet,
449  .p.flags = AVFMT_NOTIMESTAMPS,
450 };
451 #endif
452 
453 #if CONFIG_MJPEG_MUXER
455  .p.name = "mjpeg",
456  .p.long_name = NULL_IF_CONFIG_SMALL("raw MJPEG video"),
457  .p.mime_type = "video/x-mjpeg",
458  .p.extensions = "mjpg,mjpeg",
459  .p.audio_codec = AV_CODEC_ID_NONE,
460  .p.video_codec = AV_CODEC_ID_MJPEG,
461  .init = force_one_stream,
462  .write_packet = ff_raw_write_packet,
463  .p.flags = AVFMT_NOTIMESTAMPS,
464 };
465 #endif
466 
467 #if CONFIG_MLP_MUXER
469  .p.name = "mlp",
470  .p.long_name = NULL_IF_CONFIG_SMALL("raw MLP"),
471  .p.extensions = "mlp",
472  .p.audio_codec = AV_CODEC_ID_MLP,
473  .p.video_codec = AV_CODEC_ID_NONE,
474  .init = force_one_stream,
475  .write_packet = ff_raw_write_packet,
476  .p.flags = AVFMT_NOTIMESTAMPS,
477 };
478 #endif
479 
480 #if CONFIG_MP2_MUXER
482  .p.name = "mp2",
483  .p.long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
484  .p.mime_type = "audio/mpeg",
485  .p.extensions = "mp2,m2a,mpa",
486  .p.audio_codec = AV_CODEC_ID_MP2,
487  .p.video_codec = AV_CODEC_ID_NONE,
488  .init = force_one_stream,
489  .write_packet = ff_raw_write_packet,
490  .p.flags = AVFMT_NOTIMESTAMPS,
491 };
492 #endif
493 
494 #if CONFIG_MPEG1VIDEO_MUXER
496  .p.name = "mpeg1video",
497  .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
498  .p.mime_type = "video/mpeg",
499  .p.extensions = "mpg,mpeg,m1v",
500  .p.audio_codec = AV_CODEC_ID_NONE,
501  .p.video_codec = AV_CODEC_ID_MPEG1VIDEO,
502  .init = force_one_stream,
503  .write_packet = ff_raw_write_packet,
504  .p.flags = AVFMT_NOTIMESTAMPS,
505 };
506 #endif
507 
508 #if CONFIG_MPEG2VIDEO_MUXER
510  .p.name = "mpeg2video",
511  .p.long_name = NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
512  .p.extensions = "m2v",
513  .p.audio_codec = AV_CODEC_ID_NONE,
514  .p.video_codec = AV_CODEC_ID_MPEG2VIDEO,
515  .init = force_one_stream,
516  .write_packet = ff_raw_write_packet,
517  .p.flags = AVFMT_NOTIMESTAMPS,
518 };
519 #endif
520 
521 #if CONFIG_OBU_MUXER
522 static int obu_check_bitstream(AVFormatContext *s, AVStream *st,
523  const AVPacket *pkt)
524 {
525  return ff_stream_add_bitstream_filter(st, "av1_metadata", "td=insert");
526 }
527 
529  .p.name = "obu",
530  .p.long_name = NULL_IF_CONFIG_SMALL("AV1 low overhead OBU"),
531  .p.extensions = "obu",
532  .p.audio_codec = AV_CODEC_ID_NONE,
533  .p.video_codec = AV_CODEC_ID_AV1,
534  .init = force_one_stream,
535  .write_packet = ff_raw_write_packet,
536  .check_bitstream = obu_check_bitstream,
537  .p.flags = AVFMT_NOTIMESTAMPS,
538 };
539 #endif
540 
541 #if CONFIG_RAWVIDEO_MUXER
543  .p.name = "rawvideo",
544  .p.long_name = NULL_IF_CONFIG_SMALL("raw video"),
545  .p.extensions = "yuv,rgb",
546  .p.audio_codec = AV_CODEC_ID_NONE,
547  .p.video_codec = AV_CODEC_ID_RAWVIDEO,
548  .write_packet = ff_raw_write_packet,
549  .p.flags = AVFMT_NOTIMESTAMPS,
550 };
551 #endif
552 
553 #if CONFIG_SBC_MUXER
555  .p.name = "sbc",
556  .p.long_name = NULL_IF_CONFIG_SMALL("raw SBC"),
557  .p.mime_type = "audio/x-sbc",
558  .p.extensions = "sbc,msbc",
559  .p.audio_codec = AV_CODEC_ID_SBC,
560  .init = force_one_stream,
561  .write_packet = ff_raw_write_packet,
562  .p.flags = AVFMT_NOTIMESTAMPS,
563 };
564 #endif
565 
566 #if CONFIG_TRUEHD_MUXER
568  .p.name = "truehd",
569  .p.long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
570  .p.extensions = "thd",
571  .p.audio_codec = AV_CODEC_ID_TRUEHD,
572  .p.video_codec = AV_CODEC_ID_NONE,
573  .init = force_one_stream,
574  .write_packet = ff_raw_write_packet,
575  .p.flags = AVFMT_NOTIMESTAMPS,
576 };
577 #endif
578 
579 #if CONFIG_VC1_MUXER
581  .p.name = "vc1",
582  .p.long_name = NULL_IF_CONFIG_SMALL("raw VC-1 video"),
583  .p.extensions = "vc1",
584  .p.audio_codec = AV_CODEC_ID_NONE,
585  .p.video_codec = AV_CODEC_ID_VC1,
586  .init = force_one_stream,
587  .write_packet = ff_raw_write_packet,
588  .p.flags = AVFMT_NOTIMESTAMPS,
589 };
590 #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:446
ff_dirac_muxer
const FFOutputFormat ff_dirac_muxer
AVOutputFormat::name
const char * name
Definition: avformat.h:511
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:480
AV_CODEC_ID_DIRAC
@ AV_CODEC_ID_DIRAC
Definition: codec_id.h:168
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:491
ff_g726le_muxer
const FFOutputFormat ff_g726le_muxer
AV_CODEC_ID_AVS2
@ AV_CODEC_ID_AVS2
Definition: codec_id.h:246
ff_h261_muxer
const FFOutputFormat ff_h261_muxer
AV_CODEC_ID_ADPCM_G722
@ AV_CODEC_ID_ADPCM_G722
Definition: codec_id.h:398
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:319
AV_CODEC_ID_TRUEHD
@ AV_CODEC_ID_TRUEHD
Definition: codec_id.h:487
FFOutputFormat::p
AVOutputFormat p
The public AVOutputFormat.
Definition: mux.h:36
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:513
ff_dts_muxer
const FFOutputFormat ff_dts_muxer
AV_CODEC_ID_SBC
@ AV_CODEC_ID_SBC
Definition: codec_id.h:530
pkt
AVPacket * pkt
Definition: movenc.c:59
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
AV_CODEC_ID_ADPCM_G726
@ AV_CODEC_ID_ADPCM_G726
Definition: codec_id.h:381
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_CODEC_ID_EVC
@ AV_CODEC_ID_EVC
Definition: codec_id.h:324
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_ID_MP2
@ AV_CODEC_ID_MP2
Definition: codec_id.h:443
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:510
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:248
AVFormatContext
Format I/O context.
Definition: avformat.h:1115
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:283
ff_evc_muxer
const FFOutputFormat ff_evc_muxer
force_one_stream
static int force_one_stream(AVFormatContext *s)
Definition: rawenc.c:37
AV_CODEC_ID_G723_1
@ AV_CODEC_ID_G723_1
Definition: codec_id.h:495
FFOutputFormat
Definition: mux.h:32
ff_vc1_muxer
const FFOutputFormat ff_vc1_muxer
AVCodecParameters::ch_layout
AVChannelLayout ch_layout
Audio only.
Definition: codec_par.h:206
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:461
AV_CODEC_ID_EAC3
@ AV_CODEC_ID_EAC3
Definition: codec_id.h:483
AVIOContext
Bytestream IO Context.
Definition: avio.h:166
AV_CODEC_ID_ADPCM_ADX
@ AV_CODEC_ID_ADPCM_ADX
Definition: codec_id.h:379
AVPacket::size
int size
Definition: packet.h:492
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:106
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:271
ff_mlp_muxer
const FFOutputFormat ff_mlp_muxer
AV_CODEC_ID_DTS
@ AV_CODEC_ID_DTS
Definition: codec_id.h:447
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:248
avio_wb32
void avio_wb32(AVIOContext *s, unsigned int val)
Definition: aviobuf.c:412
AV_CODEC_ID_VVC
@ AV_CODEC_ID_VVC
Definition: codec_id.h:250
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
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition: codec_id.h:226
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:841
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:278
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:405
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
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
ff_gsm_muxer
const FFOutputFormat ff_gsm_muxer
AVPacket
This structure stores compressed data.
Definition: packet.h:468
ff_mpeg1video_muxer
const FFOutputFormat ff_mpeg1video_muxer
AV_CODEC_ID_DFPWM
@ AV_CODEC_ID_DFPWM
Definition: codec_id.h:539
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:528
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:1347
AV_CODEC_ID_APTX_HD
@ AV_CODEC_ID_APTX_HD
Definition: codec_id.h:529
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:472
ff_mpeg2video_muxer
const FFOutputFormat ff_mpeg2video_muxer
mux.h