#include "stdafx.h"#include <ffmpeg/avformat.h>#include <ffmpeg/swscale.h>#include <ffmpeg/avcodec.h>#include <ffmpeg/fifo.h>#include <limits.h>#include <ffmpeg/opt.h>#include "berrno.h"#include <math.h>#include <assert.h>#include "fifo.c"Go to the source code of this file.
Classes | |
| struct | AVStreamMap |
| struct | AVMetaDataMap |
| struct | vmsMediaConverterJob |
| struct | AVOutputStream |
| struct | AVInputStream |
| struct | AVInputFile |
Defines | |
| #define | INT64_C __int64 |
| #define | MAX_FILES 20 |
| #define | QSCALE_NONE -99999 |
| #define | MAX_AUDIO_PACKET_SIZE (128 * 1024) |
| #define | DEFAULT_PASS_LOGFILENAME "ffmpeg2pass" |
Functions | |
| BOOL APIENTRY | DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) |
| bool | opt_input_file (vmsMediaConverterJob *job, const char *filename) |
| static bool | check_audio_video_inputs (vmsMediaConverterJob *job, int *has_video_ptr, int *has_audio_ptr) |
| static bool | new_video_stream (vmsMediaConverterJob *job, AVFormatContext *oc) |
| static bool | new_audio_stream (vmsMediaConverterJob *job, AVFormatContext *oc) |
| static bool | opt_output_file (vmsMediaConverterJob *job, const char *filename) |
| static void | pre_process_video_frame (vmsMediaConverterJob *job, AVInputStream *ist, AVPicture *picture, void **bufp) |
| static double | get_sync_ipts (vmsMediaConverterJob *job, const AVOutputStream *ost) |
| static void | write_frame (AVFormatContext *s, AVPacket *pkt, AVCodecContext *avctx, AVBitStreamFilterContext *bsfc) |
| static void | do_audio_out (vmsMediaConverterJob *job, AVFormatContext *s, AVOutputStream *ost, AVInputStream *ist, unsigned char *buf, int size) |
| static bool | do_video_out (vmsMediaConverterJob *job, AVFormatContext *s, AVOutputStream *ost, AVInputStream *ist, AVFrame *in_picture, int *frame_size) |
| static bool | do_video_stats (vmsMediaConverterJob *job, AVFormatContext *os, AVOutputStream *ost, int frame_size) |
| static void | do_subtitle_out (vmsMediaConverterJob *job, AVFormatContext *s, AVOutputStream *ost, AVInputStream *ist, AVSubtitle *sub, int64_t pts) |
| static int | output_packet (vmsMediaConverterJob *job, AVInputStream *ist, int ist_index, AVOutputStream **ost_table, int nb_ostreams, const AVPacket *pkt) |
| static void | av_encode (vmsMediaConverterJob *job, AVFormatContext **output_files, int nb_output_files, AVFormatContext **input_files, int nb_input_files, AVStreamMap *stream_maps, int nb_stream_maps, int *pnProgress, BOOL *pbCancel) |
| static bool | opt_format (vmsMediaConverterJob *job, const char *arg) |
| static bool | opt_codec (int *pstream_copy, int *pcodec_id, int codec_type, const char *arg) |
| static void | opt_video_codec (vmsMediaConverterJob *job, const char *arg) |
| static void | opt_audio_codec (vmsMediaConverterJob *job, const char *arg) |
| static void | opt_audio_channels (vmsMediaConverterJob *job, int n) |
| static void | opt_audio_bitrate (vmsMediaConverterJob *job, int n) |
| static bool | opt_frame_size (vmsMediaConverterJob *job, int w, int h) |
| static void | opt_audio_rate (vmsMediaConverterJob *job, int n) |
| static bool | opt_frame_rate (vmsMediaConverterJob *job, double rate) |
| BOOL | ConvertMediaFile (LPCSTR pszSrcFile, LPCSTR pszDstFile, LPCSTR pszDstFormat, LPCSTR pszAudioCodec, int nAudioChannels, int nAudioBitrate, int nAudioRate, LPCSTR pszVideoCodec, int nVideoBitrate, int nVideoFrameRate, int nVideoFrameWidth, int nVideoFrameHeight, int *pnProgress, BOOL *pbCancel) |
| void | Initialize () |
| void | Shutdown () |
Variables | |
| char * | _psz1 = "tex^qComp" |
| char * | _psz2 = "video4linux" |
| char * | _psz3 = "ntsc" |
| char * | _psz4 = "audio_device" |
| #define DEFAULT_PASS_LOGFILENAME "ffmpeg2pass" |
| #define INT64_C __int64 |
Definition at line 18 of file MediaConverter.cpp.
| #define MAX_AUDIO_PACKET_SIZE (128 * 1024) |
| #define MAX_FILES 20 |
Definition at line 44 of file MediaConverter.cpp.
| #define QSCALE_NONE -99999 |
Definition at line 113 of file MediaConverter.cpp.
Referenced by new_audio_stream(), and vmsMediaConverterJob::vmsMediaConverterJob().
| static void av_encode | ( | vmsMediaConverterJob * | job, | |
| AVFormatContext ** | output_files, | |||
| int | nb_output_files, | |||
| AVFormatContext ** | input_files, | |||
| int | nb_input_files, | |||
| AVStreamMap * | stream_maps, | |||
| int | nb_stream_maps, | |||
| int * | pnProgress, | |||
| BOOL * | pbCancel | |||
| ) | [static] |
Definition at line 1660 of file MediaConverter.cpp.
References AVFormatContext::album, AVOutputStream::audio_resample, audio_resample_close(), audio_resample_init(), vmsMediaConverterJob::audio_sync_method, AVFormatContext::author, av_fifo_free(), av_fifo_init(), av_free(), av_free_packet(), av_freep(), av_gettime(), av_malloc(), av_mallocz(), AV_NOPTS_VALUE, av_q2d(), av_read_frame(), av_rescale_q(), AV_TIME_BASE, av_write_header(), av_write_trailer(), avcodec_close(), avcodec_find_decoder(), avcodec_find_encoder(), avcodec_get_frame_defaults(), avcodec_open(), avpicture_alloc(), vmsMediaConverterJob::bit_buffer, vmsMediaConverterJob::bit_buffer_size, AVCodecContext::bit_rate, AVCodecContext::block_align, AVInputFile::buffer_size_max, AVCodecContext::channels, AVStream::codec, CODEC_FLAG_PASS1, CODEC_FLAG_PASS2, AVCodecContext::codec_id, CODEC_ID_AC3, CODEC_ID_DTS, AVCodecContext::codec_tag, AVCodecContext::codec_type, CODEC_TYPE_AUDIO, CODEC_TYPE_SUBTITLE, CODEC_TYPE_VIDEO, AVFormatContext::comment, vmsMediaConverterJob::copy_ts, AVFormatContext::copyright, AVInputStream::decoding_needed, DEFAULT_PASS_LOGFILENAME, AVInputStream::discard, AVPacket::dts, vmsMediaConverterJob::dts_delta_threshold, EINVAL, AVOutputStream::encoding_needed, ENOMEM, AVInputFile::eof_reached, vmsMediaConverterJob::extra_size, AVCodecContext::extradata, AVCodecContext::extradata_size, FFABS, FFMAX, AVOutputStream::fifo, AVOutputStream::file_index, AVStreamMap::file_index, AVInputStream::file_index, AVCodecContext::flags, AVInputStream::frame, vmsMediaConverterJob::frame_bottomBand, vmsMediaConverterJob::frame_leftBand, AVOutputStream::frame_number, vmsMediaConverterJob::frame_padbottom, vmsMediaConverterJob::frame_padleft, vmsMediaConverterJob::frame_padright, vmsMediaConverterJob::frame_padtop, vmsMediaConverterJob::frame_rightBand, AVCodecContext::frame_size, vmsMediaConverterJob::frame_topBand, fread(), AVFormatContext::genre, AVCodecContext::has_b_frames, AVCodecContext::height, if(), AVOutputStream::img_resample_ctx, AVMetaDataMap::in_file, index, AVOutputStream::index, AVInputStream::index, vmsMediaConverterJob::input_files_ts_offset, vmsMediaConverterJob::input_sync, AVInputStream::is_start, AVInputFile::ist_index, AVOutputStream::leftBand, vmsMediaConverterJob::limit_filesize, AVOutputStream::logfile, MAX_AUDIO_PACKET_SIZE, vmsMediaConverterJob::max_frames, vmsMediaConverterJob::meta_data_maps, n, vmsMediaConverterJob::nb_meta_data_maps, AVFormatContext::nb_streams, AVInputFile::nb_streams, AVInputStream::next_pts, NULL, vmsMediaConverterJob::opt_shortest, AVMetaDataMap::out_file, output_packet(), AVOutputStream::padbottom, AVOutputStream::padleft, AVOutputStream::padright, AVOutputStream::padtop, vmsMediaConverterJob::pass_logfilename, AVOutputStream::pict_tmp, AVCodecContext::pix_fmt, AVStream::pts, AVInputStream::pts, AVCodecContext::rate_emu, vmsMediaConverterJob::recording_time, AVOutputStream::resample, AVOutputStream::resample_height, AVCodecContext::sample_rate, SEEK_END, SEEK_SET, AVPacket::size, AVOutputStream::source_index, AVOutputStream::st, AVInputStream::st, AVInputStream::start, AVStream::start_time, AVCodecContext::stats_in, AVStream::stream_copy, AVPacket::stream_index, AVStreamMap::stream_index, AVFormatContext::streams, vmsMediaConverterJob::sws_flags, sws_freeContext(), sws_getContext(), AVStreamMap::sync_file_index, AVOutputStream::sync_ist, AVOutputStream::sync_opts, AVStreamMap::sync_stream_index, AVStream::time_base, AVCodecContext::time_base, AVFormatContext::title, AVOutputStream::topBand, AVFormatContext::track, url_ftell(), AVFrac::val, AVOutputStream::video_crop, AVOutputStream::video_pad, AVOutputStream::video_resample, AVCodecContext::width, and AVFormatContext::year.
Referenced by ConvertMediaFile().
| static bool check_audio_video_inputs | ( | vmsMediaConverterJob * | job, | |
| int * | has_video_ptr, | |||
| int * | has_audio_ptr | |||
| ) | [static] |
Definition at line 544 of file MediaConverter.cpp.
References AVStream::codec, AVCodecContext::codec_type, CODEC_TYPE_AUDIO, CODEC_TYPE_DATA, CODEC_TYPE_SUBTITLE, CODEC_TYPE_UNKNOWN, CODEC_TYPE_VIDEO, vmsMediaConverterJob::input_files, vmsMediaConverterJob::nb_input_files, AVFormatContext::nb_streams, and AVFormatContext::streams.
Referenced by opt_output_file().
| BOOL ConvertMediaFile | ( | LPCSTR | pszSrcFile, | |
| LPCSTR | pszDstFile, | |||
| LPCSTR | pszDstFormat, | |||
| LPCSTR | pszAudioCodec, | |||
| int | nAudioChannels, | |||
| int | nAudioBitrate, | |||
| int | nAudioRate, | |||
| LPCSTR | pszVideoCodec, | |||
| int | nVideoBitrate, | |||
| int | nVideoFrameRate, | |||
| int | nVideoFrameWidth, | |||
| int | nVideoFrameHeight, | |||
| int * | pnProgress, | |||
| BOOL * | pbCancel | |||
| ) |
Definition at line 2364 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_disable, av_alloc_format_context(), av_close_input_file(), av_encode(), av_free(), avcodec_alloc_context(), vmsMediaConverterJob::avctx_opts, AVFMT_NOFILE, vmsMediaConverterJob::avformat_opts, AVCodecContext::bit_rate, AVStream::codec, FALSE, AVOutputFormat::flags, vmsMediaConverterJob::input_files, vmsMediaConverterJob::inter_matrix, vmsMediaConverterJob::intra_matrix, vmsMediaConverterJob::nb_input_files, vmsMediaConverterJob::nb_output_files, vmsMediaConverterJob::nb_stream_maps, AVFormatContext::nb_streams, AVFormatContext::oformat, opt_audio_bitrate(), opt_audio_channels(), opt_audio_codec(), opt_audio_rate(), opt_format(), opt_frame_rate(), opt_frame_size(), opt_input_file(), opt_output_file(), opt_video_codec(), vmsMediaConverterJob::output_files, AVFormatContext::pb, simple_client::s, vmsMediaConverterJob::stream_maps, AVFormatContext::streams, url_fclose(), and vmsMediaConverterJob::video_disable.
| BOOL APIENTRY DllMain | ( | HANDLE | hModule, | |
| DWORD | ul_reason_for_call, | |||
| LPVOID | lpReserved | |||
| ) |
| static void do_audio_out | ( | vmsMediaConverterJob * | job, | |
| AVFormatContext * | s, | |||
| AVOutputStream * | ost, | |||
| AVInputStream * | ist, | |||
| unsigned char * | buf, | |||
| int | size | |||
| ) | [static] |
Definition at line 943 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_buf, vmsMediaConverterJob::audio_out, audio_resample(), AVOutputStream::audio_resample, vmsMediaConverterJob::audio_size, vmsMediaConverterJob::audio_sync_method, av_fifo_read(), av_fifo_size(), av_fifo_write(), av_init_packet(), av_malloc(), AV_NOPTS_VALUE, av_realloc(), av_resample_compensate(), av_rescale_q(), avcodec_encode_audio(), vmsMediaConverterJob::bitstream_filters, AVCodecContext::channels, clip(), AVCodecContext::codec, AVStream::codec, CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE, CODEC_ID_PCM_S24BE, CODEC_ID_PCM_S24DAUD, CODEC_ID_PCM_S24LE, CODEC_ID_PCM_S32BE, CODEC_ID_PCM_S32LE, CODEC_ID_PCM_U16BE, CODEC_ID_PCM_U16LE, CODEC_ID_PCM_U24BE, CODEC_ID_PCM_U24LE, CODEC_ID_PCM_U32BE, CODEC_ID_PCM_U32LE, AVCodecContext::coded_frame, AVPacket::data, FFMAX, AVOutputStream::fifo, AVOutputStream::file_index, AVPacket::flags, AVCodecContext::frame_size, get_sync_ipts(), AVCodec::id, AVOutputStream::index, vmsMediaConverterJob::input_tmp, AVInputStream::is_start, MAX_AUDIO_PACKET_SIZE, PKT_FLAG_KEY, AVPacket::pts, AVOutputStream::resample, AVCodecContext::sample_rate, AVPacket::size, AVInputStream::st, AVOutputStream::st, AVPacket::stream_index, AVOutputStream::sync_opts, AVStream::time_base, AVCodecContext::time_base, and write_frame().
Referenced by output_packet().
| static void do_subtitle_out | ( | vmsMediaConverterJob * | job, | |
| AVFormatContext * | s, | |||
| AVOutputStream * | ost, | |||
| AVInputStream * | ist, | |||
| AVSubtitle * | sub, | |||
| int64_t | pts | |||
| ) | [static] |
Definition at line 1288 of file MediaConverter.cpp.
References av_init_packet(), av_malloc(), AV_NOPTS_VALUE, av_rescale_q(), AV_TIME_BASE, avcodec_encode_subtitle(), vmsMediaConverterJob::bitstream_filters, AVStream::codec, AVCodecContext::codec_id, CODEC_ID_DVB_SUBTITLE, AVPacket::data, AVSubtitle::end_display_time, AVOutputStream::file_index, AVInputStream::file_index, AVOutputStream::index, vmsMediaConverterJob::input_files_ts_offset, AVPacket::pts, AVPacket::size, AVInputStream::st, AVOutputStream::st, AVSubtitle::start_display_time, AVPacket::stream_index, vmsMediaConverterJob::subtitle_out, AVStream::time_base, and write_frame().
Referenced by output_packet().
| static bool do_video_out | ( | vmsMediaConverterJob * | job, | |
| AVFormatContext * | s, | |||
| AVOutputStream * | ost, | |||
| AVInputStream * | ist, | |||
| AVFrame * | in_picture, | |||
| int * | frame_size | |||
| ) | [static] |
Definition at line 1086 of file MediaConverter.cpp.
References av_free(), av_init_packet(), AV_NOPTS_VALUE, av_q2d(), av_rescale_q(), avcodec_encode_video(), avcodec_get_frame_defaults(), vmsMediaConverterJob::avctx_opts, AVFMT_RAWPICTURE, vmsMediaConverterJob::bit_buffer, vmsMediaConverterJob::bit_buffer_size, vmsMediaConverterJob::bitstream_filters, AVStream::codec, CODEC_FLAG_INTERLACED_DCT, CODEC_FLAG_INTERLACED_ME, CODEC_TYPE_VIDEO, AVCodecContext::coded_frame, AVPacket::data, FFMIN, AVOutputStream::file_index, AVCodecContext::flags, AVPacket::flags, AVOutputFormat::flags, AVOutputStream::frame_number, get_sync_ipts(), AVCodecContext::height, img_crop(), img_pad(), AVOutputStream::img_resample_ctx, AVOutputStream::index, AVOutputStream::leftBand, vmsMediaConverterJob::max_frames, vmsMediaConverterJob::me_threshold, vmsMediaConverterJob::nb_frames_drop, vmsMediaConverterJob::nb_frames_dup, NULL, AVFormatContext::oformat, AVOutputStream::padbottom, vmsMediaConverterJob::padcolor, AVOutputStream::padleft, AVOutputStream::padright, AVOutputStream::padtop, AVOutputStream::pict_tmp, AVCodecContext::pix_fmt, PKT_FLAG_KEY, AVPacket::pts, AVStream::quality, AVOutputStream::resample_height, vmsMediaConverterJob::same_quality, AVPacket::size, AVInputStream::st, AVOutputStream::st, AVPacket::stream_index, sws_scale(), AVOutputStream::sync_opts, AVStream::time_base, AVCodecContext::time_base, vmsMediaConverterJob::top_field_first, AVOutputStream::topBand, AVOutputStream::video_crop, AVOutputStream::video_pad, AVOutputStream::video_resample, vmsMediaConverterJob::video_sync_method, AVCodecContext::width, and write_frame().
Referenced by output_packet().
| static bool do_video_stats | ( | vmsMediaConverterJob * | job, | |
| AVFormatContext * | os, | |||
| AVOutputStream * | ost, | |||
| int | frame_size | |||
| ) | [static] |
Definition at line 1242 of file MediaConverter.cpp.
References av_q2d(), AVStream::codec, CODEC_FLAG_PSNR, AVCodecContext::codec_type, CODEC_TYPE_VIDEO, AVCodecContext::flags, AVOutputStream::frame_number, vmsMediaConverterJob::fvstats, NULL, AVOutputStream::st, AVOutputStream::sync_opts, AVCodecContext::time_base, and vmsMediaConverterJob::video_size.
Referenced by output_packet().
| static double get_sync_ipts | ( | vmsMediaConverterJob * | job, | |
| const AVOutputStream * | ost | |||
| ) | [static] |
Definition at line 918 of file MediaConverter.cpp.
References AV_TIME_BASE, AVInputStream::file_index, vmsMediaConverterJob::input_files_ts_offset, AVInputStream::pts, vmsMediaConverterJob::start_time, and AVOutputStream::sync_ist.
Referenced by do_audio_out(), and do_video_out().
| void Initialize | ( | ) |
| static bool new_audio_stream | ( | vmsMediaConverterJob * | job, | |
| AVFormatContext * | oc | |||
| ) | [static] |
Definition at line 715 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_bit_rate, vmsMediaConverterJob::audio_bitstream_filters, vmsMediaConverterJob::audio_channels, vmsMediaConverterJob::audio_codec_id, vmsMediaConverterJob::audio_codec_tag, vmsMediaConverterJob::audio_disable, vmsMediaConverterJob::audio_language, vmsMediaConverterJob::audio_qscale, vmsMediaConverterJob::audio_sample_rate, vmsMediaConverterJob::audio_stream_copy, av_free(), av_guess_codec(), av_new_stream(), avcodec_thread_init(), vmsMediaConverterJob::avctx_opts, AVFMT_GLOBALHEADER, AVCodecContext::bit_rate, vmsMediaConverterJob::bitstream_filters, AVCodecContext::channels, AVStream::codec, CODEC_FLAG_GLOBAL_HEADER, CODEC_FLAG_QSCALE, AVCodecContext::codec_id, CODEC_ID_NONE, AVCodecContext::codec_tag, AVCodecContext::codec_type, CODEC_TYPE_AUDIO, FF_QP2LAMBDA, AVFormatContext::filename, AVCodecContext::flags, AVOutputFormat::flags, AVCodecContext::global_quality, AVStream::language, vmsMediaConverterJob::nb_output_files, AVFormatContext::nb_streams, NULL, AVFormatContext::oformat, QSCALE_NONE, AVStream::quality, AVCodecContext::sample_rate, AVStream::stream_copy, vmsMediaConverterJob::strict, AVCodecContext::strict_std_compliance, vmsMediaConverterJob::thread_count, AVCodecContext::thread_count, and AVCodecContext::time_base.
Referenced by opt_output_file().
| static bool new_video_stream | ( | vmsMediaConverterJob * | job, | |
| AVFormatContext * | oc | |||
| ) | [static] |
Definition at line 576 of file MediaConverter.cpp.
References av_cmp_q(), av_d2q(), av_guess_codec(), av_new_stream(), av_sub_q(), avcodec_find_encoder(), avcodec_thread_init(), vmsMediaConverterJob::avctx_opts, AVFMT_GLOBALHEADER, AVCodecContext::bit_rate, vmsMediaConverterJob::bitstream_filters, AVStream::codec, CODEC_FLAG2_LOCAL_HEADER, CODEC_FLAG_GLOBAL_HEADER, CODEC_FLAG_PASS1, CODEC_FLAG_PASS2, CODEC_FLAG_PSNR, CODEC_FLAG_QSCALE, AVCodecContext::codec_id, CODEC_ID_NONE, AVCodecContext::codec_tag, AVCodecContext::codec_type, CODEC_TYPE_VIDEO, AVRational::den, vmsMediaConverterJob::do_pass, vmsMediaConverterJob::do_psnr, libtorrent::dht::messages::error, FF_QP2LAMBDA, AVFormatContext::filename, AVCodecContext::flags, AVOutputFormat::flags, AVCodecContext::flags2, vmsMediaConverterJob::frame_aspect_ratio, vmsMediaConverterJob::frame_height, vmsMediaConverterJob::frame_padbottom, vmsMediaConverterJob::frame_padleft, vmsMediaConverterJob::frame_padright, vmsMediaConverterJob::frame_padtop, vmsMediaConverterJob::frame_pix_fmt, vmsMediaConverterJob::frame_rate, vmsMediaConverterJob::frame_rate_base, vmsMediaConverterJob::frame_width, AVCodecContext::global_quality, AVCodecContext::gop_size, AVCodecContext::height, AVCodecContext::inter_matrix, vmsMediaConverterJob::inter_matrix, vmsMediaConverterJob::intra_dc_precision, AVCodecContext::intra_dc_precision, AVCodecContext::intra_matrix, vmsMediaConverterJob::intra_matrix, vmsMediaConverterJob::intra_only, AVCodecContext::max_qdiff, vmsMediaConverterJob::me_method, AVCodecContext::me_method, vmsMediaConverterJob::me_threshold, AVCodecContext::me_threshold, vmsMediaConverterJob::nb_output_files, AVFormatContext::nb_streams, NULL, AVRational::num, AVFormatContext::oformat, vmsMediaConverterJob::packet_size, AVCodecContext::pix_fmt, AVStream::quality, AVCodecContext::rc_buffer_size, AVCodecContext::rc_eq, AVCodecContext::rc_initial_buffer_occupancy, AVCodecContext::rc_override_count, AVCodecContext::rtp_mode, AVCodecContext::rtp_payload_size, vmsMediaConverterJob::same_quality, AVCodecContext::sample_aspect_ratio, AVStream::stream_copy, vmsMediaConverterJob::strict, AVCodecContext::strict_std_compliance, AVCodec::supported_framerates, vmsMediaConverterJob::thread_count, AVCodecContext::thread_count, AVCodecContext::time_base, vmsMediaConverterJob::video_bitstream_filters, vmsMediaConverterJob::video_codec_id, vmsMediaConverterJob::video_codec_tag, vmsMediaConverterJob::video_disable, vmsMediaConverterJob::video_global_header, vmsMediaConverterJob::video_qdiff, vmsMediaConverterJob::video_qscale, vmsMediaConverterJob::video_rc_eq, vmsMediaConverterJob::video_rc_override_string, vmsMediaConverterJob::video_stream_copy, and AVCodecContext::width.
Referenced by opt_output_file().
| static void opt_audio_bitrate | ( | vmsMediaConverterJob * | job, | |
| int | n | |||
| ) | [static] |
Definition at line 2331 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_bit_rate.
Referenced by ConvertMediaFile().
| static void opt_audio_channels | ( | vmsMediaConverterJob * | job, | |
| int | n | |||
| ) | [static] |
Definition at line 2326 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_channels.
Referenced by ConvertMediaFile().
| static void opt_audio_codec | ( | vmsMediaConverterJob * | job, | |
| const char * | arg | |||
| ) | [static] |
Definition at line 2321 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_codec_id, vmsMediaConverterJob::audio_stream_copy, CODEC_TYPE_AUDIO, and opt_codec().
Referenced by ConvertMediaFile().
| static void opt_audio_rate | ( | vmsMediaConverterJob * | job, | |
| int | n | |||
| ) | [static] |
Definition at line 2347 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_sample_rate.
Referenced by ConvertMediaFile().
| static bool opt_codec | ( | int * | pstream_copy, | |
| int * | pcodec_id, | |||
| int | codec_type, | |||
| const char * | arg | |||
| ) | [static] |
Definition at line 2292 of file MediaConverter.cpp.
References first_avcodec, AVCodec::id, AVCodec::name, AVCodec::next, NULL, and AVCodec::type.
Referenced by opt_audio_codec(), and opt_video_codec().
| static bool opt_format | ( | vmsMediaConverterJob * | job, | |
| const char * | arg | |||
| ) | [static] |
Definition at line 2274 of file MediaConverter.cpp.
References av_find_input_format(), vmsMediaConverterJob::file_iformat, vmsMediaConverterJob::file_oformat, guess_format(), NULL, and vmsMediaConverterJob::pgmyuv_compatibility_hack.
Referenced by ConvertMediaFile().
| static bool opt_frame_rate | ( | vmsMediaConverterJob * | job, | |
| double | rate | |||
| ) | [static] |
Definition at line 2352 of file MediaConverter.cpp.
References av_d2q(), AVRational::den, vmsMediaConverterJob::frame_rate, vmsMediaConverterJob::frame_rate_base, and AVRational::num.
Referenced by ConvertMediaFile().
| static bool opt_frame_size | ( | vmsMediaConverterJob * | job, | |
| int | w, | |||
| int | h | |||
| ) | [static] |
Definition at line 2336 of file MediaConverter.cpp.
References vmsMediaConverterJob::frame_height, and vmsMediaConverterJob::frame_width.
Referenced by ConvertMediaFile().
| bool opt_input_file | ( | vmsMediaConverterJob * | job, | |
| const char * | filename | |||
| ) |
Definition at line 416 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_channels, vmsMediaConverterJob::audio_codec_id, AVFormatParameters::audio_codec_id, vmsMediaConverterJob::audio_disable, vmsMediaConverterJob::audio_sample_rate, av_alloc_format_context(), av_find_stream_info(), AV_NOPTS_VALUE, av_open_input_file(), av_q2d(), av_seek_frame(), avcodec_thread_init(), vmsMediaConverterJob::avctx_opts, AVDISCARD_ALL, AVSEEK_FLAG_BACKWARD, AVCodecContext::bit_rate, AVFormatParameters::channel, AVCodecContext::channels, AVFormatParameters::channels, AVStream::codec, CODEC_FLAG_EMU_EDGE, CODEC_ID_PGMYUV, AVCodecContext::codec_type, CODEC_TYPE_AUDIO, CODEC_TYPE_DATA, CODEC_TYPE_SUBTITLE, CODEC_TYPE_UNKNOWN, CODEC_TYPE_VIDEO, vmsMediaConverterJob::copy_ts, AVCodecContext::debug, AVRational::den, AVFormatParameters::device, AVStream::discard, FF_DEBUG_MV, vmsMediaConverterJob::file_iformat, vmsMediaConverterJob::file_oformat, AVCodecContext::flags, vmsMediaConverterJob::frame_aspect_ratio, vmsMediaConverterJob::frame_height, vmsMediaConverterJob::frame_padbottom, vmsMediaConverterJob::frame_padleft, vmsMediaConverterJob::frame_padright, vmsMediaConverterJob::frame_padtop, vmsMediaConverterJob::frame_pix_fmt, vmsMediaConverterJob::frame_rate, vmsMediaConverterJob::frame_rate_base, vmsMediaConverterJob::frame_width, vmsMediaConverterJob::grab_device, AVCodecContext::height, AVFormatParameters::height, vmsMediaConverterJob::input_files, vmsMediaConverterJob::input_files_ts_offset, vmsMediaConverterJob::input_ts_offset, vmsMediaConverterJob::loop_input, AVFormatContext::loop_input, AVCodecContext::lowres, vmsMediaConverterJob::me_threshold, vmsMediaConverterJob::nb_input_files, AVFormatContext::nb_streams, NULL, AVRational::num, vmsMediaConverterJob::pgmyuv_compatibility_hack, AVCodecContext::pix_fmt, AVFormatParameters::pix_fmt, AVFormatParameters::prealloced_context, AVStream::r_frame_rate, vmsMediaConverterJob::rate_emu, AVCodecContext::rate_emu, AVCodecContext::sample_aspect_ratio, AVCodecContext::sample_rate, AVFormatParameters::sample_rate, AVFormatParameters::standard, AVFormatContext::start_time, vmsMediaConverterJob::start_time, AVFormatContext::streams, AVCodecContext::thread_count, vmsMediaConverterJob::thread_count, AVCodecContext::time_base, AVFormatParameters::time_base, vmsMediaConverterJob::video_channel, vmsMediaConverterJob::video_codec_id, AVFormatParameters::video_codec_id, vmsMediaConverterJob::video_disable, vmsMediaConverterJob::video_discard, vmsMediaConverterJob::video_standard, AVCodecContext::width, and AVFormatParameters::width.
Referenced by ConvertMediaFile().
| static bool opt_output_file | ( | vmsMediaConverterJob * | job, | |
| const char * | filename | |||
| ) | [static] |
Definition at line 780 of file MediaConverter.cpp.
References AVFormatContext::album, AVOutputFormat::audio_codec, vmsMediaConverterJob::audio_codec_id, vmsMediaConverterJob::audio_disable, vmsMediaConverterJob::audio_stream_copy, AVFormatContext::author, av_alloc_format_context(), av_filename_number_test(), av_set_parameters(), AV_TIME_BASE, AVFMT_NEEDNUMBER, AVFMT_NOFILE, check_audio_video_inputs(), CODEC_ID_NONE, AVFormatContext::comment, AVFormatContext::copyright, vmsMediaConverterJob::file_iformat, vmsMediaConverterJob::file_oformat, AVFormatContext::filename, AVOutputFormat::flags, guess_format(), vmsMediaConverterJob::loop_output, AVFormatContext::loop_output, AVFormatContext::max_delay, vmsMediaConverterJob::mux_max_delay, vmsMediaConverterJob::mux_preload, vmsMediaConverterJob::nb_input_files, vmsMediaConverterJob::nb_output_files, new_audio_stream(), new_video_stream(), NULL, AVFormatContext::oformat, vmsMediaConverterJob::output_files, AVFormatContext::pb, AVFormatContext::preload, vmsMediaConverterJob::rec_timestamp, vmsMediaConverterJob::str_album, vmsMediaConverterJob::str_author, vmsMediaConverterJob::str_comment, vmsMediaConverterJob::str_copyright, vmsMediaConverterJob::str_title, AVFormatContext::timestamp, AVFormatContext::title, url_fopen(), URL_WRONLY, AVOutputFormat::video_codec, vmsMediaConverterJob::video_codec_id, vmsMediaConverterJob::video_disable, and vmsMediaConverterJob::video_stream_copy.
Referenced by ConvertMediaFile().
| static void opt_video_codec | ( | vmsMediaConverterJob * | job, | |
| const char * | arg | |||
| ) | [static] |
Definition at line 2316 of file MediaConverter.cpp.
References CODEC_TYPE_VIDEO, opt_codec(), vmsMediaConverterJob::video_codec_id, and vmsMediaConverterJob::video_stream_copy.
Referenced by ConvertMediaFile().
| static int output_packet | ( | vmsMediaConverterJob * | job, | |
| AVInputStream * | ist, | |||
| int | ist_index, | |||
| AVOutputStream ** | ost_table, | |||
| int | nb_ostreams, | |||
| const AVPacket * | pkt | |||
| ) | [static] |
Definition at line 1339 of file MediaConverter.cpp.
References vmsMediaConverterJob::audio_size, vmsMediaConverterJob::audio_volume, av_destruct_packet(), av_fast_realloc(), av_fifo_read(), av_fifo_size(), av_free(), av_free_packet(), av_freep(), av_gettime(), av_init_packet(), AV_NOPTS_VALUE, av_parser_change(), av_rescale(), av_rescale_q(), AV_TIME_BASE, avcodec_decode_audio(), avcodec_decode_subtitle(), avcodec_decode_video(), avcodec_encode_audio(), avcodec_encode_video(), avcodec_get_frame_defaults(), AVCODEC_MAX_AUDIO_FRAME_SIZE, AVFMT_RAWPICTURE, vmsMediaConverterJob::bit_buffer, vmsMediaConverterJob::bit_buffer_size, AVSubtitleRect::bitmap, vmsMediaConverterJob::bitstream_filters, AVCodec::capabilities, AVCodecContext::channels, AVCodecContext::codec, AVStream::codec, CODEC_CAP_SMALL_LAST_FRAME, AVCodecContext::codec_id, CODEC_ID_MPEG1VIDEO, AVCodecContext::codec_type, CODEC_TYPE_AUDIO, CODEC_TYPE_SUBTITLE, CODEC_TYPE_VIDEO, AVCodecContext::coded_frame, AVPacket::data, AVInputStream::decoding_needed, AVRational::den, AVPacket::destruct, do_audio_out(), do_subtitle_out(), do_video_out(), do_video_stats(), vmsMediaConverterJob::do_vstats, AVPacket::dts, AVOutputStream::encoding_needed, FFMAX, AVOutputStream::fifo, AVInputStream::file_index, AVOutputStream::file_index, AVOutputFormat::flags, AVPacket::flags, AVInputStream::frame, AVOutputStream::frame_number, AVCodecContext::frame_number, AVCodecContext::frame_size, AVCodecContext::height, if(), AVOutputStream::index, vmsMediaConverterJob::input_files_ts_offset, AVOutputStream::logfile, AVInputStream::next_pts, NULL, AVRational::num, AVSubtitle::num_rects, AVFormatContext::oformat, vmsMediaConverterJob::output_files, AVStream::parser, PKT_FLAG_KEY, pre_process_video_frame(), AVPacket::pts, AVInputStream::pts, AVStream::quality, AVCodecContext::rate_emu, AVSubtitle::rects, AVSubtitleRect::rgba_palette, AVCodecContext::sample_rate, vmsMediaConverterJob::samples, vmsMediaConverterJob::samples_size, AVPacket::size, AVOutputStream::source_index, AVOutputStream::st, AVInputStream::st, AVInputStream::start, vmsMediaConverterJob::start_time, AVCodecContext::stats_out, AVPacket::stream_index, AVOutputStream::sync_opts, AVCodecContext::time_base, AVStream::time_base, vmsMediaConverterJob::video_size, AVCodecContext::width, and write_frame().
Referenced by av_encode().
| static void pre_process_video_frame | ( | vmsMediaConverterJob * | job, | |
| AVInputStream * | ist, | |||
| AVPicture * | picture, | |||
| void ** | bufp | |||
| ) | [static] |
Definition at line 874 of file MediaConverter.cpp.
References av_free(), av_malloc(), avpicture_deinterlace(), avpicture_fill(), avpicture_get_size(), AVStream::codec, vmsMediaConverterJob::do_deinterlace, AVCodecContext::height, img_copy(), NULL, AVCodecContext::pix_fmt, AVInputStream::st, vmsMediaConverterJob::using_vhook, and AVCodecContext::width.
Referenced by output_packet().
| void Shutdown | ( | ) |
Definition at line 2473 of file MediaConverter.cpp.
References av_free_static().
Referenced by IFDM_Shutdown_Stub().
| static void write_frame | ( | AVFormatContext * | s, | |
| AVPacket * | pkt, | |||
| AVCodecContext * | avctx, | |||
| AVBitStreamFilterContext * | bsfc | |||
| ) | [static] |
Definition at line 924 of file MediaConverter.cpp.
References a, av_bitstream_filter_filter(), av_destruct_packet(), av_free_packet(), av_interleaved_write_frame(), AVPacket::data, AVPacket::destruct, AVPacket::flags, AVBitStreamFilterContext::next, NULL, PKT_FLAG_KEY, and AVPacket::size.
Referenced by do_audio_out(), do_subtitle_out(), do_video_out(), and output_packet().
| char* _psz1 = "tex^qComp" |
Definition at line 45 of file MediaConverter.cpp.
Referenced by vmsMediaConverterJob::vmsMediaConverterJob().
| char* _psz2 = "video4linux" |
Definition at line 46 of file MediaConverter.cpp.
Referenced by vmsMediaConverterJob::vmsMediaConverterJob().
| char* _psz3 = "ntsc" |
Definition at line 47 of file MediaConverter.cpp.
Referenced by vmsMediaConverterJob::vmsMediaConverterJob().
| char* _psz4 = "audio_device" |
Definition at line 48 of file MediaConverter.cpp.
Referenced by vmsMediaConverterJob::vmsMediaConverterJob().
1.5.6