annotate mencoder.c @ 2531:cf6a236b2d00

very alpha code - needs Makefile modifications to compile
author arpi
date Mon, 29 Oct 2001 01:11:18 +0000
parents
children 13608ff3d1e6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2531
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
1
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
2 #define VCODEC_DIVX4 1
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
3
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
4 #include <stdio.h>
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
5 #include <stdlib.h>
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
6 #include <string.h>
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
7 #include <signal.h>
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
8
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
9 #include "mp_msg.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
10 #include "help_mp.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
11
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
12 #include "codec-cfg.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
13
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
14 #include "stream.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
15 #include "demuxer.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
16 #include "parse_es.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
17 #include "stheader.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
18
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
19 #include "aviwrite.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
20
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
21 #include "libvo/video_out.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
22
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
23 #include <encore2.h>
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
24
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
25 char *get_path(char *filename){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
26 char *homedir;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
27 char *buff;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
28 static char *config_dir = "/.mplayer";
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
29 int len;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
30
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
31 if ((homedir = getenv("HOME")) == NULL)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
32 return NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
33 len = strlen(homedir) + strlen(config_dir) + 1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
34 if (filename == NULL) {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
35 if ((buff = (char *) malloc(len)) == NULL)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
36 return NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
37 sprintf(buff, "%s%s", homedir, config_dir);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
38 } else {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
39 len += strlen(filename) + 1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
40 if ((buff = (char *) malloc(len)) == NULL)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
41 return NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
42 sprintf(buff, "%s%s/%s", homedir, config_dir, filename);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
43 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
44 return buff;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
45 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
46
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
47 #define ABS(x) (((x)>=0)?(x):(-(x)))
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
48
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
49 //--------------------------
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
50
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
51 // cache2:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
52 #ifdef USE_STREAM_CACHE
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
53 extern int cache_fill_status;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
54 #else
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
55 #define cache_fill_status 0
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
56 #endif
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
57
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
58 // AVI demuxer params:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
59 static float c_total=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
60 int delay_corrected=1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
61 extern int index_mode; // -1=untouched 0=don't use index 1=use (geneate) index
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
62 extern int force_ni;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
63 extern int pts_from_bps;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
64
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
65 char *audio_codec=NULL; // override audio codec
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
66 char *video_codec=NULL; // override video codec
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
67 int audio_family=-1; // override audio codec family
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
68 int video_family=-1; // override video codec family
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
69
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
70 // audio stream skip/resync functions requires only for seeking.
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
71 // (they should be implemented in the audio codec layer)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
72 //void skip_audio_frame(sh_audio_t *sh_audio){}
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
73 //void resync_audio_stream(sh_audio_t *sh_audio){}
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
74
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
75 int verbose=5; // must be global!
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
76
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
77 double video_time_usage=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
78 double vout_time_usage=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
79 static double audio_time_usage=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
80 static int total_time_usage_start=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
81 static int benchmark=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
82
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
83 int divx_quality=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
84 int force_fps=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
85
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
86 #include "libmpeg2/mpeg2.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
87 #include "libmpeg2/mpeg2_internal.h"
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
88
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
89 extern picture_t *picture; // exported from libmpeg2/decode.c
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
90
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
91 int frameratecode2framerate[16] = {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
92 0,
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
93 // Official mpeg1/2 framerates:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
94 24000*10000/1001, 24*10000,25*10000, 30000*10000/1001, 30*10000,50*10000,60000*10000/1001, 60*10000,
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
95 // libmpeg3's "Unofficial economy rates":
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
96 1*10000,5*10000,10*10000,12*10000,15*10000,0,0
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
97 };
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
98
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
99 static unsigned char* vo_image=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
100 static unsigned char* vo_image_ptr=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
101 static int vo_w,vo_h;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
102
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
103 static uint32_t draw_slice(uint8_t *src[], int stride[], int w,int h, int x0,int y0){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
104 int y;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
105 // printf("draw_slice %dx%d %d;%d\n",w,h,x,y);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
106
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
107 // copy Y:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
108 for(y=0;y<h;y++){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
109 unsigned char* s=src[0]+stride[0]*(y0+y)+x0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
110 unsigned char* d=vo_image+vo_w*(y0+y)+x0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
111 memcpy(d,s,w);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
112 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
113 x0>>=1;y0>>=1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
114 w>>=1;h>>=1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
115 // copy U:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
116 for(y=0;y<h;y++){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
117 unsigned char* s=src[1]+stride[1]*(y0+y)+x0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
118 unsigned char* d=vo_image+vo_w*vo_h+(vo_w>>1)*(y0+y)+x0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
119 memcpy(d,s,w);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
120 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
121 // copy V:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
122 for(y=0;y<h;y++){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
123 unsigned char* s=src[1]+stride[1]*(y0+y)+x0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
124 unsigned char* d=vo_image+vo_w*vo_h+vo_w*vo_h/4+(vo_w>>1)*(y0+y)+x0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
125 memcpy(d,s,w);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
126 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
127
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
128 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
129
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
130 static uint32_t draw_frame(uint8_t *src[]){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
131 // printf("This function shouldn't be called - report bug!\n");
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
132 // later: add YUY2->YV12 conversion here!
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
133 vo_image_ptr=src[0];
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
134 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
135
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
136 vo_functions_t video_out;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
137
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
138 //---------------
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
139
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
140 extern stream_t* open_stream(char* filename,int vcd_track,int* file_format);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
141
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
142 extern int video_read_properties(sh_video_t *sh_video);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
143 extern int init_video(sh_video_t *sh_video);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
144 extern int decode_video(vo_functions_t *video_out,sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
145
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
146 static int eof=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
147
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
148 static void exit_sighandler(int x){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
149 eof=1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
150 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
151
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
152 int main(int argc,char* argv[]){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
153
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
154 stream_t* stream=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
155 demuxer_t* demuxer=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
156 demux_stream_t *d_audio=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
157 demux_stream_t *d_video=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
158 demux_stream_t *d_dvdsub=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
159 sh_audio_t *sh_audio=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
160 sh_video_t *sh_video=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
161 int file_format=DEMUXER_TYPE_UNKNOWN;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
162 int i;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
163 unsigned int out_fmt;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
164
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
165 aviwrite_t* muxer=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
166 aviwrite_stream_t* mux_a=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
167 aviwrite_stream_t* mux_v=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
168 FILE* muxer_f=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
169
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
170 ENC_PARAM enc_param;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
171 ENC_FRAME enc_frame;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
172 ENC_RESULT enc_result;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
173 void* enc_handle=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
174
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
175 //int out_buffer_size=0x200000;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
176 //unsigned char* out_buffer=malloc(out_buffer_size);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
177
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
178 mp_msg_init(verbose+MSGL_STATUS);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
179
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
180 // check codec.conf
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
181 if(!parse_codec_cfg("etc/codecs.conf")){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
182 mp_msg(MSGT_CPLAYER,MSGL_HINT,MSGTR_CopyCodecsConf);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
183 exit(0); // From unknown reason a hangup occurs here :((((((
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
184 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
185
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
186 if(argc>1)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
187 stream=open_stream(argv[1],0,&file_format);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
188 else
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
189 stream=open_stream("/3d/divx/405divx_sm_v2[1].avi",0,&file_format);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
190 // stream=open_stream("/dev/cdrom",2,&file_format); // VCD track 2
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
191
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
192 if(!stream){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
193 printf("Cannot open file/device\n");
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
194 exit(1);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
195 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
196
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
197 printf("success: format: %d data: 0x%X - 0x%X\n",file_format, (int)(stream->start_pos),(int)(stream->end_pos));
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
198
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
199 stream_enable_cache(stream,2048*1024);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
200
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
201 demuxer=demux_open(stream,file_format,-1,-1,-1);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
202 if(!demuxer){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
203 printf("Cannot open demuxer\n");
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
204 exit(1);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
205 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
206
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
207 d_audio=demuxer->audio;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
208 d_video=demuxer->video;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
209 d_dvdsub=demuxer->sub;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
210 sh_audio=d_audio->sh;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
211 sh_video=d_video->sh;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
212
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
213 if(!video_read_properties(sh_video)){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
214 printf("Couldn't read video properties\n");
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
215 exit(1);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
216 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
217
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
218 mp_msg(MSGT_CPLAYER,MSGL_INFO,"[V] filefmt:%d fourcc:0x%X size:%dx%d fps:%5.2f ftime:=%6.4f\n",
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
219 demuxer->file_format,sh_video->format, sh_video->disp_w,sh_video->disp_h,
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
220 sh_video->fps,sh_video->frametime
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
221 );
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
222
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
223
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
224 sh_video->codec=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
225 if(video_family!=-1) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_TryForceVideoFmt,video_family);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
226 while(1){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
227 sh_video->codec=find_codec(sh_video->format,
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
228 sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,sh_video->codec,0);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
229 if(!sh_video->codec){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
230 if(video_family!=-1) {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
231 sh_video->codec=NULL; /* re-search */
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
232 mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_CantFindVfmtFallback);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
233 video_family=-1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
234 continue;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
235 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
236 mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantFindVideoCodec,sh_video->format);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
237 mp_msg(MSGT_CPLAYER,MSGL_HINT, MSGTR_TryUpgradeCodecsConfOrRTFM,get_path("codecs.conf"));
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
238 exit(1);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
239 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
240 if(video_codec && strcmp(sh_video->codec->name,video_codec)) continue;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
241 else if(video_family!=-1 && sh_video->codec->driver!=video_family) continue;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
242 break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
243 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
244
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
245 mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s video codec: [%s] drv:%d (%s)\n",video_codec?"Forcing":"Detected",sh_video->codec->name,sh_video->codec->driver,sh_video->codec->info);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
246
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
247 for(i=0;i<CODECS_MAX_OUTFMT;i++){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
248 out_fmt=sh_video->codec->outfmt[i];
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
249 if(out_fmt==0xFFFFFFFF) continue;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
250 if(out_fmt==IMGFMT_YV12) break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
251 if(out_fmt==IMGFMT_I420) break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
252 if(out_fmt==IMGFMT_IYUV) break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
253 if(out_fmt==IMGFMT_YUY2) break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
254 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
255 if(i>=CODECS_MAX_OUTFMT){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
256 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_VOincompCodec);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
257 exit(1); // exit_player(MSGTR_Exit_error);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
258 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
259 sh_video->outfmtidx=i;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
260
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
261 if(out_fmt==IMGFMT_YV12 || out_fmt==IMGFMT_I420 || out_fmt==IMGFMT_IYUV){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
262 vo_w=sh_video->disp_w;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
263 vo_h=sh_video->disp_h;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
264 vo_image=malloc(vo_w*vo_h*3/2);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
265 vo_image_ptr=vo_image;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
266 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
267
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
268 if(!init_video(sh_video)){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
269 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CouldntInitVideoCodec);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
270 exit(1);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
271 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
272
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
273 // set up video encoder:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
274 video_out.draw_slice=draw_slice;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
275 video_out.draw_frame=draw_frame;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
276
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
277 // set up output file:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
278 muxer_f=fopen("test.avi","wb");
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
279 muxer=aviwrite_new_muxer();
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
280 mux_v=aviwrite_new_stream(muxer,AVIWRITE_TYPE_VIDEO);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
281
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
282 mux_v->buffer_size=0x200000;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
283 mux_v->buffer=malloc(mux_v->buffer_size);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
284
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
285 mux_v->source=sh_video;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
286
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
287 mux_v->h.dwSampleSize=0; // VBR
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
288 mux_v->h.dwScale=10000;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
289 mux_v->h.dwRate=mux_v->h.dwScale*sh_video->fps;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
290
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
291 switch(mux_v->codec){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
292 case 0:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
293 mux_v->bih=sh_video->bih;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
294 break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
295 case VCODEC_DIVX4:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
296 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
297 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
298 mux_v->bih->biWidth=sh_video->disp_w;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
299 mux_v->bih->biHeight=sh_video->disp_h;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
300 mux_v->bih->biPlanes=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
301 mux_v->bih->biBitCount=24;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
302 mux_v->bih->biCompression=mmioFOURCC('d','i','v','x');
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
303 mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
304 break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
305 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
306
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
307 aviwrite_write_header(muxer,muxer_f);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
308
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
309 switch(mux_v->codec){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
310 case 0:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
311 break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
312 case VCODEC_DIVX4:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
313 // init divx4linux:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
314 enc_param.x_dim=sh_video->disp_w;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
315 enc_param.y_dim=sh_video->disp_h;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
316 enc_param.framerate=sh_video->fps;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
317 enc_param.bitrate=800;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
318 enc_param.rc_period=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
319 enc_param.rc_reaction_period=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
320 enc_param.rc_reaction_ratio=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
321 enc_param.max_quantizer=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
322 enc_param.min_quantizer=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
323 enc_param.max_key_interval=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
324 enc_param.use_bidirect=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
325 enc_param.deinterlace=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
326 enc_param.quality=5; // the quality of compression ( 1 - fastest, 5 - best )
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
327 enc_param.obmc=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
328 enc_param.handle=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
329 encore(NULL,ENC_OPT_INIT,&enc_param,NULL);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
330 enc_handle=enc_param.handle;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
331 break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
332 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
333
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
334
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
335 signal(SIGINT,exit_sighandler); // Interrupt from keyboard
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
336 signal(SIGQUIT,exit_sighandler); // Quit from keyboard
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
337 signal(SIGTERM,exit_sighandler); // kill
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
338
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
339
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
340 while(!eof){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
341
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
342 float frame_time=1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
343 float pts1=d_video->pts;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
344 int blit_frame=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
345 float a_pts=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
346 float v_pts=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
347
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
348 // current_module="decode_video";
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
349
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
350 //-------------------- Decode a frame: -----------------------
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
351
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
352 if(demuxer->file_format==DEMUXER_TYPE_MPEG_ES || demuxer->file_format==DEMUXER_TYPE_MPEG_PS){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
353 int in_frame=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
354 float newfps;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
355 //videobuf_len=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
356 while(videobuf_len<VIDEOBUFFER_SIZE-MAX_VIDEO_PACKET_SIZE){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
357 int i=sync_video_packet(d_video);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
358 void* buffer=&videobuffer[videobuf_len+4];
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
359 if(in_frame){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
360 if(i<0x101 || i>=0x1B0){ // not slice code -> end of frame
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
361 #if 1
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
362 // send END OF FRAME code:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
363 videobuffer[videobuf_len+0]=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
364 videobuffer[videobuf_len+1]=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
365 videobuffer[videobuf_len+2]=1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
366 videobuffer[videobuf_len+3]=0xFF;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
367 videobuf_len+=4;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
368 #endif
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
369 if(!i) eof=2; // EOF
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
370 break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
371 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
372 } else {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
373 //if(i==0x100) in_frame=1; // picture startcode
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
374 if(i>=0x101 && i<0x1B0) in_frame=1; // picture startcode
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
375 else if(!i){ eof=3; break;} // EOF
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
376 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
377 if(!read_video_packet(d_video)){ eof=4; break;} // EOF
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
378 //printf("read packet 0x%X, len=%d\n",i,videobuf_len);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
379 if(sh_video->codec->driver!=VFM_MPEG){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
380 // if not libmpeg2:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
381 switch(i){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
382 case 0x1B3: header_process_sequence_header (picture, buffer);break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
383 case 0x1B5: header_process_extension (picture, buffer);break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
384 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
385 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
386 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
387
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
388 //if(videobuf_len>max_framesize) max_framesize=videobuf_len; // debug
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
389 //printf("--- SEND %d bytes\n",videobuf_len);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
390
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
391 blit_frame=decode_video(&video_out,sh_video,videobuffer,videobuf_len,0);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
392
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
393 // get mpeg fps:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
394 newfps=frameratecode2framerate[picture->frame_rate_code]*0.0001f;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
395 if(ABS(sh_video->fps-newfps)>0.01f) {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
396 mp_msg(MSGT_CPLAYER,MSGL_WARN,"Warning! FPS changed %5.3f -> %5.3f (%f) [%d] \n",sh_video->fps,newfps,sh_video->fps-newfps,picture->frame_rate_code);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
397 sh_video->fps=newfps;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
398 sh_video->frametime=10000.0f/(float)frameratecode2framerate[picture->frame_rate_code];
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
399 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
400
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
401 // fix mpeg2 frametime:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
402 frame_time=(picture->display_time)*0.01f;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
403 picture->display_time=100;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
404 videobuf_len=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
405
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
406 } else {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
407 // frame-based file formats: (AVI,ASF,MOV)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
408 unsigned char* start=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
409 int in_size=ds_get_packet(d_video,&start);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
410 if(in_size<0){ eof=5;break;}
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
411 //if(in_size>max_framesize) max_framesize=in_size;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
412 if(mux_v->codec){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
413 // convert
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
414 blit_frame=decode_video(&video_out,sh_video,start,in_size,0);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
415 } else {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
416 // copy
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
417 mux_v->buffer=start;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
418 aviwrite_write_chunk(muxer,mux_v,muxer_f,in_size,(sh_video->ds->flags&1)?0x10:0);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
419 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
420 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
421 if(eof) break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
422
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
423 //------------------------ frame decoded. --------------------
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
424
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
425 // Increase video timers:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
426 sh_video->num_frames+=frame_time;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
427 ++sh_video->num_frames_decoded;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
428 frame_time*=sh_video->frametime;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
429 if(demuxer->file_format==DEMUXER_TYPE_ASF && !force_fps){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
430 // .ASF files has no fixed FPS - just frame durations!
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
431 float d=d_video->pts-pts1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
432 if(d>=0 && d<5) frame_time=d;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
433 if(d>0){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
434 if(verbose)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
435 if((int)sh_video->fps==1000)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
436 mp_msg(MSGT_CPLAYER,MSGL_STATUS,"\rASF framerate: %d fps \n",(int)(1.0f/d));
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
437 sh_video->frametime=d; // 1ms
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
438 sh_video->fps=1.0f/d;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
439 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
440 } else
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
441 if(demuxer->file_format==DEMUXER_TYPE_MOV && !force_fps){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
442 // .MOV files has no fixed FPS - just frame durations!
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
443 float d=d_video->pts-pts1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
444 frame_time=d;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
445 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
446 sh_video->timer+=frame_time;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
447
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
448 if(demuxer->file_format==DEMUXER_TYPE_MPEG_PS) d_video->pts+=frame_time;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
449
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
450 if(pts_from_bps){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
451 unsigned int samples=(sh_audio->audio.dwSampleSize)?
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
452 ((ds_tell(d_audio)-sh_audio->a_in_buffer_len)/sh_audio->audio.dwSampleSize) :
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
453 (d_audio->pack_no); // <- used for VBR audio
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
454 a_pts=samples*(float)sh_audio->audio.dwScale/(float)sh_audio->audio.dwRate;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
455 delay_corrected=1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
456 } else {
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
457 // PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
458 a_pts=d_audio->pts;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
459 if(!delay_corrected) if(a_pts) delay_corrected=1;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
460 //printf("*** %5.3f ***\n",a_pts);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
461 a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
462 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
463 v_pts=d_video->pts;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
464
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
465 mp_msg(MSGT_AVSYNC,MSGL_STATUS,"A:%6.1f V:%6.1f A-V:%7.3f ct:%7.3f %3d/%3d %2d%% %2d%% %4.1f%% %d%%\r",
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
466 a_pts,v_pts,a_pts-v_pts,c_total,
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
467 (int)sh_video->num_frames,(int)sh_video->num_frames_decoded,
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
468 (sh_video->timer>0.5)?(int)(100.0*video_time_usage/(double)sh_video->timer):0,
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
469 (sh_video->timer>0.5)?(int)(100.0*vout_time_usage/(double)sh_video->timer):0,
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
470 (sh_video->timer>0.5)?(100.0*audio_time_usage/(double)sh_video->timer):0
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
471 ,cache_fill_status
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
472 );
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
473 fflush(stdout);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
474
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
475 if(!blit_frame) continue;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
476
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
477 switch(mux_v->codec){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
478 case VCODEC_DIVX4:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
479 enc_frame.image=vo_image_ptr;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
480 enc_frame.bitstream=mux_v->buffer;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
481 enc_frame.length=mux_v->buffer_size;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
482 switch(out_fmt){
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
483 case IMGFMT_YV12: enc_frame.colorspace=ENC_CSP_YV12; break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
484 case IMGFMT_IYUV:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
485 case IMGFMT_I420: enc_frame.colorspace=ENC_CSP_I420; break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
486 case IMGFMT_YUY2: enc_frame.colorspace=ENC_CSP_YUY2; break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
487 case IMGFMT_UYVY: enc_frame.colorspace=ENC_CSP_UYVY; break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
488 case IMGFMT_RGB24:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
489 case IMGFMT_BGR24:
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
490 enc_frame.colorspace=ENC_CSP_RGB24; break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
491 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
492 enc_frame.quant=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
493 enc_frame.intra=0;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
494 enc_frame.mvs=NULL;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
495
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
496 // printf("encoding...\n");
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
497 encore(enc_handle,ENC_OPT_ENCODE,&enc_frame,&enc_result);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
498
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
499 // printf(" len=%d key:%d qualt:%d \n",enc_frame.length,enc_result.is_key_frame,enc_result.quantizer);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
500
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
501 aviwrite_write_chunk(muxer,mux_v,muxer_f,enc_frame.length,enc_result.is_key_frame?0x10:0);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
502 break;
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
503 }
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
504
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
505
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
506 } // while(!eof)
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
507
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
508 aviwrite_write_index(muxer,muxer_f);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
509 fseek(muxer_f,0,SEEK_SET);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
510 aviwrite_write_header(muxer,muxer_f); // update header
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
511 fclose(muxer_f);
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
512
cf6a236b2d00 very alpha code - needs Makefile modifications to compile
arpi
parents:
diff changeset
513 }