2 * RAW muxer and demuxer
3 * Copyright (c) 2001 Fabrice Bellard
4 * Copyright (c) 2005 Alex Beregszaszi
6 * This file is part of FFmpeg.
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.
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.
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
23 #include "libavutil/crc.h"
24 #include "libavcodec/ac3_parser.h"
25 #include "libavcodec/get_bits.h"
26 #include "libavcodec/bytestream.h"
35 static int roq_write_header(struct AVFormatContext
*s
)
37 static const uint8_t header
[] = {
38 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00
41 put_buffer(s
->pb
, header
, 8);
42 put_flush_packet(s
->pb
);
49 static int null_write_packet(struct AVFormatContext
*s
, AVPacket
*pkt
)
56 static int raw_write_packet(struct AVFormatContext
*s
, AVPacket
*pkt
)
58 put_buffer(s
->pb
, pkt
->data
, pkt
->size
);
59 put_flush_packet(s
->pb
);
66 static int raw_read_header(AVFormatContext
*s
, AVFormatParameters
*ap
)
71 st
= av_new_stream(s
, 0);
73 return AVERROR(ENOMEM
);
75 id
= s
->iformat
->value
;
76 if (id
== CODEC_ID_RAWVIDEO
) {
77 st
->codec
->codec_type
= CODEC_TYPE_VIDEO
;
79 st
->codec
->codec_type
= CODEC_TYPE_AUDIO
;
81 st
->codec
->codec_id
= id
;
83 switch(st
->codec
->codec_type
) {
84 case CODEC_TYPE_AUDIO
:
85 st
->codec
->sample_rate
= ap
->sample_rate
;
86 if(ap
->channels
) st
->codec
->channels
= ap
->channels
;
87 else st
->codec
->channels
= 1;
88 st
->codec
->bits_per_coded_sample
= av_get_bits_per_sample(st
->codec
->codec_id
);
89 assert(st
->codec
->bits_per_coded_sample
> 0);
90 st
->codec
->block_align
= st
->codec
->bits_per_coded_sample
*st
->codec
->channels
/8;
91 av_set_pts_info(st
, 64, 1, st
->codec
->sample_rate
);
93 case CODEC_TYPE_VIDEO
:
95 av_set_pts_info(st
, 64, ap
->time_base
.num
, ap
->time_base
.den
);
97 av_set_pts_info(st
, 64, 1, 25);
98 st
->codec
->width
= ap
->width
;
99 st
->codec
->height
= ap
->height
;
100 st
->codec
->pix_fmt
= ap
->pix_fmt
;
101 if(st
->codec
->pix_fmt
== PIX_FMT_NONE
)
102 st
->codec
->pix_fmt
= PIX_FMT_YUV420P
;
110 #define RAW_PACKET_SIZE 1024
111 #define RAW_SAMPLES 1024
113 static int raw_read_packet(AVFormatContext
*s
, AVPacket
*pkt
)
116 // AVStream *st = s->streams[0];
118 size
= RAW_SAMPLES
*s
->streams
[0]->codec
->block_align
;
120 ret
= av_get_packet(s
->pb
, pkt
, size
);
122 pkt
->stream_index
= 0;
126 /* note: we need to modify the packet size here to handle the last
130 bps
= av_get_bits_per_sample(s
->streams
[0]->codec
->codec_id
);
131 assert(bps
); // if false there IS a bug elsewhere (NOT in this function)
133 pkt
->pts
= pkt
->pos
*8 / (bps
* s
->streams
[0]->codec
->channels
);
138 int ff_raw_read_partial_packet(AVFormatContext
*s
, AVPacket
*pkt
)
142 size
= RAW_PACKET_SIZE
;
144 if (av_new_packet(pkt
, size
) < 0)
147 pkt
->pos
= url_ftell(s
->pb
);
148 pkt
->stream_index
= 0;
149 ret
= get_partial_buffer(s
->pb
, pkt
->data
, size
);
159 #if CONFIG_RAWVIDEO_DEMUXER
160 static int rawvideo_read_packet(AVFormatContext
*s
, AVPacket
*pkt
)
162 int packet_size
, ret
, width
, height
;
163 AVStream
*st
= s
->streams
[0];
165 width
= st
->codec
->width
;
166 height
= st
->codec
->height
;
168 packet_size
= avpicture_get_size(st
->codec
->pix_fmt
, width
, height
);
172 ret
= av_get_packet(s
->pb
, pkt
, packet_size
);
174 pkt
->dts
= pkt
->pos
/ packet_size
;
176 pkt
->stream_index
= 0;
177 if (ret
!= packet_size
) {
185 #if CONFIG_INGENIENT_DEMUXER
186 // http://www.artificis.hu/files/texts/ingenient.txt
187 static int ingenient_read_packet(AVFormatContext
*s
, AVPacket
*pkt
)
189 int ret
, size
, w
, h
, unk1
, unk2
;
191 if (get_le32(s
->pb
) != MKTAG('M', 'J', 'P', 'G'))
192 return AVERROR(EIO
); // FIXME
194 size
= get_le32(s
->pb
);
199 url_fskip(s
->pb
, 8); // zero + size (padded?)
201 unk1
= get_le16(s
->pb
);
202 unk2
= get_le16(s
->pb
);
203 url_fskip(s
->pb
, 22); // ASCII timestamp
205 av_log(s
, AV_LOG_DEBUG
, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n",
206 size
, w
, h
, unk1
, unk2
);
208 if (av_new_packet(pkt
, size
) < 0)
211 pkt
->pos
= url_ftell(s
->pb
);
212 pkt
->stream_index
= 0;
213 ret
= get_buffer(s
->pb
, pkt
->data
, size
);
224 int pcm_read_seek(AVFormatContext
*s
,
225 int stream_index
, int64_t timestamp
, int flags
)
228 int block_align
, byte_rate
, ret
;
233 block_align
= st
->codec
->block_align
? st
->codec
->block_align
:
234 (av_get_bits_per_sample(st
->codec
->codec_id
) * st
->codec
->channels
) >> 3;
235 byte_rate
= st
->codec
->bit_rate
? st
->codec
->bit_rate
>> 3 :
236 block_align
* st
->codec
->sample_rate
;
238 if (block_align
<= 0 || byte_rate
<= 0)
240 if (timestamp
< 0) timestamp
= 0;
242 /* compute the position by aligning it to block_align */
243 pos
= av_rescale_rnd(timestamp
* byte_rate
,
245 st
->time_base
.den
* (int64_t)block_align
,
246 (flags
& AVSEEK_FLAG_BACKWARD
) ? AV_ROUND_DOWN
: AV_ROUND_UP
);
249 /* recompute exact position */
250 st
->cur_dts
= av_rescale(pos
, st
->time_base
.den
, byte_rate
* (int64_t)st
->time_base
.num
);
251 if ((ret
= url_fseek(s
->pb
, pos
+ s
->data_offset
, SEEK_SET
)) < 0)
256 static int audio_read_header(AVFormatContext
*s
,
257 AVFormatParameters
*ap
)
259 AVStream
*st
= av_new_stream(s
, 0);
261 return AVERROR(ENOMEM
);
262 st
->codec
->codec_type
= CODEC_TYPE_AUDIO
;
263 st
->codec
->codec_id
= s
->iformat
->value
;
264 st
->need_parsing
= AVSTREAM_PARSE_FULL
;
265 /* the parameters will be extracted from the compressed bitstream */
270 /* MPEG-1/H.263 input */
271 static int video_read_header(AVFormatContext
*s
,
272 AVFormatParameters
*ap
)
276 st
= av_new_stream(s
, 0);
278 return AVERROR(ENOMEM
);
280 st
->codec
->codec_type
= CODEC_TYPE_VIDEO
;
281 st
->codec
->codec_id
= s
->iformat
->value
;
282 st
->need_parsing
= AVSTREAM_PARSE_FULL
;
284 /* for MJPEG, specify frame rate */
285 /* for MPEG-4 specify it, too (most MPEG-4 streams do not have the fixed_vop_rate set ...)*/
286 if (ap
->time_base
.num
) {
287 st
->codec
->time_base
= ap
->time_base
;
288 } else if ( st
->codec
->codec_id
== CODEC_ID_MJPEG
||
289 st
->codec
->codec_id
== CODEC_ID_MPEG4
||
290 st
->codec
->codec_id
== CODEC_ID_DIRAC
||
291 st
->codec
->codec_id
== CODEC_ID_H264
) {
292 st
->codec
->time_base
= (AVRational
){1,25};
294 av_set_pts_info(st
, 64, 1, 1200000);
300 #if CONFIG_MPEGVIDEO_DEMUXER
301 #define SEQ_START_CODE 0x000001b3
302 #define GOP_START_CODE 0x000001b8
303 #define PICTURE_START_CODE 0x00000100
304 #define SLICE_START_CODE 0x00000101
305 #define PACK_START_CODE 0x000001ba
306 #define VIDEO_ID 0x000001e0
307 #define AUDIO_ID 0x000001c0
309 static int mpegvideo_probe(AVProbeData
*p
)
312 int pic
=0, seq
=0, slice
=0, pspack
=0, pes
=0;
315 for(i
=0; i
<p
->buf_size
; i
++){
316 code
= (code
<<8) + p
->buf
[i
];
317 if ((code
& 0xffffff00) == 0x100) {
319 case SEQ_START_CODE
: seq
++; break;
320 case PICTURE_START_CODE
: pic
++; break;
321 case SLICE_START_CODE
: slice
++; break;
322 case PACK_START_CODE
: pspack
++; break;
324 if ((code
& 0x1f0) == VIDEO_ID
) pes
++;
325 else if((code
& 0x1e0) == AUDIO_ID
) pes
++;
328 if(seq
&& seq
*9<=pic
*10 && pic
*9<=slice
*10 && !pspack
&& !pes
)
329 return AVPROBE_SCORE_MAX
/2+1; // +1 for .mpg
334 #if CONFIG_CAVSVIDEO_DEMUXER
335 #define CAVS_SEQ_START_CODE 0x000001b0
336 #define CAVS_PIC_I_START_CODE 0x000001b3
337 #define CAVS_UNDEF_START_CODE 0x000001b4
338 #define CAVS_PIC_PB_START_CODE 0x000001b6
339 #define CAVS_VIDEO_EDIT_CODE 0x000001b7
340 #define CAVS_PROFILE_JIZHUN 0x20
342 static int cavsvideo_probe(AVProbeData
*p
)
345 int pic
=0, seq
=0, slice_pos
= 0;
348 for(i
=0; i
<p
->buf_size
; i
++){
349 code
= (code
<<8) + p
->buf
[i
];
350 if ((code
& 0xffffff00) == 0x100) {
351 if(code
< CAVS_SEQ_START_CODE
) {
352 /* slices have to be consecutive */
359 if (code
== CAVS_SEQ_START_CODE
) {
361 /* check for the only currently supported profile */
362 if(p
->buf
[i
+1] != CAVS_PROFILE_JIZHUN
)
364 } else if ((code
== CAVS_PIC_I_START_CODE
) ||
365 (code
== CAVS_PIC_PB_START_CODE
)) {
367 } else if ((code
== CAVS_UNDEF_START_CODE
) ||
368 (code
> CAVS_VIDEO_EDIT_CODE
)) {
373 if(seq
&& seq
*9<=pic
*10)
374 return AVPROBE_SCORE_MAX
/2;
379 #if CONFIG_M4V_DEMUXER
380 #define VISUAL_OBJECT_START_CODE 0x000001b5
381 #define VOP_START_CODE 0x000001b6
383 static int mpeg4video_probe(AVProbeData
*probe_packet
)
385 uint32_t temp_buffer
= -1;
386 int VO
=0, VOL
=0, VOP
= 0, VISO
= 0, res
=0;
389 for(i
=0; i
<probe_packet
->buf_size
; i
++){
390 temp_buffer
= (temp_buffer
<<8) + probe_packet
->buf
[i
];
391 if ((temp_buffer
& 0xffffff00) != 0x100)
394 if (temp_buffer
== VOP_START_CODE
) VOP
++;
395 else if (temp_buffer
== VISUAL_OBJECT_START_CODE
) VISO
++;
396 else if (temp_buffer
< 0x120) VO
++;
397 else if (temp_buffer
< 0x130) VOL
++;
398 else if ( !(0x1AF < temp_buffer
&& temp_buffer
< 0x1B7)
399 && !(0x1B9 < temp_buffer
&& temp_buffer
< 0x1C4)) res
++;
402 if ( VOP
>= VISO
&& VOP
>= VOL
&& VO
>= VOL
&& VOL
> 0 && res
==0)
403 return AVPROBE_SCORE_MAX
/2;
408 #if CONFIG_H264_DEMUXER
409 static int h264_probe(AVProbeData
*p
)
412 int sps
=0, pps
=0, idr
=0, res
=0, sli
=0;
415 for(i
=0; i
<p
->buf_size
; i
++){
416 code
= (code
<<8) + p
->buf
[i
];
417 if ((code
& 0xffffff00) == 0x100) {
418 int ref_idc
= (code
>>5)&3;
419 int type
= code
& 0x1F;
420 static const int8_t ref_zero
[32]={
421 2, 0, 0, 0, 0,-1, 1,-1,
422 -1, 1, 1, 1, 1,-1, 2, 2,
423 2, 2, 2, 0, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2
427 if(code
& 0x80) //forbidden bit
430 if(ref_zero
[type
] == 1 && ref_idc
)
432 if(ref_zero
[type
] ==-1 && !ref_idc
)
434 if(ref_zero
[type
] == 2)
438 case 1: sli
++; break;
439 case 5: idr
++; break;
445 case 8: pps
++; break;
449 if(sps
&& pps
&& (idr
||sli
>3) && res
<(sps
+pps
+idr
))
450 return AVPROBE_SCORE_MAX
/2+1; // +1 for .mpg
455 #if CONFIG_H263_DEMUXER
456 static int h263_probe(AVProbeData
*p
)
462 code
= (d
[0] << 14) | (d
[1] << 6) | (d
[2] >> 2);
470 #if CONFIG_H261_DEMUXER
471 static int h261_probe(AVProbeData
*p
)
477 code
= (d
[0] << 12) | (d
[1] << 4) | (d
[2] >> 4);
485 #if CONFIG_DTS_DEMUXER
486 #define DCA_MARKER_14B_BE 0x1FFFE800
487 #define DCA_MARKER_14B_LE 0xFF1F00E8
488 #define DCA_MARKER_RAW_BE 0x7FFE8001
489 #define DCA_MARKER_RAW_LE 0xFE7F0180
490 static int dts_probe(AVProbeData
*p
)
492 const uint8_t *buf
, *bufp
;
497 for(; buf
< (p
->buf
+p
->buf_size
)-2; buf
+=2) {
499 state
= (state
<< 16) | bytestream_get_be16(&bufp
);
501 /* regular bitstream */
502 if (state
== DCA_MARKER_RAW_BE
|| state
== DCA_MARKER_RAW_LE
)
503 return AVPROBE_SCORE_MAX
/2+1;
505 /* 14 bits big-endian bitstream */
506 if (state
== DCA_MARKER_14B_BE
)
507 if ((bytestream_get_be16(&bufp
) & 0xFFF0) == 0x07F0)
508 return AVPROBE_SCORE_MAX
/2+1;
510 /* 14 bits little-endian bitstream */
511 if (state
== DCA_MARKER_14B_LE
)
512 if ((bytestream_get_be16(&bufp
) & 0xF0FF) == 0xF007)
513 return AVPROBE_SCORE_MAX
/2+1;
520 #if CONFIG_DIRAC_DEMUXER
521 static int dirac_probe(AVProbeData
*p
)
523 if (AV_RL32(p
->buf
) == MKTAG('B', 'B', 'C', 'D'))
524 return AVPROBE_SCORE_MAX
;
530 #if CONFIG_DNXHD_DEMUXER
531 static int dnxhd_probe(AVProbeData
*p
)
533 static const uint8_t header
[] = {0x00,0x00,0x02,0x80,0x01};
534 if (!memcmp(p
->buf
, header
, 5))
535 return AVPROBE_SCORE_MAX
;
541 #if CONFIG_AC3_DEMUXER || CONFIG_EAC3_DEMUXER
542 static int ac3_eac3_probe(AVProbeData
*p
, enum CodecID expected_codec_id
)
544 int max_frames
, first_frames
= 0, frames
;
545 uint8_t *buf
, *buf2
, *end
;
548 enum CodecID codec_id
= CODEC_ID_AC3
;
552 end
= buf
+ p
->buf_size
;
554 for(; buf
< end
; buf
++) {
557 for(frames
= 0; buf2
< end
; frames
++) {
558 init_get_bits(&gbc
, buf2
, 54);
559 if(ff_ac3_parse_header(&gbc
, &hdr
) < 0)
561 if(buf2
+ hdr
.frame_size
> end
||
562 av_crc(av_crc_get_table(AV_CRC_16_ANSI
), 0, buf2
+ 2, hdr
.frame_size
- 2))
564 if (hdr
.bitstream_id
> 10)
565 codec_id
= CODEC_ID_EAC3
;
566 buf2
+= hdr
.frame_size
;
568 max_frames
= FFMAX(max_frames
, frames
);
570 first_frames
= frames
;
572 if(codec_id
!= expected_codec_id
) return 0;
573 if (first_frames
>=3) return AVPROBE_SCORE_MAX
* 3 / 4;
574 else if(max_frames
>=3) return AVPROBE_SCORE_MAX
/ 2;
575 else if(max_frames
>=1) return 1;
580 #if CONFIG_AC3_DEMUXER
581 static int ac3_probe(AVProbeData
*p
)
583 return ac3_eac3_probe(p
, CODEC_ID_AC3
);
587 #if CONFIG_EAC3_DEMUXER
588 static int eac3_probe(AVProbeData
*p
)
590 return ac3_eac3_probe(p
, CODEC_ID_EAC3
);
594 #if CONFIG_AAC_DEMUXER
595 static int adts_aac_probe(AVProbeData
*p
)
597 int max_frames
= 0, first_frames
= 0;
599 uint8_t *buf0
= p
->buf
;
602 uint8_t *end
= buf0
+ p
->buf_size
- 7;
604 if (ff_id3v2_match(buf0
)) {
605 buf0
+= ff_id3v2_tag_len(buf0
);
609 for(; buf
< end
; buf
= buf2
+1) {
612 for(frames
= 0; buf2
< end
; frames
++) {
613 uint32_t header
= AV_RB16(buf2
);
614 if((header
&0xFFF6) != 0xFFF0)
616 fsize
= (AV_RB32(buf2
+3)>>13) & 0x8FFF;
621 max_frames
= FFMAX(max_frames
, frames
);
623 first_frames
= frames
;
625 if (first_frames
>=3) return AVPROBE_SCORE_MAX
/2+1;
626 else if(max_frames
>500)return AVPROBE_SCORE_MAX
/2;
627 else if(max_frames
>=3) return AVPROBE_SCORE_MAX
/4;
628 else if(max_frames
>=1) return 1;
632 static int adts_aac_read_header(AVFormatContext
*s
,
633 AVFormatParameters
*ap
)
637 st
= av_new_stream(s
, 0);
639 return AVERROR(ENOMEM
);
641 st
->codec
->codec_type
= CODEC_TYPE_AUDIO
;
642 st
->codec
->codec_id
= s
->iformat
->value
;
643 st
->need_parsing
= AVSTREAM_PARSE_FULL
;
653 /* Note: Do not forget to add new entries to the Makefile as well. */
655 #if CONFIG_AAC_DEMUXER
656 AVInputFormat aac_demuxer
= {
658 NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
661 adts_aac_read_header
,
662 ff_raw_read_partial_packet
,
663 .flags
= AVFMT_GENERIC_INDEX
,
665 .value
= CODEC_ID_AAC
,
669 #if CONFIG_AC3_DEMUXER
670 AVInputFormat ac3_demuxer
= {
672 NULL_IF_CONFIG_SMALL("raw AC-3"),
676 ff_raw_read_partial_packet
,
677 .flags
= AVFMT_GENERIC_INDEX
,
679 .value
= CODEC_ID_AC3
,
684 AVOutputFormat ac3_muxer
= {
686 NULL_IF_CONFIG_SMALL("raw AC-3"),
694 .flags
= AVFMT_NOTIMESTAMPS
,
698 #if CONFIG_DIRAC_DEMUXER
699 AVInputFormat dirac_demuxer
= {
701 NULL_IF_CONFIG_SMALL("raw Dirac"),
705 ff_raw_read_partial_packet
,
706 .flags
= AVFMT_GENERIC_INDEX
,
707 .value
= CODEC_ID_DIRAC
,
711 #if CONFIG_DIRAC_MUXER
712 AVOutputFormat dirac_muxer
= {
714 NULL_IF_CONFIG_SMALL("raw Dirac"),
722 .flags
= AVFMT_NOTIMESTAMPS
,
726 #if CONFIG_DNXHD_DEMUXER
727 AVInputFormat dnxhd_demuxer
= {
729 NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
733 ff_raw_read_partial_packet
,
734 .flags
= AVFMT_GENERIC_INDEX
,
735 .value
= CODEC_ID_DNXHD
,
739 #if CONFIG_DNXHD_MUXER
740 AVOutputFormat dnxhd_muxer
= {
742 NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
750 .flags
= AVFMT_NOTIMESTAMPS
,
754 #if CONFIG_DTS_DEMUXER
755 AVInputFormat dts_demuxer
= {
757 NULL_IF_CONFIG_SMALL("raw DTS"),
761 ff_raw_read_partial_packet
,
762 .flags
= AVFMT_GENERIC_INDEX
,
764 .value
= CODEC_ID_DTS
,
769 AVOutputFormat dts_muxer
= {
771 NULL_IF_CONFIG_SMALL("raw DTS"),
779 .flags
= AVFMT_NOTIMESTAMPS
,
783 #if CONFIG_EAC3_DEMUXER
784 AVInputFormat eac3_demuxer
= {
786 NULL_IF_CONFIG_SMALL("raw E-AC-3"),
790 ff_raw_read_partial_packet
,
791 .flags
= AVFMT_GENERIC_INDEX
,
792 .extensions
= "eac3",
793 .value
= CODEC_ID_EAC3
,
797 #if CONFIG_EAC3_MUXER
798 AVOutputFormat eac3_muxer
= {
800 NULL_IF_CONFIG_SMALL("raw E-AC-3"),
808 .flags
= AVFMT_NOTIMESTAMPS
,
812 #if CONFIG_GSM_DEMUXER
813 AVInputFormat gsm_demuxer
= {
815 NULL_IF_CONFIG_SMALL("raw GSM"),
819 ff_raw_read_partial_packet
,
820 .flags
= AVFMT_GENERIC_INDEX
,
822 .value
= CODEC_ID_GSM
,
826 #if CONFIG_H261_DEMUXER
827 AVInputFormat h261_demuxer
= {
829 NULL_IF_CONFIG_SMALL("raw H.261"),
833 ff_raw_read_partial_packet
,
834 .flags
= AVFMT_GENERIC_INDEX
,
835 .extensions
= "h261",
836 .value
= CODEC_ID_H261
,
840 #if CONFIG_H261_MUXER
841 AVOutputFormat h261_muxer
= {
843 NULL_IF_CONFIG_SMALL("raw H.261"),
851 .flags
= AVFMT_NOTIMESTAMPS
,
855 #if CONFIG_H263_DEMUXER
856 AVInputFormat h263_demuxer
= {
858 NULL_IF_CONFIG_SMALL("raw H.263"),
862 ff_raw_read_partial_packet
,
863 .flags
= AVFMT_GENERIC_INDEX
,
864 // .extensions = "h263", //FIXME remove after writing mpeg4_probe
865 .value
= CODEC_ID_H263
,
869 #if CONFIG_H263_MUXER
870 AVOutputFormat h263_muxer
= {
872 NULL_IF_CONFIG_SMALL("raw H.263"),
880 .flags
= AVFMT_NOTIMESTAMPS
,
884 #if CONFIG_H264_DEMUXER
885 AVInputFormat h264_demuxer
= {
887 NULL_IF_CONFIG_SMALL("raw H.264 video format"),
891 ff_raw_read_partial_packet
,
892 .flags
= AVFMT_GENERIC_INDEX
,
893 .extensions
= "h26l,h264,264", //FIXME remove after writing mpeg4_probe
894 .value
= CODEC_ID_H264
,
898 #if CONFIG_H264_MUXER
899 AVOutputFormat h264_muxer
= {
901 NULL_IF_CONFIG_SMALL("raw H.264 video format"),
909 .flags
= AVFMT_NOTIMESTAMPS
,
913 #if CONFIG_INGENIENT_DEMUXER
914 AVInputFormat ingenient_demuxer
= {
916 NULL_IF_CONFIG_SMALL("raw Ingenient MJPEG"),
920 ingenient_read_packet
,
921 .flags
= AVFMT_GENERIC_INDEX
,
922 .extensions
= "cgi", // FIXME
923 .value
= CODEC_ID_MJPEG
,
927 #if CONFIG_M4V_DEMUXER
928 AVInputFormat m4v_demuxer
= {
930 NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
932 mpeg4video_probe
, /** probing for MPEG-4 data */
934 ff_raw_read_partial_packet
,
935 .flags
= AVFMT_GENERIC_INDEX
,
937 .value
= CODEC_ID_MPEG4
,
942 AVOutputFormat m4v_muxer
= {
944 NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
952 .flags
= AVFMT_NOTIMESTAMPS
,
956 #if CONFIG_MJPEG_DEMUXER
957 AVInputFormat mjpeg_demuxer
= {
959 NULL_IF_CONFIG_SMALL("raw MJPEG video"),
963 ff_raw_read_partial_packet
,
964 .flags
= AVFMT_GENERIC_INDEX
,
965 .extensions
= "mjpg,mjpeg",
966 .value
= CODEC_ID_MJPEG
,
970 #if CONFIG_MJPEG_MUXER
971 AVOutputFormat mjpeg_muxer
= {
973 NULL_IF_CONFIG_SMALL("raw MJPEG video"),
981 .flags
= AVFMT_NOTIMESTAMPS
,
985 #if CONFIG_MLP_DEMUXER
986 AVInputFormat mlp_demuxer
= {
988 NULL_IF_CONFIG_SMALL("raw MLP"),
992 ff_raw_read_partial_packet
,
993 .flags
= AVFMT_GENERIC_INDEX
,
995 .value
= CODEC_ID_MLP
,
1000 AVOutputFormat mlp_muxer
= {
1002 NULL_IF_CONFIG_SMALL("raw MLP"),
1010 .flags
= AVFMT_NOTIMESTAMPS
,
1014 #if CONFIG_TRUEHD_DEMUXER
1015 AVInputFormat truehd_demuxer
= {
1017 NULL_IF_CONFIG_SMALL("raw TrueHD"),
1021 ff_raw_read_partial_packet
,
1022 .flags
= AVFMT_GENERIC_INDEX
,
1023 .extensions
= "thd",
1024 .value
= CODEC_ID_TRUEHD
,
1028 #if CONFIG_TRUEHD_MUXER
1029 AVOutputFormat truehd_muxer
= {
1031 NULL_IF_CONFIG_SMALL("raw TrueHD"),
1039 .flags
= AVFMT_NOTIMESTAMPS
,
1043 #if CONFIG_MPEG1VIDEO_MUXER
1044 AVOutputFormat mpeg1video_muxer
= {
1046 NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
1051 CODEC_ID_MPEG1VIDEO
,
1054 .flags
= AVFMT_NOTIMESTAMPS
,
1058 #if CONFIG_MPEG2VIDEO_MUXER
1059 AVOutputFormat mpeg2video_muxer
= {
1061 NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
1066 CODEC_ID_MPEG2VIDEO
,
1069 .flags
= AVFMT_NOTIMESTAMPS
,
1073 #if CONFIG_MPEGVIDEO_DEMUXER
1074 AVInputFormat mpegvideo_demuxer
= {
1076 NULL_IF_CONFIG_SMALL("raw MPEG video"),
1080 ff_raw_read_partial_packet
,
1081 .flags
= AVFMT_GENERIC_INDEX
,
1082 .value
= CODEC_ID_MPEG1VIDEO
,
1086 #if CONFIG_CAVSVIDEO_DEMUXER
1087 AVInputFormat cavsvideo_demuxer
= {
1089 NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
1093 ff_raw_read_partial_packet
,
1094 .flags
= AVFMT_GENERIC_INDEX
,
1095 .value
= CODEC_ID_CAVS
,
1099 #if CONFIG_NULL_MUXER
1100 AVOutputFormat null_muxer
= {
1102 NULL_IF_CONFIG_SMALL("raw null video format"),
1114 .flags
= AVFMT_NOFILE
| AVFMT_RAWPICTURE
| AVFMT_NOTIMESTAMPS
,
1118 #if CONFIG_RAWVIDEO_DEMUXER
1119 AVInputFormat rawvideo_demuxer
= {
1121 NULL_IF_CONFIG_SMALL("raw video format"),
1125 rawvideo_read_packet
,
1126 .flags
= AVFMT_GENERIC_INDEX
,
1127 .extensions
= "yuv,cif,qcif,rgb",
1128 .value
= CODEC_ID_RAWVIDEO
,
1132 #if CONFIG_RAWVIDEO_MUXER
1133 AVOutputFormat rawvideo_muxer
= {
1135 NULL_IF_CONFIG_SMALL("raw video format"),
1143 .flags
= AVFMT_NOTIMESTAMPS
,
1147 #if CONFIG_ROQ_MUXER
1148 AVOutputFormat roq_muxer
=
1151 NULL_IF_CONFIG_SMALL("raw id RoQ format"),
1162 #if CONFIG_SHORTEN_DEMUXER
1163 AVInputFormat shorten_demuxer
= {
1165 NULL_IF_CONFIG_SMALL("raw Shorten"),
1169 ff_raw_read_partial_packet
,
1170 .flags
= AVFMT_GENERIC_INDEX
,
1171 .extensions
= "shn",
1172 .value
= CODEC_ID_SHORTEN
,
1176 #if CONFIG_VC1_DEMUXER
1177 AVInputFormat vc1_demuxer
= {
1179 NULL_IF_CONFIG_SMALL("raw VC-1"),
1181 NULL
/* vc1_probe */,
1183 ff_raw_read_partial_packet
,
1184 .extensions
= "vc1",
1185 .value
= CODEC_ID_VC1
,
1191 #define PCMINPUTDEF(name, long_name, ext, codec) \
1192 AVInputFormat pcm_ ## name ## _demuxer = {\
1194 NULL_IF_CONFIG_SMALL(long_name),\
1201 .flags= AVFMT_GENERIC_INDEX,\
1206 #define PCMOUTPUTDEF(name, long_name, ext, codec) \
1207 AVOutputFormat pcm_ ## name ## _muxer = {\
1209 NULL_IF_CONFIG_SMALL(long_name),\
1217 .flags= AVFMT_NOTIMESTAMPS,\
1221 #if !CONFIG_MUXERS && CONFIG_DEMUXERS
1222 #define PCMDEF(name, long_name, ext, codec) \
1223 PCMINPUTDEF(name, long_name, ext, codec)
1224 #elif CONFIG_MUXERS && !CONFIG_DEMUXERS
1225 #define PCMDEF(name, long_name, ext, codec) \
1226 PCMOUTPUTDEF(name, long_name, ext, codec)
1227 #elif CONFIG_MUXERS && CONFIG_DEMUXERS
1228 #define PCMDEF(name, long_name, ext, codec) \
1229 PCMINPUTDEF(name, long_name, ext, codec)\
1230 PCMOUTPUTDEF(name, long_name, ext, codec)
1232 #define PCMDEF(name, long_name, ext, codec)
1237 #define LE_DEF(s) NULL
1239 #define BE_DEF(s) NULL
1243 PCMDEF(f64be
, "PCM 64 bit floating-point big-endian format",
1244 NULL
, CODEC_ID_PCM_F64BE
)
1246 PCMDEF(f64le
, "PCM 64 bit floating-point little-endian format",
1247 NULL
, CODEC_ID_PCM_F64LE
)
1249 PCMDEF(f32be
, "PCM 32 bit floating-point big-endian format",
1250 NULL
, CODEC_ID_PCM_F32BE
)
1252 PCMDEF(f32le
, "PCM 32 bit floating-point little-endian format",
1253 NULL
, CODEC_ID_PCM_F32LE
)
1255 PCMDEF(s32be
, "PCM signed 32 bit big-endian format",
1256 NULL
, CODEC_ID_PCM_S32BE
)
1258 PCMDEF(s32le
, "PCM signed 32 bit little-endian format",
1259 NULL
, CODEC_ID_PCM_S32LE
)
1261 PCMDEF(s24be
, "PCM signed 24 bit big-endian format",
1262 NULL
, CODEC_ID_PCM_S24BE
)
1264 PCMDEF(s24le
, "PCM signed 24 bit little-endian format",
1265 NULL
, CODEC_ID_PCM_S24LE
)
1267 PCMDEF(s16be
, "PCM signed 16 bit big-endian format",
1268 BE_DEF("sw"), CODEC_ID_PCM_S16BE
)
1270 PCMDEF(s16le
, "PCM signed 16 bit little-endian format",
1271 LE_DEF("sw"), CODEC_ID_PCM_S16LE
)
1273 PCMDEF(s8
, "PCM signed 8 bit format",
1274 "sb", CODEC_ID_PCM_S8
)
1276 PCMDEF(u32be
, "PCM unsigned 32 bit big-endian format",
1277 NULL
, CODEC_ID_PCM_U32BE
)
1279 PCMDEF(u32le
, "PCM unsigned 32 bit little-endian format",
1280 NULL
, CODEC_ID_PCM_U32LE
)
1282 PCMDEF(u24be
, "PCM unsigned 24 bit big-endian format",
1283 NULL
, CODEC_ID_PCM_U24BE
)
1285 PCMDEF(u24le
, "PCM unsigned 24 bit little-endian format",
1286 NULL
, CODEC_ID_PCM_U24LE
)
1288 PCMDEF(u16be
, "PCM unsigned 16 bit big-endian format",
1289 BE_DEF("uw"), CODEC_ID_PCM_U16BE
)
1291 PCMDEF(u16le
, "PCM unsigned 16 bit little-endian format",
1292 LE_DEF("uw"), CODEC_ID_PCM_U16LE
)
1294 PCMDEF(u8
, "PCM unsigned 8 bit format",
1295 "ub", CODEC_ID_PCM_U8
)
1297 PCMDEF(alaw
, "PCM A-law format",
1298 "al", CODEC_ID_PCM_ALAW
)
1300 PCMDEF(mulaw
, "PCM mu-law format",
1301 "ul", CODEC_ID_PCM_MULAW
)