diff --git a/DEVELOPMENT_PLAN.md b/DEVELOPMENT_PLAN.md index d337f9a..957411b 100644 --- a/DEVELOPMENT_PLAN.md +++ b/DEVELOPMENT_PLAN.md @@ -79,7 +79,7 @@ Based on the "DaVinci Resolve 18 Supported Codec List.pdf" and web search result 5. **`ffmpeg` Execution:** Use `subprocess.run()` to execute the `ffmpeg` command, capturing stdout/stderr for logging. 6. **Error Handling:** Add `try-except` blocks for file operations, `subprocess` calls, and `ffprobe` parsing. 7. **Basic Testing:** Test with a few sample video files (e.g., H.264/AAC MP4) to ensure conversion to DNxHR/PCM MOV works. -8. **Packaging and Bundling:** Use PyInstaller (or similar) to create standalone executables for target operating systems. This step will involve bundling the Python script, its dependencies, and the `ffmpeg`/`ffprobe` binaries. Note that packaging will be OS-specific (e.g., a Linux executable must be built on Linux). +8. **Packaging and Bundling:** (Completed) Used PyInstaller to create a standalone executable, bundling `ffmpeg` and `ffprobe` binaries. This involved switching from `ffmpeg-python` to direct `subprocess` calls to resolve bundling issues. The executable is now functional. 9. **Error Handling for Bundled Tools:** Implement checks to ensure bundled `ffmpeg`/`ffprobe` are accessible and provide clear error messages if not. ## 6. Directory and File Structure diff --git a/src/utils.py b/src/utils.py index 6d9f99b..d5dda81 100644 --- a/src/utils.py +++ b/src/utils.py @@ -3,10 +3,11 @@ import json import subprocess import sys +from src import config # Import config module + def get_video_info(file_path): - """Uses ffprobe to get detailed information about a video file.""" command = [ - 'ffprobe', + config.FFPROBE_PATH, '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=codec_name,width,height,avg_frame_rate,duration_ts,bit_rate,pix_fmt', @@ -33,10 +34,10 @@ def get_video_info(file_path): def get_audio_info(file_path): """Uses ffprobe to get detailed information about an audio stream in a video file.""" command = [ - 'ffprobe', + config.FFPROBE_PATH, '-v', 'error', - '-select_streams', 'v:0', - '-show_entries', 'stream=codec_name,width,height,avg_frame_rate,duration_ts,bit_rate,pix_fmt', + '-select_streams', 'a:0', + '-show_entries', 'stream=codec_name,sample_rate,channels,bit_rate', '-of', 'json', file_path ] diff --git a/video-converter.spec b/video-converter.spec index 00a342a..75d316d 100644 --- a/video-converter.spec +++ b/video-converter.spec @@ -6,12 +6,11 @@ a = Analysis(['src/main.py'], pathex=['/home/joe/Cloud9/Documents/Obisdian/projects/Video Converter'], binaries=[('/usr/bin/ffmpeg', '.'), ('/usr/bin/ffprobe', '.')], datas=[], - hiddenimports=['ffmpeg.nodes', 'ffmpeg._utils', 'ffmpeg._run'], + hiddenimports=[], hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], - collect_submodules=['ffmpeg'], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher,