45 #define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32-bit audio
62 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
63 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
64 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
65 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
66 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
67 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
68 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
69 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
70 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
71 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
72 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
73 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
79 if (sample_rate == 32000)
return 1280;
80 else if (sample_rate == 44100)
return 1764;
103 timecode |= 1<<23 | 1<<15 | 1<<7 | 1<<6;
108 channel = va_arg(ap,
int);
156 ((tc.tm_mday / 10) << 4) |
159 ((tc.tm_mon / 10) << 4) |
161 buf[4] = (((tc.tm_year % 100) / 10) << 4) |
172 ((tc.tm_sec / 10) << 4) |
175 ((tc.tm_min / 10) << 4) |
178 ((tc.tm_hour / 10) << 4) |
182 buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
189 int i, j, d, of,
size;
194 for (j = 0; j < 9; j++) {
196 for (d = 8; d < 80; d+=2) {
204 frame_ptr += 16 * 80;
214 for (buf = frame; buf < frame + c->
sys->
frame_size; buf += 150 * 80) {
216 for (j = 80; j < 80 * 3; j += 80) {
217 for (k = 6; k < 6 * 8; k += 8)
229 for (j = 80*3 + 3; j < 80*6; j += 80) {
254 av_log(s,
AV_LOG_ERROR,
"Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->
frames);
265 for (i = 0; i < c->
n_ast && st != c->
ast[i]; i++);
269 av_log(s,
AV_LOG_ERROR,
"Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->
frames);
286 for (i=0; i < c->
n_ast; i++) {
320 if (vst)
return NULL;
335 for (i=0; i<c->
n_ast; i++) {
369 for (i=0; i < c->
n_ast; i++) {
388 for (i=0; i < c->
n_ast; i++)
400 "Make sure that you supply exactly two streams:\n"
401 " video: 25fps or 29.97fps, audio: 2ch/48|44|32kHz/PCM\n"
402 " (50Mbps allows an optional second audio stream)\n");
ptrdiff_t const GLvoid * data
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int audio_samples_dist[5]
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx)
Parse timecode representation (hh:mm:ss[:;.
AVFifoBuffer * audio_data[2]
AVStream ** streams
A list of all streams in the file.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
enum AVPixelFormat pix_fmt
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
const uint8_t(* audio_shuffle)[9]
int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx)
Init a timecode struct with the passed parameters.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static uint8_t * av_fifo_peek2(const AVFifoBuffer *f, int offs)
Return a pointer to the data stored in a FIFO buffer at a certain offset.
AVDictionary * metadata
Metadata that applies to the whole file.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
simple assert() macros that are a bit more flexible than ISO C assert().
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
struct tm * ff_brktimegm(time_t secs, struct tm *tm)
static int write_trailer(AVFormatContext *s1)
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
int av_fifo_size(const AVFifoBuffer *f)
Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...
AVIOContext * pb
I/O context.
#define DV_MAX_FRAME_SIZE
largest possible DV frame, in bytes (1080i50)
a very simple circular buffer FIFO implementation
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost)
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
AVFifoBuffer * av_fifo_alloc_array(size_t nmemb, size_t size)
Initialize an AVFifoBuffer.
uint8_t frame_buf[DV_MAX_FRAME_SIZE]
int sample_rate
Audio only.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
const AVDVProfile * av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate)
Get a DV profile for the provided stream parameters.
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
void av_fifo_freep(AVFifoBuffer **f)
Free an AVFifoBuffer and reset pointer to NULL.
AVCodecParameters * codecpar
static int64_t fsize(FILE *f)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
void av_fifo_drain(AVFifoBuffer *f, int size)
Discard data from the FIFO.
This structure stores compressed data.
uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum)
Convert frame number to SMPTE 12M binary representation.