kelredd-pruview 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kelredd-pruview might be problematic. Click here for more details.
- data/Rakefile +1 -1
- data/bin/ffyml +71 -0
- data/lib/pruview/version.rb +1 -1
- metadata +4 -3
data/Rakefile
CHANGED
@@ -16,7 +16,7 @@ spec = Gem::Specification.new do |s|
|
|
16
16
|
s.author = 'Kelly Redding'
|
17
17
|
s.email = 'kelly@kelredd.com'
|
18
18
|
s.homepage = 'http://github.com/kelredd/pruview'
|
19
|
-
s.files = %w(README.rdoc Rakefile) + Dir.glob("{features,lib,test}/**/*")
|
19
|
+
s.files = %w(README.rdoc Rakefile) + Dir.glob("{bin,features,lib,test}/**/*")
|
20
20
|
# s.executables = ['pruview']
|
21
21
|
|
22
22
|
s.add_dependency('mini_magick')
|
data/bin/ffyml
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
# script: ffyml
|
3
|
+
# version 2007.8.22 - bash
|
4
|
+
# description: run ffmpeg on a video file, capturing the video information from standard error,
|
5
|
+
# and parsing for various file properties, outputting them into a yml output file.
|
6
|
+
# This assumes ffmpeg is installed and is available in the PATH.
|
7
|
+
# output: the output file (specified in the second argument) will have a format similar to:
|
8
|
+
|
9
|
+
# ---------------------------
|
10
|
+
# # file_properties:
|
11
|
+
# format: <value>
|
12
|
+
# duration: <value>
|
13
|
+
# bitrate: <value> (in kb/s)
|
14
|
+
# codec: <value>
|
15
|
+
# width: <value>
|
16
|
+
# height: <value>
|
17
|
+
# framerate: <value> (in fps)
|
18
|
+
# audio_codec: <value>
|
19
|
+
# audio_bitrate: <value>
|
20
|
+
# audio_sampling: <value> (in Hz)
|
21
|
+
# ---------------------------
|
22
|
+
|
23
|
+
echo "Querying ffmpeg video information..."
|
24
|
+
|
25
|
+
# capture arguments
|
26
|
+
video_file=$1
|
27
|
+
output_file=$2
|
28
|
+
|
29
|
+
# constants
|
30
|
+
temp_out="/tmp/ffinfo.tmp"
|
31
|
+
|
32
|
+
# run ffmpeg in a known error state and capture it's file properties output from standard error
|
33
|
+
echo "ffmpeg -i $video_file 2> $temp_out"
|
34
|
+
ffmpeg -i "$video_file" 2> "$temp_out"
|
35
|
+
|
36
|
+
# parse temp_out for the file properties
|
37
|
+
# format
|
38
|
+
var_format=`cat $temp_out | grep "Input #0" | gawk -F', ' '{print $2}'`
|
39
|
+
var_duration=`cat $temp_out | grep "Duration:" | gawk -F': ' '{print $2}' | gawk -F', ' '{print $1}'`
|
40
|
+
var_bitrate=`cat $temp_out | grep "Duration:" | gawk -F': ' '{print $4}' | gawk -F' ' '{print $1}'`
|
41
|
+
var_codec=`cat $temp_out | grep "Video:" | gawk -F': ' '{print $3}' | gawk -F', ' '{print $1}'`
|
42
|
+
var_width=`cat $temp_out | grep "Video:" | gawk -F': ' '{print $3}' | gawk -F', ' '{print $3}' | gawk -F'x' '{print $1}'`
|
43
|
+
var_height=`cat $temp_out | grep "Video:" | gawk -F': ' '{print $3}' | gawk -F', ' '{print $3}' | gawk -F'x' '{print $2}' | gawk -F' ' '{print $1}'`
|
44
|
+
var_framerate=`cat $temp_out | grep "Video:" | gawk -F': ' '{print $3}' | gawk -F', ' '{print $5}' | gawk -F' ' '{print $1}'`
|
45
|
+
if [ "$var_framerate" = "" ]; then
|
46
|
+
var_framerate=`cat $temp_out | grep "Video:" | gawk -F': ' '{print $3}' | gawk -F', ' '{print $4}' | gawk -F' ' '{print $1}'`
|
47
|
+
fi
|
48
|
+
var_audio_codec=`cat $temp_out | grep "Audio:" | gawk -F': ' '{print $3}' | gawk -F', ' '{print $1}'`
|
49
|
+
var_audio_bitrate=`cat $temp_out | grep "Audio:" | gawk -F', ' '{print $5}' | gawk -F' ' '{print $1}'`
|
50
|
+
var_audio_sampling=`cat $temp_out | grep "Audio:" | gawk -F', ' '{print $2}' | gawk -F' ' '{print $1}'`
|
51
|
+
|
52
|
+
# write the output YAML file
|
53
|
+
echo "# file properties" > $output_file
|
54
|
+
echo format: $var_format >> $output_file
|
55
|
+
echo duration: $var_duration >> $output_file
|
56
|
+
echo bitrate: $var_bitrate >> $output_file
|
57
|
+
echo codec: $var_codec >> $output_file
|
58
|
+
echo width: $var_width >> $output_file
|
59
|
+
echo height: $var_height >> $output_file
|
60
|
+
echo framerate: $var_framerate >> $output_file
|
61
|
+
echo audio_codec: $var_audio_codec >> $output_file
|
62
|
+
echo audio_bitrate: $var_audio_bitrate >> $output_file
|
63
|
+
echo audio_sampling: $var_audio_sampling >> $output_file
|
64
|
+
|
65
|
+
# cleanup
|
66
|
+
rm $temp_out
|
67
|
+
|
68
|
+
echo "Done."
|
69
|
+
|
70
|
+
exit 0
|
71
|
+
|
data/lib/pruview/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 9
|
9
|
+
version: 0.1.9
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kelly Redding
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-09 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -52,6 +52,7 @@ extra_rdoc_files:
|
|
52
52
|
files:
|
53
53
|
- README.rdoc
|
54
54
|
- Rakefile
|
55
|
+
- bin/ffyml
|
55
56
|
- features/document.feature
|
56
57
|
- features/step_definitions/common_steps.rb
|
57
58
|
- features/step_definitions/document_steps.rb
|