Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: MOV files processed in iMovie should not be marked as audio with attached picture #6

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/ci.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ jobs:
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3']
ffmpeg-version: ['6.0.1', '5.1.1', '4.4.1']
ffmpeg-version: ['7.0.2', '6.0.1', '5.1.1', '4.4.1']

include:
- ffmpeg-version: '7.0.2'
download-path: 'releases'
version-name: 'release'

steps:
- uses: actions/checkout@v4
Expand All @@ -30,11 +35,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y wget
wget https://johnvansickle.com/ffmpeg/old-releases/ffmpeg-${{ matrix.ffmpeg-version }}-amd64-static.tar.xz
tar -xf ffmpeg-${{ matrix.ffmpeg-version }}-amd64-static.tar.xz
wget https://johnvansickle.com/ffmpeg/${{ matrix.download-path || 'old-releases' }}/ffmpeg-${{ matrix.version-name || matrix.ffmpeg-version }}-amd64-static.tar.xz
tar -xf ffmpeg-${{ matrix.version-name || matrix.ffmpeg-version }}-amd64-static.tar.xz
sudo mv ffmpeg-${{ matrix.ffmpeg-version }}-amd64-static/ffmpeg /usr/local/bin/ffmpeg
sudo mv ffmpeg-${{ matrix.ffmpeg-version }}-amd64-static/ffprobe /usr/local/bin/ffprobe
rm -rf ffmpeg-${{ matrix.ffmpeg-version }}-amd64-static.tar.xz ffmpeg-${{ matrix.ffmpeg-version }}-amd64-static
rm -rf ffmpeg-${{ matrix.version-name || matrix.ffmpeg-version }}-amd64-static.tar.xz ffmpeg-${{ matrix.ffmpeg-version }}-amd64-static

- name: Run RSpec
run: bundle exec rspec
8 changes: 7 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
== 6.1.1 2024-11-04

Fixes:
* MOV files processed in iMovie should not be marked as audio with attached picture

== 6.1.0 2024-10-24

* Added new `default?` and `attached_pic?` helper methods to FFMPEG::Stream objects
* Added new `audio_with_attached_pic?` helper method to FFMPEG::Media objects

== 6.0.2 2024-06-19
== 6.0.3 2024-06-19

Fixes:
* Fixed a possible race condition that would cause the transcoder to time out even if the transcoder was still running
Expand Down
1 change: 1 addition & 0 deletions ffmpeg.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Gem::Specification.new do |s|

s.add_dependency('multi_json', '~> 1.8')

s.add_development_dependency('debug')
s.add_development_dependency('rake', '~> 13.2')
s.add_development_dependency('rspec', '~> 3.13')
s.add_development_dependency('rubocop', '~> 1.63')
Expand Down
2 changes: 1 addition & 1 deletion lib/ffmpeg/media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def audio_only?
end

def audio_with_attached_pic?
audio? && streams.any?(&:attached_pic?)
audio? && video? && streams.select(&:video?).all?(&:attached_pic?)
end

def silent?
Expand Down
2 changes: 1 addition & 1 deletion lib/ffmpeg/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module FFMPEG
VERSION = '6.1.0'
VERSION = '6.1.1'
end
5 changes: 5 additions & 0 deletions spec/ffmpeg/media_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ module FFMPEG
subject = described_class.new("#{fixture_path}/sounds/hello.wav")
expect(subject.audio_with_attached_pic?).to be(false)
end

it 'should return false if the media has both attached pictures and normal video streams' do
subject = described_class.new("#{fixture_path}/movies/attached_pic.mov")
expect(subject.audio_with_attached_pic?).to be(false)
end
end

%i[
Expand Down
Binary file added spec/fixtures/movies/attached_pic.mov
Binary file not shown.
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'bundler'
Bundler.require

require 'debug'
require 'fileutils'
require 'webmock/rspec'
require 'webrick'
Expand Down