3 * Copyright (c) 2001, 2002 Fabrice Bellard
6 * Copyright (c) 2012 Paul B Mahol
8 * WAV muxer RF64 support
9 * Copyright (c) 2013 Daniel Verkamp <daniel@drv.nu>
11 * EBU Tech 3285 - Supplement 3 - Peak Envelope Chunk encoder
12 * Copyright (c) 2014 Georg Lippitsch <georg.lippitsch@gmx.at>
14 * This file is part of FFmpeg.
16 * FFmpeg is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
21 * FFmpeg is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with FFmpeg; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
31 #include "config_components.h"
37 #include "libavutil/avstring.h"
38 #include "libavutil/dict.h"
39 #include "libavutil/common.h"
40 #include "libavutil/intreadwrite.h"
41 #include "libavutil/mathematics.h"
42 #include "libavutil/mem.h"
43 #include "libavutil/opt.h"
44 #include "libavutil/time.h"
45 #include "libavutil/time_internal.h"
49 #include "avio_internal.h"
54 #define RF64_AUTO (-1)
65 PEAK_FORMAT_UINT8
= 1,
69 typedef struct WAVMuxContext
{
76 int16_t *peak_maxpos
, *peak_maxneg
;
77 uint32_t peak_num_frames
;
78 unsigned peak_outbuf_size
;
79 uint32_t peak_outbuf_bytes
;
80 unsigned size_increment
;
94 static inline void bwf_write_bext_string(AVFormatContext
*s
, const char *key
, int maxlen
)
96 AVDictionaryEntry
*tag
;
99 if (tag
= av_dict_get(s
->metadata
, key
, NULL
, 0)) {
100 len
= strlen(tag
->value
);
101 len
= FFMIN(len
, maxlen
);
102 avio_write(s
->pb
, tag
->value
, len
);
105 ffio_fill(s
->pb
, 0, maxlen
- len
);
108 static void bwf_write_bext_chunk(AVFormatContext
*s
)
110 AVDictionaryEntry
*tmp_tag
;
111 uint64_t time_reference
= 0;
112 int64_t bext
= ff_start_tag(s
->pb
, "bext");
114 bwf_write_bext_string(s
, "description", 256);
115 bwf_write_bext_string(s
, "originator", 32);
116 bwf_write_bext_string(s
, "originator_reference", 32);
117 bwf_write_bext_string(s
, "origination_date", 10);
118 bwf_write_bext_string(s
, "origination_time", 8);
120 if (tmp_tag
= av_dict_get(s
->metadata
, "time_reference", NULL
, 0))
121 time_reference
= strtoll(tmp_tag
->value
, NULL
, 10);
122 avio_wl64(s
->pb
, time_reference
);
123 avio_wl16(s
->pb
, 1); // set version to 1
125 if ((tmp_tag
= av_dict_get(s
->metadata
, "umid", NULL
, 0)) && strlen(tmp_tag
->value
) > 2) {
126 unsigned char umidpart_str
[17] = {0};
129 size_t len
= strlen(tmp_tag
->value
+2);
131 for (i
= 0; i
< len
/16; i
++) {
132 memcpy(umidpart_str
, tmp_tag
->value
+ 2 + (i
*16), 16);
133 umidpart
= strtoull(umidpart_str
, NULL
, 16);
134 avio_wb64(s
->pb
, umidpart
);
136 ffio_fill(s
->pb
, 0, 64 - i
*8);
138 ffio_fill(s
->pb
, 0, 64); // zero UMID
140 ffio_fill(s
->pb
, 0, 190); // Reserved
142 if (tmp_tag
= av_dict_get(s
->metadata
, "coding_history", NULL
, 0))
143 avio_put_str(s
->pb
, tmp_tag
->value
);
145 ff_end_tag(s
->pb
, bext
);
148 static av_cold
void wav_deinit(AVFormatContext
*s
)
150 WAVMuxContext
*wav
= s
->priv_data
;
152 av_freep(&wav
->peak_maxpos
);
153 av_freep(&wav
->peak_maxneg
);
154 av_freep(&wav
->peak_output
);
157 static av_cold
int peak_init_writer(AVFormatContext
*s
)
159 WAVMuxContext
*wav
= s
->priv_data
;
160 AVCodecParameters
*par
= s
->streams
[0]->codecpar
;
162 if (par
->codec_id
!= AV_CODEC_ID_PCM_S8
&&
163 par
->codec_id
!= AV_CODEC_ID_PCM_S16LE
&&
164 par
->codec_id
!= AV_CODEC_ID_PCM_U8
&&
165 par
->codec_id
!= AV_CODEC_ID_PCM_U16LE
) {
166 av_log(s
, AV_LOG_ERROR
, "Codec %s not supported for Peak Chunk\n",
167 avcodec_get_name(par
->codec_id
));
171 wav
->peak_bps
= av_get_bits_per_sample(par
->codec_id
) / 8;
173 if (wav
->peak_bps
== 1 && wav
->peak_format
== PEAK_FORMAT_UINT16
) {
174 av_log(s
, AV_LOG_ERROR
,
175 "Writing 16 bit peak for 8 bit audio does not make sense\n");
176 return AVERROR(EINVAL
);
178 if (par
->ch_layout
.nb_channels
> INT_MAX
/ (wav
->peak_bps
* wav
->peak_ppv
))
179 return AVERROR(ERANGE
);
180 wav
->size_increment
= par
->ch_layout
.nb_channels
* wav
->peak_bps
* wav
->peak_ppv
;
182 wav
->peak_maxpos
= av_calloc(par
->ch_layout
.nb_channels
, sizeof(*wav
->peak_maxpos
));
183 wav
->peak_maxneg
= av_calloc(par
->ch_layout
.nb_channels
, sizeof(*wav
->peak_maxneg
));
184 if (!wav
->peak_maxpos
|| !wav
->peak_maxneg
)
190 av_log(s
, AV_LOG_ERROR
, "Out of memory\n");
191 return AVERROR(ENOMEM
);
194 static int peak_write_frame(AVFormatContext
*s
)
196 WAVMuxContext
*wav
= s
->priv_data
;
197 AVCodecParameters
*par
= s
->streams
[0]->codecpar
;
198 unsigned new_size
= wav
->peak_outbuf_bytes
+ wav
->size_increment
;
202 if (new_size
> INT_MAX
) {
203 wav
->write_peak
= PEAK_OFF
;
204 return AVERROR(ERANGE
);
206 tmp
= av_fast_realloc(wav
->peak_output
, &wav
->peak_outbuf_size
, new_size
);
208 wav
->write_peak
= PEAK_OFF
;
209 return AVERROR(ENOMEM
);
211 wav
->peak_output
= tmp
;
213 for (c
= 0; c
< par
->ch_layout
.nb_channels
; c
++) {
214 wav
->peak_maxneg
[c
] = -wav
->peak_maxneg
[c
];
216 if (wav
->peak_bps
== 2 && wav
->peak_format
== PEAK_FORMAT_UINT8
) {
217 wav
->peak_maxpos
[c
] = wav
->peak_maxpos
[c
] / 256;
218 wav
->peak_maxneg
[c
] = wav
->peak_maxneg
[c
] / 256;
221 if (wav
->peak_ppv
== 1)
222 wav
->peak_maxpos
[c
] =
223 FFMAX(wav
->peak_maxpos
[c
], wav
->peak_maxneg
[c
]);
225 if (wav
->peak_format
== PEAK_FORMAT_UINT8
) {
226 wav
->peak_output
[wav
->peak_outbuf_bytes
++] =
228 if (wav
->peak_ppv
== 2) {
229 wav
->peak_output
[wav
->peak_outbuf_bytes
++] =
233 AV_WL16(wav
->peak_output
+ wav
->peak_outbuf_bytes
,
234 wav
->peak_maxpos
[c
]);
235 wav
->peak_outbuf_bytes
+= 2;
236 if (wav
->peak_ppv
== 2) {
237 AV_WL16(wav
->peak_output
+ wav
->peak_outbuf_bytes
,
238 wav
->peak_maxneg
[c
]);
239 wav
->peak_outbuf_bytes
+= 2;
242 wav
->peak_maxpos
[c
] = 0;
243 wav
->peak_maxneg
[c
] = 0;
245 wav
->peak_num_frames
++;
250 static int peak_write_chunk(AVFormatContext
*s
)
252 WAVMuxContext
*wav
= s
->priv_data
;
253 AVIOContext
*pb
= s
->pb
;
254 AVCodecParameters
*par
= s
->streams
[0]->codecpar
;
255 int64_t peak
= ff_start_tag(s
->pb
, "levl"); // codespell:ignore
260 /* Peak frame of incomplete block at end */
261 if (wav
->peak_block_pos
) {
262 int ret
= peak_write_frame(s
);
267 memset(timestamp
, 0, sizeof(timestamp
));
268 if (!(s
->flags
& AVFMT_FLAG_BITEXACT
)) {
270 av_log(s
, AV_LOG_INFO
, "Writing local time and date to Peak Envelope Chunk\n");
272 now_secs
= now0
/ 1000000;
273 if (strftime(timestamp
, sizeof(timestamp
), "%Y:%m:%d:%H:%M:%S:", localtime_r(&now_secs
, &tmpbuf
))) {
274 av_strlcatf(timestamp
, sizeof(timestamp
), "%03d", (int)((now0
/ 1000) % 1000));
276 av_log(s
, AV_LOG_ERROR
, "Failed to write timestamp\n");
281 avio_wl32(pb
, 1); /* version */
282 avio_wl32(pb
, wav
->peak_format
); /* 8 or 16 bit */
283 avio_wl32(pb
, wav
->peak_ppv
); /* positive and negative */
284 avio_wl32(pb
, wav
->peak_block_size
); /* frames per value */
285 avio_wl32(pb
, par
->ch_layout
.nb_channels
); /* number of channels */
286 avio_wl32(pb
, wav
->peak_num_frames
); /* number of peak frames */
287 avio_wl32(pb
, -1); /* audio sample frame position (not implemented) */
288 avio_wl32(pb
, 128); /* equal to size of header */
289 avio_write(pb
, timestamp
, 28); /* ASCII time stamp */
290 ffio_fill(pb
, 0, 60);
292 avio_write(pb
, wav
->peak_output
, wav
->peak_outbuf_bytes
);
294 ff_end_tag(pb
, peak
);
302 static int wav_write_header(AVFormatContext
*s
)
304 WAVMuxContext
*wav
= s
->priv_data
;
305 AVIOContext
*pb
= s
->pb
;
308 if (wav
->rf64
== RF64_ALWAYS
) {
309 ffio_wfourcc(pb
, "RF64");
310 avio_wl32(pb
, -1); /* RF64 chunk size: use size in ds64 */
312 ffio_wfourcc(pb
, "RIFF");
313 avio_wl32(pb
, -1); /* file length */
316 ffio_wfourcc(pb
, "WAVE");
318 if (wav
->rf64
!= RF64_NEVER
) {
319 /* write empty ds64 chunk or JUNK chunk to reserve space for ds64 */
320 ffio_wfourcc(pb
, wav
->rf64
== RF64_ALWAYS
? "ds64" : "JUNK");
321 avio_wl32(pb
, 28); /* chunk size */
322 wav
->ds64
= avio_tell(pb
);
323 ffio_fill(pb
, 0, 28);
326 if (wav
->write_peak
!= PEAK_ONLY
) {
328 fmt
= ff_start_tag(pb
, "fmt ");
329 if (ff_put_wav_header(s
, pb
, s
->streams
[0]->codecpar
, 0) < 0) {
330 av_log(s
, AV_LOG_ERROR
, "Codec %s not supported in WAVE format\n",
331 avcodec_get_name(s
->streams
[0]->codecpar
->codec_id
));
332 return AVERROR(ENOSYS
);
337 if (s
->streams
[0]->codecpar
->codec_tag
!= 0x01 /* hence for all other than PCM */
338 && (s
->pb
->seekable
& AVIO_SEEKABLE_NORMAL
)) {
339 wav
->fact_pos
= ff_start_tag(pb
, "fact");
341 ff_end_tag(pb
, wav
->fact_pos
);
345 bwf_write_bext_chunk(s
);
347 if (wav
->write_peak
) {
349 if ((ret
= peak_init_writer(s
)) < 0)
353 avpriv_set_pts_info(s
->streams
[0], 64, 1, s
->streams
[0]->codecpar
->sample_rate
);
354 wav
->maxpts
= wav
->last_duration
= 0;
355 wav
->minpts
= INT64_MAX
;
357 if (wav
->write_peak
!= PEAK_ONLY
) {
359 ff_riff_write_info(s
);
362 wav
->data
= ff_start_tag(pb
, "data");
368 static int wav_write_packet(AVFormatContext
*s
, AVPacket
*pkt
)
370 AVIOContext
*pb
= s
->pb
;
371 WAVMuxContext
*wav
= s
->priv_data
;
373 if (wav
->write_peak
!= PEAK_ONLY
)
374 avio_write(pb
, pkt
->data
, pkt
->size
);
376 if (wav
->write_peak
) {
379 for (i
= 0; i
< pkt
->size
; i
+= wav
->peak_bps
) {
380 if (wav
->peak_bps
== 1) {
381 wav
->peak_maxpos
[c
] = FFMAX(wav
->peak_maxpos
[c
], *(int8_t*)(pkt
->data
+ i
));
382 wav
->peak_maxneg
[c
] = FFMIN(wav
->peak_maxneg
[c
], *(int8_t*)(pkt
->data
+ i
));
384 wav
->peak_maxpos
[c
] = FFMAX(wav
->peak_maxpos
[c
], (int16_t)AV_RL16(pkt
->data
+ i
));
385 wav
->peak_maxneg
[c
] = FFMIN(wav
->peak_maxneg
[c
], (int16_t)AV_RL16(pkt
->data
+ i
));
387 if (++c
== s
->streams
[0]->codecpar
->ch_layout
.nb_channels
) {
389 if (++wav
->peak_block_pos
== wav
->peak_block_size
) {
390 int ret
= peak_write_frame(s
);
393 wav
->peak_block_pos
= 0;
399 if(pkt
->pts
!= AV_NOPTS_VALUE
) {
400 wav
->minpts
= FFMIN(wav
->minpts
, pkt
->pts
);
401 wav
->maxpts
= FFMAX(wav
->maxpts
, pkt
->pts
);
402 wav
->last_duration
= pkt
->duration
;
404 av_log(s
, AV_LOG_ERROR
, "wav_write_packet: NOPTS\n");
408 static int wav_write_trailer(AVFormatContext
*s
)
410 AVIOContext
*pb
= s
->pb
;
411 WAVMuxContext
*wav
= s
->priv_data
;
412 int64_t file_size
, data_size
;
413 int64_t number_of_samples
= 0;
417 if (s
->pb
->seekable
& AVIO_SEEKABLE_NORMAL
) {
418 if (wav
->write_peak
!= PEAK_ONLY
&& avio_tell(pb
) - wav
->data
< UINT32_MAX
) {
419 ff_end_tag(pb
, wav
->data
);
422 if (wav
->write_peak
&& wav
->peak_output
) {
423 ret
= peak_write_chunk(s
);
426 /* update file size */
427 file_size
= avio_tell(pb
);
428 data_size
= file_size
- wav
->data
;
429 if (wav
->rf64
== RF64_ALWAYS
|| (wav
->rf64
== RF64_AUTO
&& file_size
- 8 > UINT32_MAX
)) {
431 } else if (file_size
- 8 <= UINT32_MAX
) {
432 avio_seek(pb
, 4, SEEK_SET
);
433 avio_wl32(pb
, (uint32_t)(file_size
- 8));
434 avio_seek(pb
, file_size
, SEEK_SET
);
436 av_log(s
, AV_LOG_ERROR
,
437 "Filesize %"PRId64
" invalid for wav, output file will be broken\n",
440 number_of_samples
= av_rescale_q(wav
->maxpts
- wav
->minpts
+ wav
->last_duration
,
441 s
->streams
[0]->time_base
,
442 av_make_q(1, s
->streams
[0]->codecpar
->sample_rate
));
444 if(s
->streams
[0]->codecpar
->codec_tag
!= 0x01) {
445 /* Update num_samps in fact chunk */
446 avio_seek(pb
, wav
->fact_pos
, SEEK_SET
);
447 if (rf64
|| (wav
->rf64
== RF64_AUTO
&& number_of_samples
> UINT32_MAX
)) {
451 avio_wl32(pb
, number_of_samples
);
452 avio_seek(pb
, file_size
, SEEK_SET
);
457 /* overwrite RIFF with RF64 */
458 avio_seek(pb
, 0, SEEK_SET
);
459 ffio_wfourcc(pb
, "RF64");
462 /* write ds64 chunk (overwrite JUNK if rf64 == RF64_AUTO) */
463 avio_seek(pb
, wav
->ds64
- 8, SEEK_SET
);
464 ffio_wfourcc(pb
, "ds64");
465 avio_wl32(pb
, 28); /* ds64 chunk size */
466 avio_wl64(pb
, file_size
- 8); /* RF64 chunk size */
467 avio_wl64(pb
, data_size
); /* data chunk size */
468 avio_wl64(pb
, number_of_samples
); /* fact chunk number of samples */
469 avio_wl32(pb
, 0); /* number of table entries for non-'data' chunks */
471 /* write -1 in data chunk size */
472 avio_seek(pb
, wav
->data
- 4, SEEK_SET
);
475 avio_seek(pb
, file_size
, SEEK_SET
);
482 #define OFFSET(x) offsetof(WAVMuxContext, x)
483 #define ENC AV_OPT_FLAG_ENCODING_PARAM
484 static const AVOption options
[] = {
485 { "write_bext", "Write BEXT chunk.", OFFSET(write_bext
), AV_OPT_TYPE_BOOL
, { .i64
= 0 }, 0, 1, ENC
},
486 { "write_peak", "Write Peak Envelope chunk.", OFFSET(write_peak
), AV_OPT_TYPE_INT
, { .i64
= 0 }, 0, 2, ENC
, .unit
= "peak" },
487 { "off", "Do not write peak chunk.", 0, AV_OPT_TYPE_CONST
, { .i64
= PEAK_OFF
}, 0, 0, ENC
, .unit
= "peak" },
488 { "on", "Append peak chunk after wav data.", 0, AV_OPT_TYPE_CONST
, { .i64
= PEAK_ON
}, 0, 0, ENC
, .unit
= "peak" },
489 { "only", "Write only peak chunk, omit wav data.", 0, AV_OPT_TYPE_CONST
, { .i64
= PEAK_ONLY
}, 0, 0, ENC
, .unit
= "peak" },
490 { "rf64", "Use RF64 header rather than RIFF for large files.", OFFSET(rf64
), AV_OPT_TYPE_INT
, { .i64
= RF64_NEVER
},-1, 1, ENC
, .unit
= "rf64" },
491 { "auto", "Write RF64 header if file grows large enough.", 0, AV_OPT_TYPE_CONST
, { .i64
= RF64_AUTO
}, 0, 0, ENC
, .unit
= "rf64" },
492 { "always", "Always write RF64 header regardless of file size.", 0, AV_OPT_TYPE_CONST
, { .i64
= RF64_ALWAYS
}, 0, 0, ENC
, .unit
= "rf64" },
493 { "never", "Never write RF64 header regardless of file size.", 0, AV_OPT_TYPE_CONST
, { .i64
= RF64_NEVER
}, 0, 0, ENC
, .unit
= "rf64" },
494 { "peak_block_size", "Number of audio samples used to generate each peak frame.", OFFSET(peak_block_size
), AV_OPT_TYPE_INT
, { .i64
= 256 }, 0, 65536, ENC
},
495 { "peak_format", "The format of the peak envelope data (1: uint8, 2: uint16).", OFFSET(peak_format
), AV_OPT_TYPE_INT
, { .i64
= PEAK_FORMAT_UINT16
}, PEAK_FORMAT_UINT8
, PEAK_FORMAT_UINT16
, ENC
},
496 { "peak_ppv", "Number of peak points per peak value (1 or 2).", OFFSET(peak_ppv
), AV_OPT_TYPE_INT
, { .i64
= 2 }, 1, 2, ENC
},
500 static const AVClass wav_muxer_class
= {
501 .class_name
= "WAV muxer",
502 .item_name
= av_default_item_name
,
504 .version
= LIBAVUTIL_VERSION_INT
,
507 const FFOutputFormat ff_wav_muxer
= {
509 .p
.long_name
= NULL_IF_CONFIG_SMALL("WAV / WAVE (Waveform Audio)"),
510 .p
.mime_type
= "audio/x-wav",
511 .p
.extensions
= "wav",
512 .priv_data_size
= sizeof(WAVMuxContext
),
513 .p
.audio_codec
= AV_CODEC_ID_PCM_S16LE
,
514 .p
.video_codec
= AV_CODEC_ID_NONE
,
515 .p
.subtitle_codec
= AV_CODEC_ID_NONE
,
516 .write_header
= wav_write_header
,
517 .write_packet
= wav_write_packet
,
518 .write_trailer
= wav_write_trailer
,
519 .deinit
= wav_deinit
,
520 .p
.flags
= AVFMT_TS_NONSTRICT
,
521 .p
.codec_tag
= ff_wav_codec_tags_list
,
522 .p
.priv_class
= &wav_muxer_class
,
523 .flags_internal
= FF_OFMT_FLAG_MAX_ONE_OF_EACH
,
525 #endif /* CONFIG_WAV_MUXER */
530 static void start_guid(AVIOContext
*pb
, const uint8_t *guid
, int64_t *pos
)
532 *pos
= avio_tell(pb
);
534 avio_write(pb
, guid
, 16);
535 avio_wl64(pb
, INT64_MAX
);
538 static void end_guid(AVIOContext
*pb
, int64_t start
)
540 int64_t end
, pos
= avio_tell(pb
);
542 end
= FFALIGN(pos
, 8);
543 ffio_fill(pb
, 0, end
- pos
);
544 avio_seek(pb
, start
+ 16, SEEK_SET
);
545 avio_wl64(pb
, end
- start
);
546 avio_seek(pb
, end
, SEEK_SET
);
549 static int w64_write_header(AVFormatContext
*s
)
551 WAVMuxContext
*wav
= s
->priv_data
;
552 AVIOContext
*pb
= s
->pb
;
556 avio_write(pb
, ff_w64_guid_riff
, sizeof(ff_w64_guid_riff
));
558 avio_write(pb
, ff_w64_guid_wave
, sizeof(ff_w64_guid_wave
));
559 start_guid(pb
, ff_w64_guid_fmt
, &start
);
560 if ((ret
= ff_put_wav_header(s
, pb
, s
->streams
[0]->codecpar
, 0)) < 0) {
561 av_log(s
, AV_LOG_ERROR
, "Codec %s not supported\n",
562 avcodec_get_name(s
->streams
[0]->codecpar
->codec_id
));
567 if (s
->streams
[0]->codecpar
->codec_tag
!= 0x01 /* hence for all other than PCM */
568 && (s
->pb
->seekable
& AVIO_SEEKABLE_NORMAL
)) {
569 start_guid(pb
, ff_w64_guid_fact
, &wav
->fact_pos
);
571 end_guid(pb
, wav
->fact_pos
);
574 start_guid(pb
, ff_w64_guid_data
, &wav
->data
);
579 static int w64_write_trailer(AVFormatContext
*s
)
581 AVIOContext
*pb
= s
->pb
;
582 WAVMuxContext
*wav
= s
->priv_data
;
585 if (pb
->seekable
& AVIO_SEEKABLE_NORMAL
) {
586 end_guid(pb
, wav
->data
);
588 file_size
= avio_tell(pb
);
589 avio_seek(pb
, 16, SEEK_SET
);
590 avio_wl64(pb
, file_size
);
592 if (s
->streams
[0]->codecpar
->codec_tag
!= 0x01) {
593 int64_t number_of_samples
;
595 number_of_samples
= av_rescale(wav
->maxpts
- wav
->minpts
+ wav
->last_duration
,
596 s
->streams
[0]->codecpar
->sample_rate
* (int64_t)s
->streams
[0]->time_base
.num
,
597 s
->streams
[0]->time_base
.den
);
598 avio_seek(pb
, wav
->fact_pos
+ 24, SEEK_SET
);
599 avio_wl64(pb
, number_of_samples
);
602 avio_seek(pb
, file_size
, SEEK_SET
);
608 const FFOutputFormat ff_w64_muxer
= {
610 .p
.long_name
= NULL_IF_CONFIG_SMALL("Sony Wave64"),
611 .p
.extensions
= "w64",
612 .priv_data_size
= sizeof(WAVMuxContext
),
613 .p
.audio_codec
= AV_CODEC_ID_PCM_S16LE
,
614 .p
.video_codec
= AV_CODEC_ID_NONE
,
615 .p
.subtitle_codec
= AV_CODEC_ID_NONE
,
616 .write_header
= w64_write_header
,
617 .write_packet
= wav_write_packet
,
618 .write_trailer
= w64_write_trailer
,
619 .p
.flags
= AVFMT_TS_NONSTRICT
,
620 .p
.codec_tag
= ff_wav_codec_tags_list
,
621 .flags_internal
= FF_OFMT_FLAG_MAX_ONE_OF_EACH
,
623 #endif /* CONFIG_W64_MUXER */