log any ffmpeg/mkvmerge errors

This commit is contained in:
r888888888 2014-10-28 13:38:47 -07:00
parent e4562d209b
commit 38d48081a0
2 changed files with 19 additions and 5 deletions

View File

@ -38,10 +38,21 @@ class PixivUgoiraConverter
end
ext = folder.first.name.match(/\.(\w{,4})$/)[1]
# system("ffmpeg -loglevel quiet -i #{tmpdir}/images/%06d.#{ext} -codec:v libvpx -crf 4 -b:v 5000k -an #{tmpdir}/tmp.webm")
# system("mkvmerge -q -o #{write_path} --webm --timecodes 0:#{tmpdir}/timecodes.tc #{tmpdir}/tmp.webm")
system("ffmpeg -i #{tmpdir}/images/%06d.#{ext} -codec:v libvpx -crf 4 -b:v 5000k -an #{tmpdir}/tmp.webm")
system("mkvmerge -o #{write_path} --webm --timecodes 0:#{tmpdir}/timecodes.tc #{tmpdir}/tmp.webm")
ffmpeg_out, status_ = Open3.capture2e("ffmpeg -i #{tmpdir}/images/%06d.#{ext} -codec:v libvpx -crf 4 -b:v 5000k -an #{tmpdir}/tmp.webm")
mkvmerge_out, status = Open3.capture2e("mkvmerge -o #{write_path} --webm --timecodes 0:#{tmpdir}/timecodes.tc #{tmpdir}/tmp.webm")
if !status.success?
Rails.logger.error "[write_webm] ******************************"
Rails.logger.error "[write_webm] failed write_path=#{write_path}"
Rails.logger.error "[write_webm] ffmepg output:"
ffmpeg_out.split(/\n/).each do |line|
Rails.logger.error "[write_webm][ffmpeg] #{line}"
end
Rails.logger.error "[write_webm] mkvmerge output:"
mkvmerge_out.split(/\n/).each do |line|
Rails.logger.error "[write_webm][mkvmerge] #{line}"
end
end
end
end

View File

@ -2368,7 +2368,8 @@ CREATE TABLE pixiv_ugoira_frame_data (
id integer NOT NULL,
post_id integer,
data text NOT NULL,
content_type character varying(255) NOT NULL
content_type character varying(255) NOT NULL,
console_log text
);
@ -7112,3 +7113,5 @@ INSERT INTO schema_migrations (version) VALUES ('20141009231234');
INSERT INTO schema_migrations (version) VALUES ('20141017231608');
INSERT INTO schema_migrations (version) VALUES ('20141028202032');