equal
deleted
inserted
replaced
319 g_pVideo->weighted_p_pred = 2; |
319 g_pVideo->weighted_p_pred = 2; |
320 } |
320 } |
321 #endif |
321 #endif |
322 |
322 |
323 // open the codec |
323 // open the codec |
324 #if LIBAVCODEC_VERSION_MAJOR >= 53 |
324 if (avcodec_open2(g_pVideo, g_pVCodec, NULL) < 0) |
325 AVDictionary* pDict = NULL; |
|
326 if (strcmp(g_pVCodec->name, "libx264") == 0) |
|
327 av_dict_set(&pDict, "preset", "medium", 0); |
|
328 #endif |
|
329 |
|
330 if (avcodec_open2(g_pVideo, g_pVCodec, &pDict) < 0) |
|
331 return FatalError("Could not open video codec %s", g_pVCodec->long_name); |
325 return FatalError("Could not open video codec %s", g_pVCodec->long_name); |
332 |
326 |
333 g_pVFrame = av_frame_alloc(); |
327 g_pVFrame = av_frame_alloc(); |
334 if (!g_pVFrame) |
328 if (!g_pVFrame) |
335 return FatalError("Could not allocate frame"); |
329 return FatalError("Could not allocate frame"); |