66bool transcoder_set_filesize(
LPVIRTUALFILE virtualfile, int64_t duration,
BITRATE audio_bit_rate,
int channels,
int sample_rate, AVSampleFormat sample_format,
BITRATE video_bit_rate,
int width,
int height,
bool interleaved,
const AVRational & framerate);
#define BITRATE
For FFmpeg bit rate is an int.
Main include for FFmpegfs project.
Cache_Entry * transcoder_new(LPVIRTUALFILE virtualfile, bool begin_transcode)
Allocate and initialise the transcoder.
bool transcoder_set_filesize(LPVIRTUALFILE virtualfile, int64_t duration, BITRATE audio_bit_rate, int channels, int sample_rate, AVSampleFormat sample_format, BITRATE video_bit_rate, int width, int height, bool interleaved, const AVRational &framerate)
Set the file size.
size_t transcoder_buffer_tell(Cache_Entry *cache_entry, uint32_t segment_no)
Return the current file position in the file.
bool transcoder_read(Cache_Entry *cache_entry, char *buff, size_t offset, size_t len, int *bytes_read, uint32_t segment_no)
Read some bytes from the internal buffer and into the given buffer.
void transcoder_exit()
Exit transcoding.
size_t transcoder_get_size(Cache_Entry *cache_entry)
Return size of output file, as computed by encoder.
bool transcoder_read_frame(Cache_Entry *cache_entry, char *buff, size_t offset, size_t len, uint32_t frame_no, int *bytes_read, LPVIRTUALFILE virtualfile)
Read one image frame from the internal buffer and into the given buffer.
size_t transcoder_buffer_watermark(Cache_Entry *cache_entry, uint32_t segment_no)
Return the current watermark of the file while transcoding.
bool transcoder_cached_filesize(LPVIRTUALFILE virtualfile, struct stat *stbuf)
Simply get encoded file size (do not create the whole encoder/decoder objects)
void transcoder_delete(Cache_Entry *cache_entry)
Free the cache entry structure.
bool transcoder_predict_filesize(LPVIRTUALFILE virtualfile, Cache_Entry *cache_entry=nullptr)
Predict file size.