Skip to content
Browse files

Add metadata sample

  • Loading branch information...
1 parent 4f6d9ac commit 83ba2ea77eb511f3e4ab0202ccf5477725cdc884 @drbrain committed
Showing with 22 additions and 0 deletions.
  1. +22 −0 sample/metadata.rb
View
22 sample/metadata.rb
@@ -0,0 +1,22 @@
+require 'ffmpeg'
+
+file = ARGV.shift
+file ||= File.expand_path '../../test/Thumbs Up!.3gp', __FILE__
+
+begin
+ input = FFMPEG::FormatContext.new file
+rescue FFMPEG::UnknownFormatError
+ puts "Unknown file format for #{File.basename file}"
+ exit
+end
+
+puts "#{File.basename file} metadata:"
+puts 'album: %p' % input.album
+puts 'author: %p' % input.author
+puts 'comment: %p' % input.comment
+puts 'copyright: %p' % input.copyright
+puts 'filename: %p' % input.filename
+puts 'genre: %p' % input.genre
+puts 'title: %p' % input.title
+puts
+

0 comments on commit 83ba2ea

Please sign in to comment.
Something went wrong with that request. Please try again.