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

encode ffmpeg file info output to binary #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Voyeur/converter.rb
Expand Up @@ -51,7 +51,7 @@ def call_external_converter
err = ''
out = ''
stderr.each("r") do |line|
err += line
err += line.force_encoding('BINARY')
if line =~ /time=(\d+:\d+:\d+.\d+)/
yield $1 if block_given?
end
Expand Down
2 changes: 1 addition & 1 deletion lib/Voyeur/media.rb
Expand Up @@ -11,7 +11,7 @@ def initialize(options)
def get_info
output = ''
status = Open4::popen4("ffmpeg -i #{@filename}") do |pid, stdin, stdout, stderr|
output = stderr.read.strip
output = stderr.read.strip.force_encoding('BINARY')
end
@raw_duration = $1 if output =~ /Duration: (\d+:\d+:\d+.\d+)/
end
Expand Down