Commit graph

25 commits

Author SHA1 Message Date
Luna
6b624a72cd Narrow bare except blocks so real errors aren't swallowed (roadmap A4)
Replaced all 46 bare 'except:' across the package with specific exception
types, and logged the cases that indicate a real problem:

- config load/save: FileNotFoundError is the silent first-run case; other
  OSError/ValueError/UnicodeDecodeError are logged.
- ffprobe/avprobe: JSON parse failures are now logged (previously a media
  file that ffprobe couldn't read just silently failed to import); decode
  fallbacks -> UnicodeDecodeError; duration parse -> ValueError/TypeError/
  KeyError; install check -> OSError/SubprocessError.
- executor: pre_/post_function and progress-polling hooks now use hasattr
  checks, and a real exception inside a defined hook is logged instead of
  swallowed; decode fallbacks and numeric parses narrowed.
- best-effort filesystem ops (makedirs/unlink) -> OSError.
- all backend check_is_installed probes -> OSError/SubprocessError.
- shutdown: also fixes a latent NameError ('failure' was only set in the
  except branch, so a successful logind PowerOff would crash the handler).

No bare 'except:' remain. Full suite (51 tests) green; GUI starts clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 01:02:33 -07:00
Luna
3d1ce504b9 Complete High-quality profile and add menus to split discs
High profile is now fully automatic instead of relying on the manual
"adjust disc usage" button:
- compute_high_profile_bitrate() (pure, unit-tested) picks the fewest discs
  that hold the content down to a quality floor, then fills each disc; a 2h
  movie lands on one filled disc (~3750k), a 4h movie on two, a 30min clip
  on one near the 9000k cap.
- apply_high_profile_bitrate() applies that rate to every title and forces
  2-pass; it runs before split planning so the existing splitter reuses it.

Split discs now get a per-disc menu (listing that disc's titles) when the
project has a menu enabled, honoring the startup/play-all settings; they
still auto-play when menus are off.

Fix: _adjust_audio_bitrate capped its table at 384 (an MP2 limit) and
silently clamped the High profile's 448k AC3 down to 384; extend the table
to AC3 rates (448/512/640) in both the ffmpeg and avconv backends.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 05:18:33 -07:00
Luna
7f574897c7 Fix progress reporting and desktop responsiveness during encode
The progress bar barely moved and the window showed "not responding"
during long encodes: ffmpeg's carriage-return stats line flushes rarely
over a pipe, and the transcode saturated the CPU.

- Drive progress from ffmpeg's structured `-progress pipe:1` output
  (`-stats_period 0.5 -nostats`) and parse out_time/progress in
  process_stdout, giving steady frequent updates (verified ~2/sec via the
  live executor pipe vs ~1 per whole encode before).
- Run the encoder under `nice -n 10` so the compositor keeps a CPU slice
  (avconv gets the nice prefix too).

Also round pad/crop targets to even dimensions and use positive crop
offsets, fixing an odd-height (e.g. 1079) MPEG-2 error surfaced when
burning in subtitles on a 1080p source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 04:31:05 -07:00
Luna
8b041f0725 Add DVD encode profiles and subtitle hardsub burn-in
Introduce three project-level DVD encode profiles (Compatibility 4500k /
High quality VBR / Custom) via new config keys, and burn a chosen
embedded subtitle track into the picture:

- file_movie carries the hardsub selection (index/kind), persists it, and
  builds a subtitle-picker combobox in its properties page; set_final_rates
  maps the profile to the final video/audio bitrate.
- ffmpeg burns text subs with the subtitles= filter after scaling and image
  subs with an overlay filtergraph before scaling; NTSC DVD audio is now AC3
  for all profiles. A start_offset (-ss) is threaded through for segmenting.
- avconv gets the text-sub path and start_offset for parity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 12:45:36 -07:00
Sergio Costas
18fa425dd9 Update the license comments 2025-08-29 18:26:12 +02:00
Sergio Costas
31a6da7f01 Migrate to pyproject.toml 2024-12-21 23:20:22 +01:00
Sergio Costas
668be31105 Better check 2024-08-13 23:23:27 +02:00
Sergio Costas
a959d120cc Remove FIFO filter
It has been removed from ffmpeg
2024-08-13 22:17:52 +02:00
Rastersoft
a84aea081b Fix error when duration is N/A 2023-12-17 20:28:25 +00:00
Sergio Costas
949684b55d Add support for rotated videos 2022-03-02 15:03:12 +00:00
Sergio Costas
6fb3a369cd general: added HEVC support 2019-10-15 00:26:37 +02:00
Sergio Costas
501e8aac48 general: removed the "or any later version" statement
After the events happened recently in the management of the FSF,
I decided that it is safer to not rely on the good faith of other
people, so I decided to allow distribution of Devede only under
the current GPLv3 license, and not allow other, still unknown,
future versions of the license.
2019-10-13 18:18:11 +02:00
Sergio Costas
f0893b3ff7 Now adjusts the audio bitrate to ensure that it is legal for MP2 2018-06-28 01:00:40 +02:00
Sergio Costas
5c6b98647b Added experimental support for 16:9 menues 2018-05-01 20:47:27 +02:00
Sergio Costas
0b677edd1c Removed minrate during second pass when using two-pass encoding because it fails with ffmpeg 2017-11-26 19:42:34 +01:00
Sergio Costas
2842a12644 Allows to translate and personalize the Play all text in the dvd menu 2017-01-29 21:35:33 +01:00
Sergio Costas
fdf7f148c1 Passed autopep8 2017-01-06 19:36:01 +01:00
Sergio Costas
27828d2dc5 Now uses the right minimum and maximum bitrate
Now sets the right file extension with Matroska and DivX files
2016-12-15 00:09:40 +01:00
Sergio Costas
50ee33b2c3 Fixed the AVConv code too
Fixed the code in ffmpeg
2016-10-18 00:45:37 +02:00
Sergio Costas
c970373da7 Fixed missed command for VCD 2016-10-16 21:56:03 +02:00
Sergio Costas
39b1687381 Fixed the problem fixed bitrate problem with FFMpeg and AVConv (thanks to Juniorsnet) 2016-10-16 21:40:19 +02:00
Sergio Costas
361240adc4 Fixed a float value used for volume where it expected an integer 2016-09-05 23:43:13 +02:00
Sergio Costas
15e237bab2 Now supports both old and new AVConv versions
Added unitary test to ensure that the version check of AVConv works fine
2015-08-30 01:09:18 +02:00
glenntanner3
72815ecbf2 Added audio bitrate check for mp2.Updated avconv scale options. 2015-07-03 09:02:46 -04:00
Sergio Costas
bc6fa87b3c Renamed module from devede to devedeng
Now it uses the 'locale' folder to create the locales list names.
2015-01-29 00:34:47 +01:00
Renamed from src/devede/avconv.py (Browse further)