Commit graph

100 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
8cb6e1aa52 Surface the real failure cause in the error dialog (roadmap A3)
On failure the error window showed a generic message with the whole log
buried in an expander. Lead instead with a focused summary: which step
failed (the process label), its command, and the last stderr lines, while
keeping the full log below. The runner passes the failing process to
error_window, which reads the executor's bounded stderr_data.

build_summary/_stderr_tail are static and unit-tested (tests/
test_error_summary.py): tail extraction, CR handling, blank-line skipping,
stdout fallback, long-line truncation, and Pango-markup escaping of paths/
messages containing & < ' so set_markup can't choke.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 12:22:55 -07:00
Luna
46c6d162a0 Harden subprocess I/O against pipe-backpressure deadlock (roadmap A2)
The executor drained child stdout/stderr via GLib.IOChannel watches on the
main loop, so a stalled or wedged GUI stopped draining the pipes and the
child would block on a full (~64KB) pipe forever — the cascade that froze a
batch when the editor/terminal died.

Replace the main-loop watches with per-stream background reader threads that
drain pipes with blocking reads into thread-safe buffers; a GLib timer on the
main thread consumes the buffers and does all parsing/UI (threads never touch
GObject/GTK). Now the child can never block on a pipe we own, regardless of
main-loop state. Also: stdout can go straight to a file when requested, stdin
is fed from a file in a thread, the retained end-of-job log is bounded, and
wait_end is guarded to run once.

Tests (tests/test_executor_io.py): line parsing incl. CR progress lines,
2MB output with no loss/deadlock, completion with the main loop never running
(the wedged-GUI case), cancel, stdout-to-file, and exit-code propagation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:52:09 -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
480ec59ba4 Read ffmpeg progress from a file, not a pipe, to avoid deadlock
Driving -progress over pipe:1 made ffmpeg block on the progress write
whenever the GUI stopped draining the pipe (e.g. the parent terminal or
the app's event loop wedging), deadlocking every running encode.

Write -progress to a temp file instead: a file write never blocks, so the
encoder runs to completion regardless of GUI state. The executor calls
optional start_/stop_progress_polling hooks; ffmpeg polls the file on a
500ms GLib timer and removes it when done. Verified an encode completes
with no reader at all (previously a hard deadlock).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 04:39:20 -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
6cddd72792 Default to all-but-one core for encoding
Using every core for a parallel batch starves the compositor and makes
the GUI show "not responding". Default multicore to cores-1 so the
desktop keeps headroom; the user can still raise it in Preferences.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 04:30:37 -07:00
Luna
4f1ecb55ee Split over-long DVD projects across multiple discs
When a DVD project does not fit one disc at the chosen quality, offer to
split it into several full-quality discs instead of only degrading the
bitrate:

- A pure, unit-tested planner distributes whole titles across discs and
  time-splits a single over-long movie at the chapter boundary nearest each
  disc's capacity (even-time fallback when it has no chapters).
- on_create_disc_clicked asks split / reduce-bitrate / cancel, then authors
  each disc into its own subfolder and emits name-discN.iso per disc.
- dvdauthor_converter takes per-title segment lengths so a split segment's
  chapter markers stay inside the segment.

Also adds the project-level encode-profile selector (with custom-bitrate
fields) next to the disc-size control.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 12:52:50 -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
Luna
a158119d41 Detect embedded subtitle tracks in analyzers
Add a subtitle branch to the ffprobe/avprobe stream loops that collects
each embedded subtitle track (index, codec, language, title, default/
forced flags) and classifies it as text or image by codec. This is the
basis for letting the user pick a track to burn into the picture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 00:39:13 -07:00
Sergio Costas
739beb853c Fix Fedora
Fedora doesn't support importlib_metadata; instead it uses
importlib.metadata. Since it works in everything else, the
change is sensible.
2026-02-19 19:45:53 +01:00
Sergio Costas
27e4ff04eb Remove pkg-config
pkg-config has been removed, so importlib.metadata should be used
instead.
2026-02-15 20:05:31 +01:00
Sergio Costas
18fa425dd9 Update the license comments 2025-08-29 18:26:12 +02:00
Sergio Costas
9bd6d94c6c Change to menu defaults if files not found on open
When opening an old devede project, if the background picture or
music files aren't there, an exception would happen. This can
happen even with the defaults, because in the last version, they
were migrated into a different folder.

Now, if the files aren't found, the new defaults will be used.
2025-02-08 19:57:43 +01:00
AsciiWolf
0be36de127 Add developer tag to AppStream metadata
To make the metadata compatible with future AppStream standard version
2025-01-25 11:10:08 +00:00
Sergio Costas
13a38f5e76 Fixed translations 2025-01-18 21:35:43 +01:00
Sergio Costas
887e0b17c0 Trying to fix the translations 2025-01-18 21:04:40 +01:00
Sergio Costas
eebf4b5370 Use regexp to detect version number 2025-01-18 20:41:52 +01:00
Sergio Costas
f92e52a4af Ensure translations are included in .deb
Also fix debug and required programs dialogs, ensuring that all
the text is shown.
2025-01-05 15:09:53 +01: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
cf386691b0 Fixed non translated string 2022-11-17 14:11:09 +01:00
Sergio Costas
949684b55d Add support for rotated videos 2022-03-02 15:03:12 +00:00
CoopCoding
b4c198b0ef Refactored getting cores count to be work cross platform. 2021-06-25 12:35:09 +10: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
0cdb5934a5 Now uses the menu title as the volume name
This patch uses the menu title as the volume name for the DVD image.
This way, when mounted in a computer, instead of "DVDVIDEO", the user
will see the menu title (unless there is no menu title; in that case,
"DVDVIDEO" will be used).
2019-07-21 18:33:02 +02:00
Geoff Beier
8eb2d5cf95 use store_element() and restore_element() in on_button_accept_clicked
In file_movie.on_button_accept_clicked() file_movie.store_file() and
restore_file() are called. These methods don't exist; it looks like the
intent was to call store_element() and restore_element().

Testing confirms this; properties are now applied to all the selected
files.

Fixes Issue #79
2019-07-20 22:26:21 -04:00
Sergio Costas
a22a0a3c60 fix code style 2019-02-04 23:14:00 +01:00
Sergio Costas
b46d897e4d Move the configuration into XDG_CONFIG_HOME
This patch stores the configuration data inside XDG_CONFIG_HOME instead
of doing it directly inside $HOME. Of course, it has backwards
compatibility, using the old file if the new doesn't exists.
2019-02-04 23:12:39 +01:00
Sergio Costas
5e64ed7693 Removed unused line 2019-01-06 19:14:59 +01:00
Sergio Costas
0162267bfa Ensure that all entries are shown in the menu
There were two errors in the menu generation:

- if there were no page jumps, the number of pages was always "one"
- in each page, one entry was missing (except for the first page,
where two entries were missing).

This patch fixes both
2019-01-06 19:08:54 +01:00
Sergio Costas
0c52e14115 Keep backwards compatibility with old files
Due to an error, old devede files can't be opened with this version.
This patch fixes it.
2019-01-06 19:08:13 +01:00
Sergio Costas
f2301c7b19 Now the separator type is consistent from the begining
Due to an error, by default the separators where created as
"page jump" type, but it wasn't honored unless the checkbox was ticked
and unticked again.
2019-01-06 19:06:59 +01:00
Sergio Costas
f8227c1be8 removed unused prints 2019-01-04 12:41:02 +01:00
Sergio Costas
6d1b166f2d Added support for page blocks in menues
Now allows to add separators in the menu that forces a page jump,
allowing to group videos in pages.
2019-01-04 12:37:04 +01:00
Sergio Costas
c222c4ab14 Allow to add separator
Until now, all the menu entries were shown in a continuous list, one
after another. This patch allows to add separators between entries.
2019-01-03 23:18:59 +01:00
Sergio Costas
8719778d22 Add projects to Recent files in GTK
Now, when a Devede project is opened or saved, it is added to the list
of Recent files, thus being shown there when choosing to open a project.
2019-01-02 23:25:45 +01:00
Sergio Costas
3a532f504a Replace EVAL and EXEC
In the old code, eval() and exec() were used to insert properties in
an object with an specific name. This is clearly an ugly solution,
when the right way is to use self.__setattr__ and self.__dict__.

This patch replaces that ugly code with new one that follows the
pythonic way of doing the things.
2019-01-02 22:47:09 +01: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
e70bca519b Added support for xfburn 2018-05-01 18:57:46 +02:00
Sergio Costas
8a68f263c3 Fixed the audio duration in the menu.
If a custom audio is used in the DVD menu, it will last the duration of the custom audio, not only 30 seconds.
2018-04-29 16:09:54 +02:00
Sergio Costas
6b3b7ccf81 Added extra checks for odd aspect ratios 2018-03-24 13:54:27 +01:00
Sergio Costas
8dfa31ea25 Added check to avoid division by zero when the aspect ratio is zero 2018-02-04 18:23:41 +01:00
Sergio Costas
98ddf8d04c Now sets transient for settings window 2017-12-03 11:50:09 +01: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
46da595b05 Fixed bug when there is no cd burner installed 2017-07-10 22:38:19 +02:00