2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 /** @file src/options.h
21 * @brief Options for a transcoding operation.
30 * @brief Options for a transcoding operation.
32 * These are settings which may be different, in different circumstances, for
33 * the same film; ie they are options for a particular transcode operation.
39 Options (std::string f, std::string e, std::string m)
43 , decode_video_frequency (0)
46 , _frame_out_extension (e)
47 , _multichannel_audio_out_path (m)
50 /** @return The path to write video frames to */
51 std::string frame_out_path () const {
52 return _frame_out_path;
55 /** @param f Frame index.
56 * @param t true to return a temporary file path, otherwise a permanent one.
57 * @return The path to write this video frame to.
59 std::string frame_out_path (int f, bool t) const {
61 s << _frame_out_path << "/";
63 s << std::setfill('0') << f << _frame_out_extension;
72 /** @return Path to write multichannel audio data to */
73 std::string multichannel_audio_out_path () const {
74 return _multichannel_audio_out_path;
77 /** @param c Audio channel index.
78 * @param t true to return a temporary file path, otherwise a permanent one.
79 * @return The path to write this audio file to.
81 std::string multichannel_audio_out_path (int c, bool t) const {
83 s << _multichannel_audio_out_path << "/" << (c + 1) << ".wav";
91 Size out_size; ///< size of output images
92 float ratio; ///< ratio of the wanted output image (not considering padding)
93 int padding; ///< number of pixels of padding (in terms of the output size) each side of the image
94 bool apply_crop; ///< true to apply cropping
95 int black_after; ///< first frame for which to output a black frame, rather than the actual video content, or 0 for none
96 int decode_video_frequency; ///< skip frames so that this many are decoded in all (or 0) (for generating thumbnails)
97 bool decode_audio; ///< true to decode audio, otherwise false
100 /** Path of the directory to write video frames to */
101 std::string _frame_out_path;
102 /** Extension to use for video frame files (including the leading .) */
103 std::string _frame_out_extension;
104 /** Path of the directory to write audio files to */
105 std::string _multichannel_audio_out_path;