Repository navigation
Fix stdout pipe deadlock in FFmpeg conversion - #732
Open
HapppppyMoon wants to merge 1 commit into
Open
HapppppyMoon wants to merge 1 commit into
HapppppyMoon wants to merge 1 commit into
Conversation
- ffmpeg was given -progress pipe:1 which writes progress data to stdout - stdout was redirected but never read, filling the pipe buffer - Once the buffer filled, ffmpeg blocked on write and hung indefinitely - Output files had no moov atom written, resulting in unplayable files - Progress parsing already works via stderr legacy format (size=... time=...) - previously: `-n -progress pipe:1` with `RedirectStandardOutput = true` - now: `-n` with `RedirectStandardOutput = false`
There was a problem hiding this comment.
Pull request overview
This PR addresses an FFmpeg conversion hang caused by redirecting stdout while emitting progress data to pipe:1 (stdout) without consuming it, leading to a blocked FFmpeg process once the stdout pipe buffer fills.
Changes:
- Removed
-progress pipe:1from FFmpeg base arguments. - Disabled
RedirectStandardOutputfor the FFmpeg process since stdout is not read. - Kept progress tracking via existing stderr parsing (
size=... time=... bitrate=...format).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
UCHIHAHA103
pushed a commit
to UCHIHAHA103/FileConverter
that referenced
this pull request
Apr 26, 2026
Language fix (upstream Tichau#593 Tichau#606 Tichau#609 Tichau#646 Tichau#667 Tichau#673 Tichau#690 Tichau#692 Tichau#735 Tichau#737 Tichau#750): - Helpers.GetSupportedCultures now probes both the legacy Languages\<culture>\ folder and the standard .NET satellite path <exe>\<culture>\, so language detection no longer silently breaks when the robocopy post-build step fails. - Replace the fragile robocopy /MOVE post-build step with a plain copy so the default .NET layout is preserved alongside the Languages\ layout. - Guard Settings.ApplicationLanguage setter + SettingsViewModel Save/Close with try/catch so a culture apply failure no longer silently closes the Settings window without persisting changes. FFmpeg fix (upstream Tichau#749 Tichau#740 Tichau#739 Tichau#716 Tichau#703 Tichau#700, cherry-picked from PR Tichau#732 by HapppppyMoon): - Remove -progress pipe:1 and disable RedirectStandardOutput, which were filling the unread stdout pipe buffer and deadlocking ffmpeg in v2.2. - Progress parsing still works via the legacy stderr size=... time=... format.
UCHIHAHA103
added a commit
to UCHIHAHA103/FileConverter
that referenced
this pull request
May 21, 2026
…deadlock, UpgradeService null, GPU auto-retry, zh-CN translation
AlexAn75541
added a commit
to AlexAn75541/FileConverter
that referenced
this pull request
Oct 21, 2026
…kflow - Fix FFmpeg stdout pipe deadlock hanging conversions (PR Tichau#732) - Bundle NetOffice DLLs in WiX installer to prevent clean-install crash (PR Tichau#779) - Fix Word/PowerPoint SaveAs automation for modern M365 DISP_E_TYPEMISMATCH (PR Tichau#779) - Fix ImageMagick Ghostscript page count probe crash (PR Tichau#806) - Preserve SVG transparency and add ICO bgra pixel format (PR Tichau#808) - Enhance shell extension fallback paths against missing registry keys (PR Tichau#804) - Add SettingsViewModel guards against root folder removal and null handlers - Add GitHub Actions CI workflow to build MSI and upload artifacts - Add BRANCHES.md and AGENTS.md documentation
neosmith20
referenced
this pull request
in neosmith20/FileRecast
Nov 27, 2026
… fixes Conversions (ffmpeg) - Fix conversions stuck forever: stdout (-progress) and stderr are now both read asynchronously, so ffmpeg can never block on a full pipe (upstream #749 #780 #800, PR #809 #732). - Watchdog kills a frozen ffmpeg; cancel kills ffmpeg immediately. - Progress parsed from -progress output (works when the bitrate is unknown). - Failures detected from the exit code instead of "Error" substrings in the log. - MP4 drops subtitles it can't store, MKV keeps them; audio from video uses -vn. GPU encoding - H.264 / H.265 / AV1 codec choice for MP4 and MKV. - NVIDIA NVENC, AMD AMF and new Intel Quick Sync encoders for the three codecs. - New Automatic mode (probes which GPU encoder works) and automatic CPU fallback when GPU encoding fails (upstream PR #702). - Filters run on the CPU, so rotate/scale presets work with every GPU mode. Upstream PRs/issues merged or reimplemented - Animated WebP (#804), BMP/TIFF outputs (#775), ALAC (#562), AMR input (#811), progressive JPEG (#814), Markdown to PDF/DOCX via Word (#802), multipage TIFF (#812), SVG transparency (#808), PDF rangecheck crash (#806), path template tokens (#797/#813), Office conversions broken in 2.2 (#778 #779), context menu disappearing (#798). - Translations: Catalan (#707), Khmer (#761, junk text removed), Italian (#712, XML fixed), Chinese (#698 #763). Translations were not loaded at all (#787): fixed the post-build step that shipped empty satellite assemblies and added the probing path. Urdu file renamed so it loads. Other fixes - Never delete/move the input file when no output was generated; restore the _TEMP renamed input on failure. - Office: no dialogs, COM objects released, ExportAsFixedFormat fallback to SaveAs. - Atomic settings save; explorer extension reloads presets when they change. - Installer: NetOffice and Markdig libraries; unsigned builds when Installer.sign is absent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LMhX9UyqkxoopVuSF4tg9g
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a critical bug where FFmpeg conversions hang indefinitely due to a stdout pipe deadlock. The
-progress pipe:1flag writes progress data to stdout, but the application only reads stderr — causing the pipe buffer to fill and FFmpeg to block on write.Key changes
-progress pipe:1from FFmpeg base argumentsRedirectStandardOutputsince stdout is never consumedRoot cause
baseArgs(line 91)"-n -progress pipe:1""-n"RedirectStandardOutput(line 82)truefalse-progress pipe:1sends structured progress to stdout, butConvert()only readsStandardError. Once the stdout pipe buffer fills (~4-64KB), FFmpeg blocks on write → process hangs → output file never finalized (no moov atom for MP4) → unplayable file.Impact
ParseFFMPEGOutputalready parses stderr progress (size=... time=... bitrate=...)Testing
StandardOutputin the conversion pipelineConversionJob_FFMPEG.cs(2 lines changed)