FFmpegfs Fuse Multi Media Filesystem 2.16
dvdparser.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017-2024 Norbert Schlia (nschlia@oblivion-software.de)
3 *
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 3 of the License, or
7 * (at your option) any later version.
8 *
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.
13 *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 * On Debian systems, the complete text of the GNU General Public License
19 * Version 3 can be found in `/usr/share/common-licenses/GPL-3'.
20 */
21
22#ifdef USE_LIBDVD
23
34#include "ffmpegfs.h"
35#include "dvdparser.h"
36#include "transcode.h"
37#include "logging.h"
38
39#include <dvdread/dvd_reader.h>
40#include <dvdread/ifo_read.h>
41
42extern "C" {
43#include <libavutil/rational.h>
44}
45
46typedef struct AUDIO_SETTINGS
47{
55typedef struct VIDEO_SETTINGS
56{
58 int m_width;
64static int dvd_find_best_audio_stream(const vtsi_mat_t *vtsi_mat, int *best_channels, int *best_sample_frequency);
65static AVRational dvd_frame_rate(const uint8_t * ptr);
66static int64_t BCDtime(const dvd_time_t * dvd_time);
67static bool create_dvd_virtualfile(const ifo_handle_t *vts_file, const std::string & path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler, bool full_title, int title_idx, int chapter_idx, int angles, int ttnnum, int audio_stream, const AUDIO_SETTINGS & audio_settings, const VIDEO_SETTINGS & video_settings);
68static int parse_dvd(const std::string & path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler);
69
77static int dvd_find_best_audio_stream(const vtsi_mat_t *vtsi_mat, int *best_channels, int *best_sample_frequency)
78{
79 int best_stream = -1;
80 int best_application_mode = INT_MAX;
81 int best_lang_extension = INT_MAX;
82 int best_quantization = 0;
83
84 *best_channels = 0;
85 *best_sample_frequency = 0;
86
87 for(int i = 0; i < vtsi_mat->nr_of_vts_audio_streams; i++)
88 {
89 const audio_attr_t *attr = &vtsi_mat->vts_audio_attr[i];
90
91 if (attr->audio_format == 0
92 && attr->multichannel_extension == 0
93 && attr->lang_type == 0
94 && attr->application_mode == 0
95 && attr->quantization == 0
96 && attr->sample_frequency == 0
97 && attr->unknown1 == 0
98 && attr->channels == 0
99 && attr->lang_extension == 0
100 && attr->unknown3 == 0)
101 {
102 // Unspecified
103 continue;
104 }
105
106 // Preference in this order, if higher value is same, compare next and so on.
107 //
108 // application_mode: prefer not specified.
109 // 0: not specified
110 // 1: karaoke mode
111 // 2: surround sound mode
112 // lang_extension: prefer not specified or normal audio
113 // 0: Not specified
114 // 1: Normal audio/Caption
115 // 2: visually impaired
116 // 3: Director's comments 1
117 // 4: Director's comments 2
118 // sample_frequency: maybe 48K only
119 // 0: 48kHz
120 // 1: ??kHz
121 // quantization prefer highest bit width or drc
122 // 0: 16bit
123 // 1: 20bit
124 // 2: 24bit
125 // 3: drc
126 // channels: prefer no extension
127 // multichannel_extension
128
129 // if ((best_multiframe > multiframe) ||
130 // (best_multiframe == multiframe && best_bitrate > bitrate) ||
131 // (best_multiframe == multiframe && best_bitrate == bitrate && best_count >= count))
132
133 // Specs keep the meaning of the values of this field other than 0 secret, so we nail it to 48 kHz.
134 int sample_frequency = 48000;
135
136 if ((best_application_mode < attr->application_mode) ||
137 (best_application_mode == attr->application_mode && best_lang_extension < attr->lang_extension) ||
138 (best_application_mode == attr->application_mode && best_lang_extension == attr->lang_extension && *best_sample_frequency > sample_frequency) ||
139 (best_application_mode == attr->application_mode && best_lang_extension == attr->lang_extension && *best_sample_frequency == sample_frequency && *best_channels > attr->channels) ||
140 (best_application_mode == attr->application_mode && best_lang_extension == attr->lang_extension && *best_sample_frequency == sample_frequency && *best_channels == attr->channels && best_quantization > attr->quantization)
141 )
142 {
143 continue;
144 }
145
146 best_stream = i;
147 best_application_mode = attr->application_mode;
148 best_lang_extension = attr->lang_extension;
149 *best_sample_frequency = sample_frequency;
150 *best_channels = attr->channels;
151 best_quantization = attr->quantization;
152 }
153
154 if (best_stream > -1)
155 {
156 ++*best_channels;
157 }
158
159 return best_stream;
160}
161
167static AVRational dvd_frame_rate(const uint8_t * ptr)
168{
169 AVRational framerate = { 0, 0 };
170
171 // 11 = 30 fps, 10 = illegal, 01 = 25 fps, 00 = illegal
172 unsigned fps = ((ptr[3] & 0xC0) >> 6) & 0x03;
173
174 switch (fps)
175 {
176 case 3: // PAL
177 {
178 framerate = av_make_q(25000, 1000);
179 break;
180 }
181 case 1: // NTSC
182 {
183 framerate = av_make_q(30000, 10001);
184 break;
185 }
186 default:
187 {
188 // Frame rate is illegal, so we need to set anything. Assume PAL.
189 framerate = av_make_q(25000, 1000);
190 break;
191 }
192 }
193
194 return framerate;
195}
196
202static int64_t BCDtime(const dvd_time_t * dvd_time)
203{
204 std::array<int64_t, 4> time;
205 AVRational framerate = dvd_frame_rate(&dvd_time->frame_u);
206
207 if (!framerate.den)
208 {
209 framerate = av_make_q(25000, 1000); // Avoid divisions by 0
210 }
211 time[0] = dvd_time->hour;
212 time[1] = dvd_time->minute;
213 time[2] = dvd_time->second;
214 time[3] = dvd_time->frame_u & 0x3F; // Number of frame
215
216 // convert BCD (two digits) to binary
217 for (int64_t & tm : time)
218 {
219 tm = ((tm & 0xf0) >> 4) * 10 + (tm & 0x0f);
220 }
221
222 return (AV_TIME_BASE * (time[0] * 3600 + time[1] * 60 + time[2]) + static_cast<int64_t>(static_cast<double>(AV_TIME_BASE * time[3]) / av_q2d(framerate)));
223}
224
242static bool create_dvd_virtualfile(const ifo_handle_t *vts_file, const std::string & path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler, bool full_title, int title_idx, int chapter_idx, int angles, int ttnnum, int audio_stream, const AUDIO_SETTINGS & audio_settings, const VIDEO_SETTINGS & video_settings)
243{
244 const vts_ptt_srpt_t *vts_ptt_srpt = vts_file->vts_ptt_srpt;
245 int title_no = title_idx + 1;
246 int chapter_no = chapter_idx + 1;
247 int pgcnum = vts_ptt_srpt->title[ttnnum - 1].ptt[chapter_idx].pgcn;
248 int pgn = vts_ptt_srpt->title[ttnnum - 1].ptt[chapter_idx].pgn;
249 const pgc_t *cur_pgc = vts_file->vts_pgcit->pgci_srp[pgcnum - 1].pgc;
250 AVRational framerate;
251 int64_t duration = 0;
252 uint64_t size = 0;
253 bool interleaved = false;
254 int start_cell = cur_pgc->program_map[pgn - 1] - 1;
255 int end_cell = 0;
256
257 if (pgn < cur_pgc->nr_of_programs && !full_title)
258 {
259 end_cell = cur_pgc->program_map[pgn] - 1;
260 }
261 else
262 {
263 end_cell = cur_pgc->nr_of_cells;
264 }
265
266 interleaved = cur_pgc->cell_playback[start_cell].interleaved ? true : false;
267 framerate = dvd_frame_rate(&cur_pgc->cell_playback[start_cell].playback_time.frame_u);
268
269 bool has_angles = false;
270
271 for (int cell_no = start_cell; cell_no < end_cell; cell_no++)
272 {
273 cell_playback_t *cell_playback = &cur_pgc->cell_playback[cell_no];
274
275 // Only count normal cells and the first of an angle to avoid duplicate sizes
276 if (cell_playback->block_mode == static_cast<unsigned int>(BLOCK_MODE_NOT_IN_BLOCK) || cell_playback->block_mode == static_cast<unsigned int>(BLOCK_MODE_FIRST_CELL))
277 {
278 size += (cell_playback->last_sector - cell_playback->first_sector) * 2048;
279 duration += BCDtime(&cell_playback->playback_time);
280 }
281
282 if (cell_playback->block_type == static_cast<unsigned int>(BLOCK_TYPE_ANGLE_BLOCK))
283 {
284 has_angles = true;
285 }
286 }
287
288 if (duration < params.m_min_dvd_chapter_duration * AV_TIME_BASE)
289 {
290 Logging::debug(nullptr, "Skipping short DVD chapter.");
291 return true;
292 }
293
294 if (!has_angles)
295 {
296 // If this chapter has no angle cells, reset angles to 1
297 angles = 1;
298 }
299
300 // Split file if chapter has several angles
301 for (int angle_idx = 0; angle_idx < angles; angle_idx++)
302 {
303 std::string title_buf;
304 int angle_no = angle_idx + 1;
305
306 // can safely assume this a video
307 if (!full_title)
308 {
309 // Single chapter
310 if (angles > 1)
311 {
312 strsprintf(&title_buf, "%02d. Chapter %03d (Angle %d) [%s].%s",
313 title_no,
314 chapter_no,
315 angle_no,
316 replace_all(format_duration(duration), ":", "-").c_str(),
317 ffmpeg_format[FORMAT::VIDEO].fileext().c_str());
318 }
319 else
320 {
321 strsprintf(&title_buf, "%02d. Chapter %03d [%s].%s",
322 title_no,
323 chapter_no,
324 replace_all(format_duration(duration), ":", "-").c_str(),
325 ffmpeg_format[FORMAT::VIDEO].fileext().c_str());
326 }
327 }
328 else
329 {
330 // Full title
331 if (angles > 1)
332 {
333 strsprintf(&title_buf, "%02d. Title (Angle %d) [%s].%s",
334 title_no,
335 angle_no,
336 replace_all(format_duration(duration), ":", "-").c_str(),
337 ffmpeg_format[FORMAT::VIDEO].fileext().c_str());
338 }
339 else
340 {
341 strsprintf(&title_buf, "%02d. Title [%s].%s",
342 title_no,
343 replace_all(format_duration(duration), ":", "-").c_str(),
344 ffmpeg_format[FORMAT::VIDEO].fileext().c_str());
345 }
346 }
347
348 LPVIRTUALFILE virtualfile = nullptr;
349 if (!ffmpeg_format[FORMAT::VIDEO].is_multiformat())
350 {
351 virtualfile = insert_file(VIRTUALTYPE::DVD, path + title_buf, statbuf);
352 }
353 else
354 {
355 virtualfile = insert_dir(VIRTUALTYPE::DVD, path + title_buf, statbuf);
356 }
357
358 if (virtualfile == nullptr)
359 {
360 Logging::error(path, "Failed to create virtual path: %1", (path + title_buf).c_str());
361 errno = EIO;
362 return false;
363 }
364
365 if (add_fuse_entry(buf, filler, title_buf, &virtualfile->m_st, 0))
366 {
367 // break;
368 }
369
370 // DVD is video format anyway
371 virtualfile->m_format_idx = 0;
372 // Mark title/chapter/angle
373 virtualfile->m_full_title = full_title;
374 virtualfile->m_dvd.m_title_no = title_no;
375 virtualfile->m_dvd.m_chapter_no = chapter_no;
376 virtualfile->m_dvd.m_angle_no = angle_no;
377
378 if (!transcoder_cached_filesize(virtualfile, &virtualfile->m_st))
379 {
380 virtualfile->m_duration = duration;
381
382 BITRATE video_bit_rate = 8*1024*1024; // In case the real bitrate cannot be calculated later, assume 8 Mbit video bitrate
383 if (duration)
384 {
390 video_bit_rate = static_cast<BITRATE>(size * 8LL * AV_TIME_BASE / static_cast<uint64_t>(duration)); // calculate bitrate in bps
391 }
392
393 Logging::trace(virtualfile->m_destfile, "Video %1 %2x%3@%<5.2f>4%5 fps %6 [%7]", format_bitrate(video_settings.m_video_bit_rate).c_str(), video_settings.m_width, video_settings.m_height, av_q2d(framerate), interleaved ? "i" : "p", format_size(size).c_str(), format_duration(duration).c_str());
394
395 virtualfile->m_width = video_settings.m_width;
396 virtualfile->m_height = video_settings.m_height;
397 virtualfile->m_framerate = framerate;
398
399 if (audio_stream > -1)
400 {
401 Logging::trace(virtualfile->m_destfile, "Audio Channels %1 Sample Rate %2", audio_settings.m_channels, audio_settings.m_sample_rate);
402
403 virtualfile->m_channels = audio_settings.m_channels;
404 virtualfile->m_sample_rate = audio_settings.m_sample_rate;
405 }
406
407 transcoder_set_filesize(virtualfile, duration, audio_settings.m_audio_bit_rate, audio_settings.m_channels, audio_settings.m_sample_rate, AV_SAMPLE_FMT_NONE, video_bit_rate, video_settings.m_width, video_settings.m_height, interleaved, framerate);
408
409 virtualfile->m_video_frame_count = static_cast<uint32_t>(av_rescale_q(duration, av_get_time_base_q(), av_inv_q(framerate)));
410 virtualfile->m_predicted_size = static_cast<size_t>(size);
411 }
412 }
413
414 return true;
415}
416
425static int parse_dvd(const std::string & path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler)
426{
427 dvd_reader_t *dvd;
428 ifo_handle_t *ifo_file;
429 tt_srpt_t *tt_srpt;
430 int titles;
431 bool success = true;
432
433 Logging::debug(path, "Parsing the DVD.");
434
435 dvd = DVDOpen(path.c_str());
436 if (dvd == nullptr)
437 {
438 Logging::error(path, "Couldn't open the DVD.");
439 return ENOENT;
440 }
441
442 ifo_file = ifoOpen(dvd, 0);
443 if (ifo_file == nullptr)
444 {
445 Logging::error(path, "Can't open VMG info for the DVD.");
446 DVDClose(dvd);
447 return -EINVAL;
448 }
449 tt_srpt = ifo_file->tt_srpt;
450
451 titles = tt_srpt->nr_of_srpts;
452
453 Logging::debug(path, "There are %1 titles on this DVD.", titles);
454
455 for (int title_idx = 0; title_idx < titles && success; ++title_idx)
456 {
457 ifo_handle_t *vts_file;
458 int vtsnum = tt_srpt->title[title_idx].title_set_nr;
459 int ttnnum = tt_srpt->title[title_idx].vts_ttn;
460 int chapters = tt_srpt->title[title_idx].nr_of_ptts;
461 int angles = tt_srpt->title[title_idx].nr_of_angles;
462
463 Logging::trace(path, "Title: %1 VTS: %2 TTN: %3", title_idx + 1, vtsnum, ttnnum);
464 Logging::trace(path, "DVD title has %1 chapters and %2 angles.", chapters, angles);
465
466 vts_file = ifoOpen(dvd, vtsnum);
467 if (vts_file == nullptr)
468 {
469 Logging::error(path, "Can't open info file for title %1.", vtsnum);
470 DVDClose(dvd);
471 return -EINVAL;
472 }
473
474 // Set reasonable defaults
475 AUDIO_SETTINGS audio_settings;
476 audio_settings.m_audio_bit_rate = 256000;
477 audio_settings.m_channels = 2;
478 audio_settings.m_sample_rate = 48000;
479 int audio_stream = 0;
480
481 VIDEO_SETTINGS video_settings;
482 video_settings.m_video_bit_rate = 8000000;
483 video_settings.m_width = 720;
484 video_settings.m_height = 576;
485
486 if (vts_file->vtsi_mat)
487 {
488 audio_stream = dvd_find_best_audio_stream(vts_file->vtsi_mat, &audio_settings.m_channels, &audio_settings.m_sample_rate);
489
490 video_settings.m_height = (vts_file->vtsi_mat->vts_video_attr.video_format != 0) ? 576 : 480;
491
492 switch(vts_file->vtsi_mat->vts_video_attr.picture_size)
493 {
494 case 0:
495 {
496 video_settings.m_width = 720;
497 break;
498 }
499 case 1:
500 {
501 video_settings.m_width = 704;
502 break;
503 }
504 case 2:
505 {
506 video_settings.m_width = 352;
507 break;
508 }
509 case 3:
510 {
511 video_settings.m_width = 352;
512 video_settings.m_height /= 2;
513 break;
514 }
515 default:
516 {
517 Logging::warning(path, "DVD video contains invalid picture size attribute.");
518 }
519 }
520 }
521
522 // Add separate chapters
523 for (int chapter_idx = 0; chapter_idx < chapters && success; ++chapter_idx)
524 {
525 success = create_dvd_virtualfile(vts_file, path, statbuf, buf, filler, false, title_idx, chapter_idx, angles, ttnnum, audio_stream, audio_settings, video_settings);
526 }
527
528 if (success && chapters > 1)
529 {
530 // If more than 1 chapter, add full title as well
531 success = create_dvd_virtualfile(vts_file, path, statbuf, buf, filler, true, title_idx, 0, 1, ttnnum, audio_stream, audio_settings, video_settings);
532 }
533
534 ifoClose(vts_file);
535 }
536
537 ifoClose(ifo_file);
538 DVDClose(dvd);
539
540 if (success)
541 {
542 return titles; // Number of titles on disk
543 }
544 else
545 {
546 return -errno;
547 }
548}
549
550int check_dvd(const std::string & path, void *buf, fuse_fill_dir_t filler)
551{
552 std::string _path(path);
553 struct stat stbuf;
554 int res = 0;
555
556 append_sep(&_path);
557
558 if (stat((_path + "VIDEO_TS.IFO").c_str(), &stbuf) == 0 || stat((_path + "VIDEO_TS/VIDEO_TS.IFO").c_str(), &stbuf) == 0)
559 {
560 if (!check_path(_path))
561 {
562 Logging::trace(_path, "DVD detected.");
563 res = parse_dvd(_path, &stbuf, buf, filler);
564 Logging::trace(_path, "%1 titles were discovered.", res);
565 }
566 else
567 {
568 res = load_path(_path, &stbuf, buf, filler);
569 }
570
571 add_dotdot(buf, filler, &stbuf, 0);
572 }
573 return res;
574}
575
576#endif // USE_LIBDVD
static void warning(const T filename, const std::string &format_string, Args &&...args)
Write warning level log entry.
Definition: logging.h:220
static void debug(const T filename, const std::string &format_string, Args &&...args)
Write debug level log entry.
Definition: logging.h:182
static void trace(const T filename, const std::string &format_string, Args &&...args)
Write trace level log entry.
Definition: logging.h:163
static void error(const T filename, const std::string &format_string, Args &&...args)
Write error level log entry.
Definition: logging.h:239
VIDEO_SETTINGS const * LPCVIDEO_SETTINGS
Pointer to const version of VIDEO_SETTINGS.
Definition: dvdparser.cc:61
AUDIO_SETTINGS const * LPCAUDIO_SETTINGS
Pointer to const version of AUDIO_SETTINGS.
Definition: dvdparser.cc:52
AUDIO_SETTINGS * LPAUDIO_SETTINGS
Pointer version of AUDIO_SETTINGS.
Definition: dvdparser.cc:53
static int64_t BCDtime(const dvd_time_t *dvd_time)
Convert a time in BCD format into AV_TIMEBASE fractional seconds.
Definition: dvdparser.cc:202
static bool create_dvd_virtualfile(const ifo_handle_t *vts_file, const std::string &path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler, bool full_title, int title_idx, int chapter_idx, int angles, int ttnnum, int audio_stream, const AUDIO_SETTINGS &audio_settings, const VIDEO_SETTINGS &video_settings)
Create a virtual file for a DVD.
Definition: dvdparser.cc:242
static AVRational dvd_frame_rate(const uint8_t *ptr)
Get the frame rate of the DVD. Can be 25 fps (PAL) or 29.97 (NTCS).
Definition: dvdparser.cc:167
VIDEO_SETTINGS * LPVIDEO_SETTINGS
Pointer version of VIDEO_SETTINGS.
Definition: dvdparser.cc:62
struct AUDIO_SETTINGS AUDIO_SETTINGS
Audio stream settings.
int check_dvd(const std::string &path, void *buf, fuse_fill_dir_t filler)
Get number of titles on DVD.
Definition: dvdparser.cc:550
static int dvd_find_best_audio_stream(const vtsi_mat_t *vtsi_mat, int *best_channels, int *best_sample_frequency)
Locate best matching audio stream.
Definition: dvdparser.cc:77
static int parse_dvd(const std::string &path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler)
Parse DVD directory and get all DVD titles and chapters as virtual files.
Definition: dvdparser.cc:425
struct VIDEO_SETTINGS VIDEO_SETTINGS
Video stream settings.
DVD parser.
std::string format_duration(int64_t value, uint32_t fracs)
Format a time in format HH:MM:SS.fract.
std::string format_bitrate(BITRATE value)
Format a bit rate.
const std::string & append_sep(std::string *path)
Add / to the path if required.
std::string format_size(uint64_t value)
Format size.
std::string replace_all(std::string str, const std::string &from, const std::string &to)
Same as std::string replace(), but replaces all occurrences.
#define BITRATE
For FFmpeg bit rate is an int.
Definition: ffmpeg_utils.h:145
const std::string & strsprintf(std::string *str, const std::string &format, Args ... args)
Format a std::string sprintf-like.
Definition: ffmpeg_utils.h:737
@ VIDEO
FFmpegfs_Format info, 0: video file.
Definition: ffmpeg_utils.h:517
FFMPEGFS_PARAMS params
FFmpegfs command line parameters.
Definition: ffmpegfs.cc:74
FFMPEGFS_FORMAT_ARR ffmpeg_format
Two FFmpegfs_Format infos, 0: video file, 1: audio file.
Definition: ffmpegfs.cc:73
Main include for FFmpegfs project.
int add_dotdot(void *buf, fuse_fill_dir_t filler, const struct stat *stbuf, off_t off)
Make dot and double dot entries for a virtual directory.
Definition: fuseops.cc:2416
LPVIRTUALFILE insert_dir(VIRTUALTYPE type, const std::string &virtdir, const struct stat *stbuf, int flags=VIRTUALFLAG_NONE)
Add new virtual directory to the internal list. If the file already exists, it will be updated.
Definition: fuseops.cc:1717
int add_fuse_entry(void *buf, fuse_fill_dir_t filler, const std::string &name, const struct stat *stbuf, off_t off)
Wrapper to the Fuse filler function.
Definition: fuseops.cc:2406
int load_path(const std::string &path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler)
Load a path with virtual files for FUSE.
Definition: fuseops.cc:1759
bool check_path(const std::string &path)
Check if the path has already been parsed. Only useful if for DVD, Blu-ray or VCD where it is guarant...
Definition: fuseops.cc:1752
LPVIRTUALFILE insert_file(VIRTUALTYPE type, const std::string &virtfile, const struct stat *stbuf, int flags=VIRTUALFLAG_NONE)
Add new virtual file to internal list.
Definition: fuseops.cc:1638
@ DVD
DVD file.
Provide various log facilities to stderr, disk or syslog.
Audio stream settings.
Definition: dvdparser.cc:47
int m_sample_rate
number of audio samples per second
Definition: dvdparser.cc:50
int m_channels
number of channels (1: mono, 2: stereo, or more)
Definition: dvdparser.cc:49
BITRATE m_audio_bit_rate
average bitrate of audio data (in bits per second)
Definition: dvdparser.cc:48
int m_min_dvd_chapter_duration
Min. DVD chapter duration. Shorter chapters will be ignored.
Definition: ffmpegfs.h:257
Video stream settings.
Definition: dvdparser.cc:56
int m_height
video height in pixels
Definition: dvdparser.cc:59
BITRATE m_video_bit_rate
average bitrate of video data (in bits per second)
Definition: dvdparser.cc:57
int m_width
video width in pixels
Definition: dvdparser.cc:58
int m_angle_no
Selected angle number (1...n)
Definition: fileio.h:197
int m_title_no
Track number (1...n)
Definition: fileio.h:195
int m_chapter_no
Chapter number (1...n)
Definition: fileio.h:196
Virtual file definition.
Definition: fileio.h:123
int m_sample_rate
Audio sample rate - Filled in for the DVD/Blu-ray directory.
Definition: fileio.h:247
struct VIRTUALFILE::DVD_CHAPTER m_dvd
DVD title/chapter info.
bool m_full_title
If true, ignore m_chapter_no and provide full track.
Definition: fileio.h:155
std::string m_destfile
Name and path of destination file.
Definition: fileio.h:150
size_t m_predicted_size
Use this as the size instead of computing it over and over.
Definition: fileio.h:157
int m_width
Video width - Filled in for the DVD/Blu-ray directory.
Definition: fileio.h:249
int m_height
Video height - Filled in for the DVD/Blu-ray directory.
Definition: fileio.h:250
int m_channels
Audio channels - Filled in for the DVD/Blu-ray directory.
Definition: fileio.h:246
AVRational m_framerate
Video frame rate - Filled in for the DVD/Blu-ray directory.
Definition: fileio.h:251
struct stat m_st
stat structure with size etc.
Definition: fileio.h:153
size_t m_format_idx
Index into params.format[] array.
Definition: fileio.h:149
uint32_t m_video_frame_count
Number of frames in video or 0 if not a video.
Definition: fileio.h:158
int64_t m_duration
Track/chapter duration, in AV_TIME_BASE fractional seconds.
Definition: fileio.h:156
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.
Definition: transcode.cc:288
bool transcoder_cached_filesize(LPVIRTUALFILE virtualfile, struct stat *stbuf)
Simply get encoded file size (do not create the whole encoder/decoder objects)
Definition: transcode.cc:261
File transcoder interface (for use with by FUSE)