1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
diff --git a/IO/FFMPEG/vtkFFMPEGWriter.cxx b/IO/FFMPEG/vtkFFMPEGWriter.cxx
index d3fd421..294b421 100644
--- a/IO/FFMPEG/vtkFFMPEGWriter.cxx
+++ b/IO/FFMPEG/vtkFFMPEGWriter.cxx
@@ -191,11 +191,11 @@ int vtkFFMPEGWriterInternal::Start()
c->height = this->Dim[1];
if (this->Writer->GetCompression())
{
- c->pix_fmt = PIX_FMT_YUVJ422P;
+ c->pix_fmt = AV_PIX_FMT_YUVJ422P;
}
else
{
- c->pix_fmt = PIX_FMT_BGR24;
+ c->pix_fmt = AV_PIX_FMT_BGR24;
}
//to do playback at actual recorded rate, this will need more work see also below
@@ -274,13 +274,13 @@ int vtkFFMPEGWriterInternal::Start()
#endif
//for the output of the writer's input...
- this->rgbInput = avcodec_alloc_frame();
+ this->rgbInput = av_frame_alloc();
if (!this->rgbInput)
{
vtkGenericWarningMacro (<< "Could not make rgbInput avframe." );
return 0;
}
- int RGBsize = avpicture_get_size(PIX_FMT_RGB24, c->width, c->height);
+ int RGBsize = avpicture_get_size(AV_PIX_FMT_RGB24, c->width, c->height);
unsigned char *rgb = (unsigned char *)av_malloc(sizeof(unsigned char) * RGBsize);
if (!rgb)
{
@@ -288,10 +288,10 @@ int vtkFFMPEGWriterInternal::Start()
return 0;
}
//The rgb buffer should get deleted when this->rgbInput is.
- avpicture_fill((AVPicture *)this->rgbInput, rgb, PIX_FMT_RGB24, c->width, c->height);
+ avpicture_fill((AVPicture *)this->rgbInput, rgb, AV_PIX_FMT_RGB24, c->width, c->height);
//and for the output to the codec's input.
- this->yuvOutput = avcodec_alloc_frame();
+ this->yuvOutput = av_frame_alloc();
if (!this->yuvOutput)
{
vtkGenericWarningMacro (<< "Could not make yuvOutput avframe." );
@@ -349,12 +349,12 @@ int vtkFFMPEGWriterInternal::Write(vtkImageData *id)
//convert that to YUV for input to the codec
#ifdef VTK_FFMPEG_HAS_IMG_CONVERT
img_convert((AVPicture *)this->yuvOutput, cc->pix_fmt,
- (AVPicture *)this->rgbInput, PIX_FMT_RGB24,
+ (AVPicture *)this->rgbInput, AV_PIX_FMT_RGB24,
cc->width, cc->height);
#else
//convert that to YUV for input to the codec
SwsContext* convert_ctx = sws_getContext(
- cc->width, cc->height, PIX_FMT_RGB24,
+ cc->width, cc->height, AV_PIX_FMT_RGB24,
cc->width, cc->height, cc->pix_fmt,
SWS_BICUBIC, NULL, NULL, NULL);
|