diff --git a/core/vidl/vidl_ffmpeg_istream_v3.txx b/core/vidl/vidl_ffmpeg_istream_v3.txx
index 73ab11f..019d652 100644
|
|
open(const vcl_string& filename) |
143 | 143 | } |
144 | 144 | |
145 | 145 | // Get the stream information by reading a bit of the file |
146 | | if ( av_find_stream_info( is_->fmt_cxt_ ) < 0 ) { |
| 146 | if ( avformat_find_stream_info( is_->fmt_cxt_, NULL ) < 0 ) { |
147 | 147 | return false; |
148 | 148 | } |
149 | 149 | |
… |
… |
open(const vcl_string& filename) |
165 | 165 | |
166 | 166 | // Open the stream |
167 | 167 | AVCodec* codec = avcodec_find_decoder(enc->codec_id); |
168 | | if ( !codec || avcodec_open( enc, codec ) < 0 ) { |
| 168 | if ( !codec || avcodec_open2( enc, codec, 0 ) < 0 ) { |
169 | 169 | return false; |
170 | 170 | } |
171 | 171 | |
… |
… |
close() |
216 | 216 | is_->vid_str_ = 0; |
217 | 217 | } |
218 | 218 | if ( is_->fmt_cxt_ ) { |
219 | | av_close_input_file( is_->fmt_cxt_ ); |
| 219 | avformat_close_input( &is_->fmt_cxt_ ); |
220 | 220 | is_->fmt_cxt_ = 0; |
221 | 221 | } |
222 | 222 | } |
diff --git a/core/vidl/vidl_ffmpeg_ostream_v4.txx b/core/vidl/vidl_ffmpeg_ostream_v4.txx
index 2eca21d..b74baf4 100644
|
|
open() |
117 | 117 | os_->fmt_cxt_->nb_streams = 0; |
118 | 118 | |
119 | 119 | // Create stream |
120 | | AVStream* st = av_new_stream( os_->fmt_cxt_, 0 ); |
| 120 | AVStream* st = avformat_new_stream( os_->fmt_cxt_, NULL ); |
121 | 121 | if ( !st ) { |
122 | 122 | vcl_cerr << "ffmpeg: could not alloc stream\n"; |
123 | 123 | close(); |
… |
… |
open() |
229 | 229 | if (params_.video_qscale_ || params_.same_quality_) |
230 | 230 | { |
231 | 231 | video_enc->flags |= CODEC_FLAG_QSCALE; |
232 | | st->quality = FF_QP2LAMBDA * params_.video_qscale_; |
| 232 | //st->quality = FF_QP2LAMBDA * params_.video_qscale_; |
233 | 233 | } |
234 | 234 | // if (bitexact) |
235 | 235 | // video_enc->flags |= CODEC_FLAG_BITEXACT; |
… |
… |
open() |
246 | 246 | video_enc->spatial_cplx_masking = params_.scplx_mask_; |
247 | 247 | video_enc->temporal_cplx_masking = params_.tcplx_mask_; |
248 | 248 | video_enc->p_masking = params_.p_mask_; |
249 | | video_enc->quantizer_noise_shaping= params_.qns_; |
| 249 | //video_enc->quantizer_noise_shaping= params_.qns_; |
250 | 250 | |
251 | | if (params_.use_umv_) |
| 251 | // Commented below are deprecated flags https://www.ffmpeg.org/doxygen/0.10/group__deprecated__flags.html |
| 252 | /*if (params_.use_umv_) |
252 | 253 | { |
253 | 254 | video_enc->flags |= CODEC_FLAG_H263P_UMV; |
254 | 255 | } |
… |
… |
open() |
259 | 260 | if (params_.use_aiv_) |
260 | 261 | { |
261 | 262 | video_enc->flags |= CODEC_FLAG_H263P_AIV; |
262 | | } |
| 263 | }*/ |
263 | 264 | if (params_.use_4mv_) |
264 | 265 | { |
265 | 266 | video_enc->flags |= CODEC_FLAG_4MV; |
266 | 267 | } |
267 | | if (params_.use_obmc_) |
| 268 | /*if (params_.use_obmc_) |
268 | 269 | { |
269 | 270 | video_enc->flags |= CODEC_FLAG_OBMC; |
270 | | } |
| 271 | }*/ |
271 | 272 | if (params_.use_loop_) |
272 | 273 | { |
273 | 274 | video_enc->flags |= CODEC_FLAG_LOOP_FILTER; |
274 | 275 | } |
275 | 276 | |
276 | | if (params_.use_part_) |
| 277 | /*if (params_.use_part_) |
277 | 278 | { |
278 | 279 | video_enc->flags |= CODEC_FLAG_PART; |
279 | 280 | } |
… |
… |
open() |
284 | 285 | if (params_.use_scan_offset_) |
285 | 286 | { |
286 | 287 | video_enc->flags |= CODEC_FLAG_SVCD_SCAN_OFFSET; |
287 | | } |
| 288 | }*/ |
288 | 289 | if (params_.closed_gop_) |
289 | 290 | { |
290 | 291 | video_enc->flags |= CODEC_FLAG_CLOSED_GOP; |
… |
… |
open() |
293 | 294 | { |
294 | 295 | video_enc->flags |= CODEC_FLAG_QPEL; |
295 | 296 | } |
296 | | if (params_.use_qprd_) |
| 297 | /*if (params_.use_qprd_) |
297 | 298 | { |
298 | 299 | video_enc->flags |= CODEC_FLAG_QP_RD; |
299 | 300 | } |
300 | 301 | if (params_.use_cbprd_) |
301 | 302 | { |
302 | 303 | video_enc->flags |= CODEC_FLAG_CBP_RD; |
303 | | } |
| 304 | }*/ |
304 | 305 | if (params_.b_frames_) |
305 | 306 | { |
306 | 307 | video_enc->max_b_frames = params_.b_frames_; |
… |
… |
open() |
377 | 378 | |
378 | 379 | vcl_strncpy( os_->fmt_cxt_->filename, filename_.c_str(), 1023 ); |
379 | 380 | |
380 | | if ( avio_open( &os_->fmt_cxt_->pb, filename_.c_str(), URL_WRONLY) < 0 ) |
| 381 | if ( avio_open( &os_->fmt_cxt_->pb, filename_.c_str(), AVIO_FLAG_WRITE) < 0 ) |
381 | 382 | { |
382 | 383 | vcl_cerr << "ffmpeg: couldn't open " << filename_ << " for writing\n"; |
383 | 384 | close(); |
… |
… |
open() |
387 | 388 | |
388 | 389 | //dump_format( os_->fmt_cxt_, 1, filename_, 1 ); |
389 | 390 | |
390 | | if ( avcodec_open( video_enc, codec ) < 0 ) |
| 391 | if ( avcodec_open2( video_enc, codec, 0 ) < 0 ) |
391 | 392 | { |
392 | 393 | vcl_cerr << "ffmpeg: couldn't open codec\n"; |
393 | 394 | close(); |