diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-09 15:21:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-09 15:22:20 +0100 |
| commit | 837a54744277a5252a1a69b0690305e9a669124d (patch) | |
| tree | e391cc061022e211a68a48eba37fbde4970f61e7 /src/lib/ffmpeg_transcoder.h | |
| parent | bb6b53bdb63754fe0cea1368f69f39a3c3cbbdfd (diff) | |
Basic video transcoding working.
Diffstat (limited to 'src/lib/ffmpeg_transcoder.h')
| -rw-r--r-- | src/lib/ffmpeg_transcoder.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_transcoder.h b/src/lib/ffmpeg_transcoder.h new file mode 100644 index 000000000..aa65b5933 --- /dev/null +++ b/src/lib/ffmpeg_transcoder.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2017 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + +#include "transcoder.h" +extern "C" { +#include <libavcodec/avcodec.h> +#include <libavformat/avformat.h> +} + +class FFmpegTranscoder : public Transcoder +{ +public: + FFmpegTranscoder (boost::shared_ptr<const Film> film, boost::weak_ptr<Job> job); + + void go (); + + float current_encoding_rate () const; + int video_frames_enqueued () const; + bool finishing () const { + return false; + } + +private: + void video (boost::shared_ptr<PlayerVideo>, DCPTime); + void audio (boost::shared_ptr<AudioBuffers>, DCPTime); + void subtitle (PlayerSubtitles, DCPTimePeriod); + + AVCodecContext* _codec_context; + AVFormatContext* _format_context; + AVStream* _video_stream; + AVPixelFormat _pixel_format; +}; |
