OpenShot Library | libopenshot  0.3.2
Functions | Variables
FFmpegWriter.cpp File Reference

Source file for FFmpegWriter class. More...

#include <algorithm>
#include <iostream>
#include <cmath>
#include <ctime>
#include <unistd.h>
#include "FFmpegUtilities.h"
#include "FFmpegWriter.h"
#include "Exceptions.h"
#include "Frame.h"
#include "OpenMPUtilities.h"
#include "Settings.h"
#include "ZmqLogger.h"
Include dependency graph for FFmpegWriter.cpp:

Go to the source code of this file.

Functions

 AV_COPY_PARAMS_FROM_CONTEXT (st, video_codec_ctx)
 
 for (std::map< std::string, std::string >::iterator iter=info.metadata.begin();iter !=info.metadata.end();++iter)
 
 if (!codec) codec
 
 if (avcodec_open2(video_codec_ctx, codec, &opts)< 0) throw InvalidCodec("Could not open video codec"
 
 if (hw_en_on &&hw_en_supported)
 
 if (video_codec_ctx->max_b_frames &&video_codec_ctx->codec_id !=AV_CODEC_ID_MPEG4 &&video_codec_ctx->codec_id !=AV_CODEC_ID_MPEG1VIDEO &&video_codec_ctx->codec_id !=AV_CODEC_ID_MPEG2VIDEO) video_codec_ctx -> max_b_frames=0
 

Variables

 codec = avcodec_find_encoder_by_name(info.vcodec.c_str())
 
AVHWDeviceType hw_en_av_device_type = AV_HWDEVICE_TYPE_VAAPI
 
AVPixelFormat hw_en_av_pix_fmt = AV_PIX_FMT_NONE
 
int hw_en_on = 1
 
int hw_en_supported = 0
 
AVFrame * hw_frame = NULL
 
AVDictionary * mux_dict = NULL
 
AVDictionary * opts = NULL
 
 path
 

Detailed Description

Source file for FFmpegWriter class.

Author
Jonathan Thomas jonat.nosp@m.han@.nosp@m.opens.nosp@m.hot..nosp@m.org, Fabrice Bellard

This file is originally based on the Libavformat API example, and then modified by the libopenshot project.

License

Definition in file FFmpegWriter.cpp.

Function Documentation

◆ AV_COPY_PARAMS_FROM_CONTEXT()

AV_COPY_PARAMS_FROM_CONTEXT ( st  ,
video_codec_ctx   
)

◆ for()

for ( std::map< std::string, std::string >::iterator  iter = info.metadata.begin(); iter != info.metadata.end(); ++iter)

Definition at line 1519 of file FFmpegWriter.cpp.

◆ if() [1/4]

if ( codec)

◆ if() [2/4]

if ( )

◆ if() [3/4]

if ( hw_en_on &&  hw_en_supported)

Definition at line 1455 of file FFmpegWriter.cpp.

◆ if() [4/4]

if ( video_codec_ctx->max_b_frames &&video_codec_ctx->codec_id !  = AV_CODEC_ID_MPEG4 &&video_codec_ctx->codec_id !=AV_CODEC_ID_MPEG1VIDEO &&video_codec_ctx->codec_id !=AV_CODEC_ID_MPEG2VIDEO) -> max_b_frames
pure virtual

Variable Documentation

◆ codec

codec = avcodec_find_encoder_by_name(info.vcodec.c_str())

◆ hw_en_av_device_type

AVHWDeviceType hw_en_av_device_type = AV_HWDEVICE_TYPE_VAAPI

Definition at line 40 of file FFmpegWriter.cpp.

Referenced by openshot::FFmpegWriter::SetVideoOptions().

◆ hw_en_av_pix_fmt

AVPixelFormat hw_en_av_pix_fmt = AV_PIX_FMT_NONE

Definition at line 39 of file FFmpegWriter.cpp.

Referenced by if(), and openshot::FFmpegWriter::SetVideoOptions().

◆ hw_en_on

int hw_en_on = 1

◆ hw_en_supported

int hw_en_supported = 0

Definition at line 38 of file FFmpegWriter.cpp.

Referenced by openshot::FFmpegWriter::SetVideoOptions().

◆ hw_frame

AVFrame* hw_frame = NULL

Definition at line 42 of file FFmpegWriter.cpp.

◆ mux_dict

AVDictionary* mux_dict = NULL

◆ opts

av_dict_free & opts = NULL

Definition at line 1451 of file FFmpegWriter.cpp.

Referenced by openshot::FFmpegReader::Open().

◆ path

path