44 #define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32-bit audio
61 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
62 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
63 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
64 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
65 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
66 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
67 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
68 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
69 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
70 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
71 { 0xff, 0xff, 0xff, 0x50, 0x51, 0x52, 0x53, 0xff, 0xff },
72 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
78 if (sample_rate == 32000)
return 1280;
79 else if (sample_rate == 44100)
return 1764;
102 timecode |= 1<<23 | 1<<15 | 1<<7 | 1<<6;
107 channel = va_arg(ap,
int);
155 ((tc.tm_mday / 10) << 4) |
158 ((tc.tm_mon / 10) << 4) |
160 buf[4] = (((tc.tm_year % 100) / 10) << 4) |
171 ((tc.tm_sec / 10) << 4) |
174 ((tc.tm_min / 10) << 4) |
177 ((tc.tm_hour / 10) << 4) |
181 buf[1] = buf[2] = buf[3] = buf[4] = 0xff;
188 int i, j, d, of,
size;
193 for (j = 0; j < 9; j++) {
195 for (d = 8; d < 80; d+=2) {
203 frame_ptr += 16 * 80;
213 for (buf = frame; buf < frame + c->
sys->
frame_size; buf += 150 * 80) {
215 for (j = 80; j < 80 * 3; j += 80) {
216 for (k = 6; k < 6 * 8; k += 8)
228 for (j = 80*3 + 3; j < 80*6; j += 80) {
253 av_log(s,
AV_LOG_ERROR,
"Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->
frames);
264 for (i = 0; i < c->
n_ast && st != c->
ast[i]; i++);
268 av_log(s,
AV_LOG_ERROR,
"Can't process DV frame #%d. Insufficient video data or severe sync problem.\n", c->
frames);
285 for (i=0; i < c->
n_ast; i++) {
319 if (vst)
return NULL;
334 for (i=0; i<c->
n_ast; i++) {
368 for (i=0; i < c->
n_ast; i++) {
387 for (i=0; i < c->
n_ast; i++)
399 "Make sure that you supply exactly two streams:\n"
400 " video: 25fps or 29.97fps, audio: 2ch/48|44|32kHz/PCM\n"
401 " (50Mbps allows an optional second audio stream)\n");
ptrdiff_t const GLvoid * data
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.
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.
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)
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
Describe the class of an AVClass context structure.
rational number numerator/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.
static int write_packet(AVFormatContext *s1, AVPacket *pkt)
uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum)
Convert frame number to SMPTE 12M binary representation.