Mercurial > mplayer.hg
annotate libmpdemux/aviprint.c @ 11623:ecaf7047b6e8
Patch from the author, Zoltan Hidvegi:
The filmdint filter does not handle NTSC "telecined" 15fps movies
where there is a frame break in the middle of every second NTSC frame,
it outputs only 15 frames for every 30 input frames, ignoring the io
option. You can notice this during encoding such a sequence you will
have lots of diplicate frames / skip frames messages. The patch below
fixes this.
author | rfelker |
---|---|
date | Thu, 11 Dec 2003 04:47:42 +0000 |
parents | 105077598ef3 |
children | 846ed866f86c |
rev | line source |
---|---|
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
1 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
2 #include <stdio.h> |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
3 #include <stdlib.h> |
1430 | 4 #include <unistd.h> |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
5 |
2555
66837325b929
config.h cleanup, few things added to steram/demuxer headers
arpi
parents:
2314
diff
changeset
|
6 #include "config.h" |
66837325b929
config.h cleanup, few things added to steram/demuxer headers
arpi
parents:
2314
diff
changeset
|
7 |
7471 | 8 // for avi_stream_id(): |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
9 #include "stream.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
10 #include "demuxer.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
11 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
12 #include "wine/mmreg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
13 #include "wine/avifmt.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
14 #include "wine/vfw.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
15 |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
16 //#include "codec-cfg.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
17 //#include "stheader.h" |
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
18 |
1456
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
19 void print_avih_flags(MainAVIHeader *h){ |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
20 printf("MainAVIHeader.dwFlags: (%ld)%s%s%s%s%s%s\n",h->dwFlags, |
1 | 21 (h->dwFlags&AVIF_HASINDEX)?" HAS_INDEX":"", |
22 (h->dwFlags&AVIF_MUSTUSEINDEX)?" MUST_USE_INDEX":"", | |
23 (h->dwFlags&AVIF_ISINTERLEAVED)?" IS_INTERLEAVED":"", | |
24 (h->dwFlags&AVIF_TRUSTCKTYPE)?" TRUST_CKTYPE":"", | |
25 (h->dwFlags&AVIF_WASCAPTUREFILE)?" WAS_CAPTUREFILE":"", | |
26 (h->dwFlags&AVIF_COPYRIGHTED)?" COPYRIGHTED":"" | |
27 ); | |
1456
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
28 } |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
29 |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
30 void print_avih(MainAVIHeader *h){ |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
31 printf("======= AVI Header =======\n"); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
32 printf("us/frame: %ld (fps=%5.3f)\n",h->dwMicroSecPerFrame,1000000.0f/(float)h->dwMicroSecPerFrame); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
33 printf("max bytes/sec: %ld\n",h->dwMaxBytesPerSec); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
34 printf("padding: %ld\n",h->dwPaddingGranularity); |
8c57a5a3c645
printfs cleanup - moved to higher -v level or moved to stderr
arpi
parents:
1430
diff
changeset
|
35 print_avih_flags(h); |
602 | 36 printf("frames total: %ld initial: %ld\n",h->dwTotalFrames,h->dwInitialFrames); |
37 printf("streams: %ld\n",h->dwStreams); | |
38 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize); | |
39 printf("Size: %ld x %ld\n",h->dwWidth,h->dwHeight); | |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
40 printf("==========================\n"); |
1 | 41 } |
42 | |
43 void print_strh(AVIStreamHeader *h){ | |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
44 printf("====== STREAM Header =====\n"); |
602 | 45 printf("Type: %.4s FCC: %.4s (%X)\n",(char *)&h->fccType,(char *)&h->fccHandler,(unsigned int)h->fccHandler); |
46 printf("Flags: %ld\n",h->dwFlags); | |
1 | 47 printf("Priority: %d Language: %d\n",h->wPriority,h->wLanguage); |
602 | 48 printf("InitialFrames: %ld\n",h->dwInitialFrames); |
49 printf("Rate: %ld/%ld = %5.3f\n",h->dwRate,h->dwScale,(float)h->dwRate/(float)h->dwScale); | |
50 printf("Start: %ld Len: %ld\n",h->dwStart,h->dwLength); | |
51 printf("Suggested BufferSize: %ld\n",h->dwSuggestedBufferSize); | |
52 printf("Quality %ld\n",h->dwQuality); | |
53 printf("Sample size: %ld\n",h->dwSampleSize); | |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
54 printf("==========================\n"); |
1 | 55 } |
56 | |
57 void print_wave_header(WAVEFORMATEX *h){ | |
58 printf("======= WAVE Format =======\n"); | |
59 printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag); | |
60 printf("Channels: %d\n",h->nChannels); | |
602 | 61 printf("Samplerate: %ld\n",h->nSamplesPerSec); |
62 printf("avg byte/sec: %ld\n",h->nAvgBytesPerSec); | |
1 | 63 printf("Block align: %d\n",h->nBlockAlign); |
64 printf("bits/sample: %d\n",h->wBitsPerSample); | |
65 printf("cbSize: %d\n",h->cbSize); | |
5711 | 66 if(h->wFormatTag==0x55 && h->cbSize>=12){ |
7127 | 67 MPEGLAYER3WAVEFORMAT* h2=(MPEGLAYER3WAVEFORMAT *)h; |
5688 | 68 printf("mp3.wID=%d\n",h2->wID); |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
69 printf("mp3.fdwFlags=0x%lX\n",h2->fdwFlags); |
5688 | 70 printf("mp3.nBlockSize=%d\n",h2->nBlockSize); |
71 printf("mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock); | |
72 printf("mp3.nCodecDelay=%d\n",h2->nCodecDelay); | |
73 } | |
5758 | 74 else if (h->cbSize > 0) |
75 { | |
76 int i; | |
5896 | 77 uint8_t* p = ((uint8_t*)h) + sizeof(WAVEFORMATEX); |
5758 | 78 printf("Unknown extra header dump: "); |
79 for (i = 0; i < h->cbSize; i++) | |
5896 | 80 printf("[%x] ", *(p+i)); |
5758 | 81 printf("\n"); |
82 } | |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
83 printf("===========================\n"); |
1 | 84 } |
85 | |
86 | |
87 void print_video_header(BITMAPINFOHEADER *h){ | |
88 printf("======= VIDEO Format ======\n"); | |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
89 printf(" biSize %d\n", h->biSize); |
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
90 printf(" biWidth %d\n", h->biWidth); |
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
91 printf(" biHeight %d\n", h->biHeight); |
1 | 92 printf(" biPlanes %d\n", h->biPlanes); |
93 printf(" biBitCount %d\n", h->biBitCount); | |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
94 printf(" biCompression %d='%.4s'\n", h->biCompression, (char *)&h->biCompression); |
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7471
diff
changeset
|
95 printf(" biSizeImage %d\n", h->biSizeImage); |
10484
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
96 if (h->biSize > sizeof(BITMAPINFOHEADER)) |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
97 { |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
98 int i; |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
99 uint8_t* p = ((uint8_t*)h) + sizeof(BITMAPINFOHEADER); |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
100 printf("Unknown extra header dump: "); |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
101 for (i = 0; i < h->biSize-sizeof(BITMAPINFOHEADER); i++) |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
102 printf("[%x] ", *(p+i)); |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
103 printf("\n"); |
105077598ef3
dump extra bytes of bitmapinfoheader in verbose mode and make outputs consistent
alex
parents:
8123
diff
changeset
|
104 } |
1 | 105 printf("===========================\n"); |
106 } | |
107 | |
108 | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
109 void print_index(AVIINDEXENTRY *idx,int idx_size){ |
1 | 110 int i; |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
111 unsigned int pos[256]; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
112 unsigned int num[256]; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
113 for(i=0;i<256;i++) num[i]=pos[i]=0; |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
114 for(i=0;i<idx_size;i++){ |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
115 int id=avi_stream_id(idx[i].ckid); |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
116 if(id<0 || id>255) id=255; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
117 printf("%5d: %.4s %4X %08X len:%6ld pos:%7d->%7.3f %7d->%7.3f\n",i, |
602 | 118 (char *)&idx[i].ckid, |
119 (unsigned int)idx[i].dwFlags, | |
120 (unsigned int)idx[i].dwChunkOffset, | |
587
8511095c5283
stage#1 completed: c files no more included from mplayer.c
arpi_esp
parents:
353
diff
changeset
|
121 // idx[i].dwChunkOffset+demuxer->movi_start, |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
122 idx[i].dwChunkLength, |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
123 pos[id],(float)pos[id]/18747.0f, |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
124 num[id],(float)num[id]/23.976f |
1 | 125 ); |
1485
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
126 pos[id]+=idx[i].dwChunkLength; |
b895f95e7657
AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents:
1456
diff
changeset
|
127 ++num[id]; |
1 | 128 } |
129 } | |
130 | |
131 |