annotate libmpcodecs/vf_lavc.c @ 36021:bc1d68f48ca5

Make gtkSetDefaultToCList() static. It only has file scope. Additionally, rename it gtkSelectInCList().
author ib
date Sun, 31 Mar 2013 17:38:13 +0000
parents a3c178a46634
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30421
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
1 /*
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
2 * This file is part of MPlayer.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
3 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
5 * it under the terms of the GNU General Public License as published by
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
7 * (at your option) any later version.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
8 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
12 * GNU General Public License for more details.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
13 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
14 * You should have received a copy of the GNU General Public License along
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
17 */
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 29263
diff changeset
18
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
19 #include <stdio.h>
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
20 #include <stdlib.h>
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
21 #include <string.h>
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
22 #include <inttypes.h>
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
23
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 15843
diff changeset
24 #include "config.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 15843
diff changeset
25 #include "mp_msg.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 15843
diff changeset
26 #include "help_mp.h"
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
27
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
28 #include "img_format.h"
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
29 #include "mp_image.h"
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
30 #include "vf.h"
33871
30f5e5cd3676 Move code for setting up libav* logging callbacks from vd_ffmpeg to a
reimar
parents: 32537
diff changeset
31 #include "av_helpers.h"
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
32 #include "libavcodec/avcodec.h"
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
33
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
34
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
35 struct vf_priv_s {
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
36 unsigned char* outbuf;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
37 int outbuf_size;
7852
e4f87bbf682c - using avcodec_alloc_context()
arpi
parents: 7368
diff changeset
38 AVCodecContext* context;
8413
2670aec42989 AVVideoFrame -> AVFrame
michael
parents: 8340
diff changeset
39 AVFrame* pic;
7852
e4f87bbf682c - using avcodec_alloc_context()
arpi
parents: 7368
diff changeset
40 AVCodec* codec;
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
41 vo_mpegpes_t pes;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
42 };
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
43
7852
e4f87bbf682c - using avcodec_alloc_context()
arpi
parents: 7368
diff changeset
44 #define lavc_venc_context (*vf->priv->context)
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
45
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
46 //===========================================================================//
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
47
30642
a972c1a4a012 cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents: 30638
diff changeset
48 static int config(struct vf_instance *vf,
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
49 int width, int height, int d_width, int d_height,
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
50 unsigned int flags, unsigned int outfmt){
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
51 if(vf_next_query_format(vf,IMGFMT_MPEGPES)<=0) return 0;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
52
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
53 lavc_venc_context.width = width;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
54 lavc_venc_context.height = height;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26754
diff changeset
55
15843
77a5b8ef3314 restored framerate autodetection based on height
nicodvb
parents: 15349
diff changeset
56 if(!lavc_venc_context.time_base.num || !lavc_venc_context.time_base.den){
6019
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
57 // guess FPS:
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
58 switch(height){
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
59 case 240:
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
60 case 480:
15307
58bd9c33864c LIBAVCODEC_BUILD >= 4754
michael
parents: 11419
diff changeset
61 lavc_venc_context.time_base= (AVRational){1001,30000};
6019
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
62 break;
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
63 case 576:
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
64 case 288:
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
65 default:
15307
58bd9c33864c LIBAVCODEC_BUILD >= 4754
michael
parents: 11419
diff changeset
66 lavc_venc_context.time_base= (AVRational){1,25};
6019
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
67 break;
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
68 // lavc_venc_context.frame_rate=vo_fps*FRAME_RATE_BASE; // same as src
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
69 }
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
70 }
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
71
32537
8fa2f43cb760 Remove most of the NULL pointer check before free all over the code
cboesch
parents: 31959
diff changeset
72 free(vf->priv->outbuf);
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
73
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
74 vf->priv->outbuf_size=10000+width*height; // must be enough!
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
75 vf->priv->outbuf = malloc(vf->priv->outbuf_size);
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
76
34566
f3d53cd55376 Update deprecated avcodec_alloc_context()/avcodec_open() API calls
siretart
parents: 34457
diff changeset
77 if (avcodec_open2(&lavc_venc_context, vf->priv->codec, NULL) != 0) {
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
78 mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantOpenCodec);
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
79 return 0;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
80 }
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
81
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
82 return vf_next_config(vf,width,height,d_width,d_height,flags,IMGFMT_MPEGPES);
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
83 }
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
84
30642
a972c1a4a012 cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents: 30638
diff changeset
85 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
86 mp_image_t* dmpi;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
87 int out_size;
8413
2670aec42989 AVVideoFrame -> AVFrame
michael
parents: 8340
diff changeset
88 AVFrame *pic= vf->priv->pic;
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
89
8339
ff0bddb59e81 support for lavc build 4641
michael
parents: 7852
diff changeset
90 pic->data[0]=mpi->planes[0];
ff0bddb59e81 support for lavc build 4641
michael
parents: 7852
diff changeset
91 pic->data[1]=mpi->planes[1];
ff0bddb59e81 support for lavc build 4641
michael
parents: 7852
diff changeset
92 pic->data[2]=mpi->planes[2];
ff0bddb59e81 support for lavc build 4641
michael
parents: 7852
diff changeset
93 pic->linesize[0]=mpi->stride[0];
ff0bddb59e81 support for lavc build 4641
michael
parents: 7852
diff changeset
94 pic->linesize[1]=mpi->stride[1];
ff0bddb59e81 support for lavc build 4641
michael
parents: 7852
diff changeset
95 pic->linesize[2]=mpi->stride[2];
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
96
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26754
diff changeset
97 out_size = avcodec_encode_video(&lavc_venc_context,
8339
ff0bddb59e81 support for lavc build 4641
michael
parents: 7852
diff changeset
98 vf->priv->outbuf, vf->priv->outbuf_size, pic);
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
99
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7127
diff changeset
100 if(out_size<=0) return 1;
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
101
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
102 dmpi=vf_get_image(vf->next,IMGFMT_MPEGPES,
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
103 MP_IMGTYPE_EXPORT, 0,
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
104 mpi->w, mpi->h);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26754
diff changeset
105
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
106 vf->priv->pes.data=vf->priv->outbuf;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
107 vf->priv->pes.size=out_size;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
108 vf->priv->pes.id=0x1E0;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
109 vf->priv->pes.timestamp=-1; // dunno
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26754
diff changeset
110
7127
1e47c2e7aa8e mostly compiler warning fixes, some small bugfix
arpi
parents: 7004
diff changeset
111 dmpi->planes[0]=(unsigned char*)&vf->priv->pes;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26754
diff changeset
112
34457
220497708307 propagate the pts to vf_next_put_image(); fixes playback with -correct-pts when reencoding is necessary
nicodvb
parents: 33871
diff changeset
113 return vf_next_put_image(vf,dmpi, pts);
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
114 }
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
115
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
116 //===========================================================================//
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
117
30642
a972c1a4a012 cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents: 30638
diff changeset
118 static int query_format(struct vf_instance *vf, unsigned int fmt){
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
119 switch(fmt){
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
120 case IMGFMT_YV12:
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
121 case IMGFMT_I420:
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
122 case IMGFMT_IYUV:
26754
63630c09e237 cosmetics: Remove pointless parentheses from return calls.
diego
parents: 26069
diff changeset
123 return vf_next_query_format(vf, IMGFMT_MPEGPES) & (~(VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_ACCEPT_STRIDE));
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
124 }
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
125 return 0;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
126 }
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
127
30638
a7b908875c14 Rename open() vf initialization function to vf_open().
diego
parents: 30421
diff changeset
128 static int vf_open(vf_instance_t *vf, char *args){
6019
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
129 int p_quality=0;
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
130 float p_fps=0;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26754
diff changeset
131
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
132 vf->config=config;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
133 vf->put_image=put_image;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
134 vf->query_format=query_format;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
135 vf->priv=malloc(sizeof(struct vf_priv_s));
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
136 memset(vf->priv,0,sizeof(struct vf_priv_s));
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
137
31959
f957f330aa6d Introduce init_avcodec function to avoid duplicated FFmpeg initializations.
diego
parents: 30642
diff changeset
138 init_avcodec();
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
139
34691
65b8e2116c99 Remove pointless casts.
reimar
parents: 34566
diff changeset
140 vf->priv->codec = avcodec_find_encoder_by_name("mpeg1video");
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
141 if (!vf->priv->codec) {
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
142 mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_MissingLAVCcodec, "mpeg1video");
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
143 return 0;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
144 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26754
diff changeset
145
34566
f3d53cd55376 Update deprecated avcodec_alloc_context()/avcodec_open() API calls
siretart
parents: 34457
diff changeset
146 vf->priv->context=avcodec_alloc_context3(vf->priv->codec);
8413
2670aec42989 AVVideoFrame -> AVFrame
michael
parents: 8340
diff changeset
147 vf->priv->pic = avcodec_alloc_frame();
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
148
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
149 // TODO: parse args ->
6019
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
150 if(args) sscanf(args, "%d:%f", &p_quality, &p_fps);
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
151
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
152 if(p_quality<32){
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
153 // fixed qscale
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
154 lavc_venc_context.flags = CODEC_FLAG_QSCALE;
11257
837bca3ae69f constant qscale was broken due to libavcodec changes, fix taken from ve_lavc.c
ranma
parents: 11000
diff changeset
155 lavc_venc_context.global_quality =
837bca3ae69f constant qscale was broken due to libavcodec changes, fix taken from ve_lavc.c
ranma
parents: 11000
diff changeset
156 vf->priv->pic->quality = (int)(FF_QP2LAMBDA * ((p_quality<1) ? 1 : p_quality) + 0.5);
6019
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
157 } else {
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
158 // fixed bitrate (in kbits)
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
159 lavc_venc_context.bit_rate = 1000*p_quality;
5c3b0b165f3a FPS autodetection, accept args: quality:fps
arpi
parents: 5876
diff changeset
160 }
15307
58bd9c33864c LIBAVCODEC_BUILD >= 4754
michael
parents: 11419
diff changeset
161 lavc_venc_context.time_base.num = 1000*1001;
17906
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17523
diff changeset
162 lavc_venc_context.time_base.den = (p_fps<1.0) ? 1000*1001*25 : (p_fps * lavc_venc_context.time_base.num);
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
163 lavc_venc_context.gop_size = 0; // I-only
15349
d73a6d42a27f set pix_fmt
michael
parents: 15307
diff changeset
164 lavc_venc_context.pix_fmt= PIX_FMT_YUV420P;
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
165
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
166 return 1;
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
167 }
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
168
25221
00fff9a3b735 Make all vf_info_t structs const
reimar
parents: 23373
diff changeset
169 const vf_info_t vf_info_lavc = {
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
170 "realtime mpeg1 encoding with libavcodec",
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
171 "lavc",
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
172 "A'rpi",
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
173 "",
30638
a7b908875c14 Rename open() vf initialization function to vf_open().
diego
parents: 30421
diff changeset
174 vf_open,
9593
e9a2af584986 Add the new -vf option wich is the same as vop in reverse order.
albeu
parents: 9577
diff changeset
175 NULL
5873
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
176 };
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
177
74cbaabeaa33 realtime yv12->mpeg1 with libavcodec qscale=1
arpi
parents:
diff changeset
178 //===========================================================================//