MythTV  master
transcode.h
Go to the documentation of this file.
1 #include "recordingprofile.h"
2 #include "io/mythfifowriter.h"
3 #include "transcodedefs.h"
4 #include "programtypes.h"
5 #include "playercontext.h"
6 
7 class ProgramInfo;
9 class MythPlayer;
10 class MythMediaBuffer;
11 
12 using KFATable = vector<struct kfatable_entry>;
13 
14 class Transcode : public QObject
15 {
16  public:
17  explicit Transcode(ProgramInfo *pginfo);
18  ~Transcode() override;
19  int TranscodeFile(
20  const QString &inputname,
21  const QString &outputname,
22  const QString &profileName,
23  bool honorCutList, bool framecontrol, int jobID,
24  const QString& fifodir, bool fifo_info, bool cleanCut, frm_dir_map_t &deleteMap,
25  int AudioTrackNo, bool passthru = false);
26  void ShowProgress(bool val) { m_showProgress = val; }
28  void SetAVFMode(void) { m_avfMode = true; }
29  void SetHLSMode(void) { m_hlsMode = true; }
30  void SetHLSStreamID(int streamid) { m_hlsStreamID = streamid; }
31  void SetHLSMaxSegments(int segments) { m_hlsMaxSegments = segments; }
32  void SetCMDContainer(const QString& container) { m_cmdContainer = container; }
33  void SetCMDAudioCodec(const QString& codec) { m_cmdAudioCodec = codec; }
34  void SetCMDVideoCodec(const QString& codec) { m_cmdVideoCodec = codec; }
35  void SetCMDHeight(int height) { m_cmdHeight = height; }
36  void SetCMDWidth(int width) { m_cmdWidth = width; }
37  void SetCMDBitrate(int bitrate) { m_cmdBitrate = bitrate; }
38  void SetCMDAudioBitrate(int bitrate) { m_cmdAudioBitrate = bitrate; }
40 
41  private:
42  bool GetProfile(const QString& profileName, const QString& encodingType, int height,
43  int frameRate);
44  void ReencoderAddKFA(long curframe, long lastkey, long num_keyframes);
45  void SetPlayerContext(PlayerContext* player_ctx);
47  MythPlayer *GetPlayer(void) { return (m_ctx) ? m_ctx->m_player : nullptr; }
48 
49  private:
50  ProgramInfo *m_proginfo { nullptr };
52  int m_keyframeDist { 30 };
53 #if CONFIG_LIBMP3LAME
54  NuppelVideoRecorder *m_nvr { nullptr };
55 #endif
56  PlayerContext *m_ctx { nullptr };
58  MythFIFOWriter *m_fifow { nullptr };
59  KFATable *m_kfaTable { nullptr };
60  bool m_showProgress { false };
62  bool m_avfMode { false };
63  bool m_hlsMode { false };
64  int m_hlsStreamID { -1 };
65  bool m_hlsDisableAudioOnly { false };
66  int m_hlsMaxSegments { 0 };
67  QString m_cmdContainer { "mpegts" };
68  QString m_cmdAudioCodec { "aac" };
69  QString m_cmdVideoCodec { "libx264" };
70  int m_cmdWidth { 480 };
71  int m_cmdHeight { 0 };
72  int m_cmdBitrate { 600000 };
73  int m_cmdAudioBitrate { 64000 };
74 };
75 
76 /* vim: set expandtab tabstop=4 shiftwidth=4: */
Transcode::SetCMDVideoCodec
void SetCMDVideoCodec(const QString &codec)
Definition: transcode.h:34
Transcode::SetCMDBitrate
void SetCMDBitrate(int bitrate)
Definition: transcode.h:37
Transcode::SetCMDWidth
void SetCMDWidth(int width)
Definition: transcode.h:36
Transcode::m_cmdContainer
QString m_cmdContainer
Definition: transcode.h:67
Transcode::m_fifow
MythFIFOWriter * m_fifow
Definition: transcode.h:58
Transcode::GetPlayerContext
PlayerContext * GetPlayerContext(void)
Definition: transcode.h:46
Transcode::m_outBuffer
MythMediaBuffer * m_outBuffer
Definition: transcode.h:57
Transcode::SetCMDAudioCodec
void SetCMDAudioCodec(const QString &codec)
Definition: transcode.h:33
Transcode::m_keyframeDist
int m_keyframeDist
Definition: transcode.h:52
Transcode::m_recProfile
RecordingProfile * m_recProfile
Definition: transcode.h:51
Transcode::Transcode
Transcode(ProgramInfo *pginfo)
Definition: transcode.cpp:52
frm_dir_map_t
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:82
Transcode::m_cmdAudioBitrate
int m_cmdAudioBitrate
Definition: transcode.h:73
MythMediaBuffer
Definition: mythmediabuffer.h:49
MythFIFOWriter
Definition: mythfifowriter.h:33
MythPlayer
Definition: mythplayer.h:164
Transcode::m_cmdHeight
int m_cmdHeight
Definition: transcode.h:71
Transcode::m_hlsStreamID
int m_hlsStreamID
Definition: transcode.h:64
programtypes.h
Transcode::m_hlsDisableAudioOnly
bool m_hlsDisableAudioOnly
Definition: transcode.h:65
Transcode::m_hlsMaxSegments
int m_hlsMaxSegments
Definition: transcode.h:66
Transcode::DisableAudioOnlyHLS
void DisableAudioOnlyHLS(void)
Definition: transcode.h:39
transcodedefs.h
Transcode::m_cmdVideoCodec
QString m_cmdVideoCodec
Definition: transcode.h:69
Transcode::GetPlayer
MythPlayer * GetPlayer(void)
Definition: transcode.h:47
Transcode::SetAVFMode
void SetAVFMode(void)
Definition: transcode.h:28
Transcode::SetHLSMaxSegments
void SetHLSMaxSegments(int segments)
Definition: transcode.h:31
Transcode::m_cmdAudioCodec
QString m_cmdAudioCodec
Definition: transcode.h:68
mythfifowriter.h
Transcode::SetHLSMode
void SetHLSMode(void)
Definition: transcode.h:29
Transcode::SetCMDHeight
void SetCMDHeight(int height)
Definition: transcode.h:35
Transcode::ShowProgress
void ShowProgress(bool val)
Definition: transcode.h:26
Transcode::m_cmdBitrate
int m_cmdBitrate
Definition: transcode.h:72
Transcode::GetProfile
bool GetProfile(const QString &profileName, const QString &encodingType, int height, int frameRate)
Definition: transcode.cpp:81
KFATable
vector< struct kfatable_entry > KFATable
Definition: transcode.h:12
Transcode::m_recorderOptions
QString m_recorderOptions
Definition: transcode.h:61
Transcode::m_proginfo
ProgramInfo * m_proginfo
Definition: transcode.h:50
Transcode::m_avfMode
bool m_avfMode
Definition: transcode.h:62
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
Transcode::m_kfaTable
KFATable * m_kfaTable
Definition: transcode.h:59
playercontext.h
Transcode::~Transcode
~Transcode() override
Definition: transcode.cpp:58
Transcode::m_hlsMode
bool m_hlsMode
Definition: transcode.h:63
Transcode::SetRecorderOptions
void SetRecorderOptions(const QString &options)
Definition: transcode.h:27
Transcode::SetCMDContainer
void SetCMDContainer(const QString &container)
Definition: transcode.h:32
PlayerContext
Definition: playercontext.h:48
Transcode::m_ctx
PlayerContext * m_ctx
Definition: transcode.h:56
Transcode::SetCMDAudioBitrate
void SetCMDAudioBitrate(int bitrate)
Definition: transcode.h:38
recordingprofile.h
Transcode::m_showProgress
bool m_showProgress
Definition: transcode.h:60
RecordingProfile
Definition: recordingprofile.h:39
jobID
int jobID
Definition: mythtv/programs/mythcommflag/main.cpp:78
Transcode::SetPlayerContext
void SetPlayerContext(PlayerContext *player_ctx)
Definition: transcode.cpp:142
Transcode::m_cmdWidth
int m_cmdWidth
Definition: transcode.h:70
PlayerContext::m_player
MythPlayer * m_player
Definition: playercontext.h:151
build_compdb.options
options
Definition: build_compdb.py:11
Transcode::ReencoderAddKFA
void ReencoderAddKFA(long curframe, long lastkey, long num_keyframes)
Definition: transcode.cpp:69
Transcode::SetHLSStreamID
void SetHLSStreamID(int streamid)
Definition: transcode.h:30
Transcode
Definition: transcode.h:14
NuppelVideoRecorder
Definition: NuppelVideoRecorder.h:72
Transcode::TranscodeFile
int TranscodeFile(const QString &inputname, const QString &outputname, const QString &profileName, bool honorCutList, bool framecontrol, int jobID, const QString &fifodir, bool fifo_info, bool cleanCut, frm_dir_map_t &deleteMap, int AudioTrackNo, bool passthru=false)
Definition: transcode.cpp:195