Repository navigation
hitvid v1.1.1
Subject: feat: Enhance streaming playback, error handling, and quiet mode (v1.1.1)
This release introduces significant improvements to hitvid, focusing on more robust streaming playback, better error handling, and a refined user experience, especially when using the --quiet flag.
Key Changes & Improvements:
-
Dedicated FFmpeg Monitoring Subshell (
ffmpeg_monitor_subshell):- Old: FFmpeg progress monitoring and error logging were intertwined with the
extract_frames_daemonfunction, sometimes leading to cluttered output or less reliable error detection. - New: A new, dedicated
ffmpeg_monitor_subshellis introduced. This subshell runs in the background, specifically monitoring the FFmpeg process for health and logging any errors to a file. - Benefit: Decouples FFmpeg management from the main script flow, making the playback loop cleaner and more resilient. It also ensures FFmpeg errors are captured and reported even if the main script is busy rendering.
- Old: FFmpeg progress monitoring and error logging were intertwined with the
-
Improved
--quietMode Behavior:- Old: The
--quietflag suppressed some progress bars and interactive feedback, but not all, and some daemon messages could still appear. Interactive controls (like pause/seek) were also disabled in quiet mode. - New:
display_progress_barnow explicitly checks theQUIETflag, ensuring no progress bars are shown when quiet.render_chafa_daemonno longer prints verbose progress messages tostderrduring operation, respecting the quiet mode.- Crucially, interactive controls (Spacebar for pause/resume, arrow keys for seek/speed) now function even in
--quietmode. Only the visual feedback on the info line is suppressed. - The
qkey for quitting has been removed, standardizing onCtrl+Cfor exiting, which is universally handled by the improvedtrapmechanism.
- Benefit: Provides a truly "quiet" experience while retaining essential interactive control, offering a better user experience for those who prefer minimal output.
- Old: The
-
Enhanced Error Handling and Cleanup:
- Old: Cleanup was generally effective but could be improved, and
traphandling was less specific. - New:
- The
cleanupfunction now explicitly attempts to terminate the newFFMPEG_MONITOR_PIDin addition to FFmpeg and Chafa daemons. trapcommands are more specific (exit 130forINT/ Ctrl+C,exit 1forTERM/EXIT), providing clearer exit codes.- Warning messages during playback (e.g., "Frame missing") are now printed cleanly above the info line using
tput cupandtput el, preventing screen corruption.
- The
- Benefit: More robust and reliable termination of background processes, cleaner error reporting, and better overall script stability.
- Old: Cleanup was generally effective but could be improved, and
-
More Accurate Video Information Parsing:
- Old:
get_video_infosometimes struggled withN/Aor fractional duration/frame rate values fromffprobe, potentially leading to incorrectEXPECTED_TOTAL_FRAMES. - New: The logic for parsing
VIDEO_DURATION_FLOATandEXPECTED_TOTAL_FRAMEShas been refined to better handle variousffprobeoutputs (decimal, fractional, N/A), providing more accurate frame counts. - Benefit: Improves the reliability of frame extraction and playback duration, especially for videos with non-standard metadata.
- Old:
-
Streamlined Playback Initialization:
- Old: The
tput smcup; tput civis; clearcommands were executed early, potentially clearing initial FFmpeg loading messages in stream mode. - New: These screen manipulation commands are now executed after any initial loading messages (including the FFmpeg progress bar from the monitor subshell) have been displayed and cleared.
- Benefit: Ensures a smoother transition from loading to playback, preventing flicker or premature screen clearing.
- Old: The
This update significantly enhances hitvid's stability, user experience, and internal architecture, making it more reliable and pleasant to use.