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