From 897d73ede90fa3947ea08fd3345d91d2d163692b Mon Sep 17 00:00:00 2001 From: bajankristof Date: Wed, 1 Apr 2026 12:32:25 +0200 Subject: [PATCH 1/2] fix: correctly detect old-style MOV files (no ftyp box) --- lib/ffmpeg/media.rb | 10 +++++----- spec/ffmpeg/media_spec.rb | 10 ++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/ffmpeg/media.rb b/lib/ffmpeg/media.rb index b6007b6..2ee8bfe 100644 --- a/lib/ffmpeg/media.rb +++ b/lib/ffmpeg/media.rb @@ -83,11 +83,11 @@ def initialize(message, output) when /\basf_o\b/ then '.asf' when /\b(mov|mp4)\b/ case major_brand - when /\Aqt\b/i then '.mov' - when /\Am4a\b/i then '.m4a' - when /\Am4v\b/i then '.m4v' - when /\Am4s\b/i then '.m4s' - else '.mp4' + when nil, /\Aqt\b/i then '.mov' + when /\Am4a\b/i then '.m4a' + when /\Am4v\b/i then '.m4v' + when /\Am4s\b/i then '.m4s' + else '.mp4' end when /\bmatroska\b/ if streams diff --git a/spec/ffmpeg/media_spec.rb b/spec/ffmpeg/media_spec.rb index dc97229..72dab29 100644 --- a/spec/ffmpeg/media_spec.rb +++ b/spec/ffmpeg/media_spec.rb @@ -609,6 +609,16 @@ module FFMPEG end end + context 'when the media is an old-style QuickTime MOV without an ftyp box' do + let(:path) { fixture_media_file('rotated@0.mov') } + + before { allow(subject).to receive(:major_brand).and_return(nil) } + + it 'returns .mov' do + expect(subject.extname).to eq('.mov') + end + end + context 'when the media is a WAV' do let(:path) { fixture_media_file('hello.wav') } From 8cc90a9bfe79a8c27b9bd5683f9fd4b124c95deb Mon Sep 17 00:00:00 2001 From: bajankristof Date: Wed, 1 Apr 2026 12:33:52 +0200 Subject: [PATCH 2/2] chore: update version to 8.4.2 and document changes --- CHANGELOG | 5 +++++ lib/ffmpeg/version.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index b0e9e13..4f228f5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ +== 8.4.2 2026-04-01 + +Fixes: +* Correctly detect the file extension for old-style MOV files (no ftyp box). + == 8.4.1 2026-04-01 Fixes: diff --git a/lib/ffmpeg/version.rb b/lib/ffmpeg/version.rb index fe0c61e..1244a32 100644 --- a/lib/ffmpeg/version.rb +++ b/lib/ffmpeg/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module FFMPEG - VERSION = '8.4.1' + VERSION = '8.4.2' end