自分で作っちゃおうかしらん。
グリースモンキーって奴で簡単にできそうだど。
調べると勝手に自分のIDに置き替えるjsが配布されていたらしいことがわかる。 そのページに行ってみたらforbiddenになっていたwwwww。 おい、見せろや。そういうことが出来るなら、俺の欲しいのは殆ど出来たも同然なの に。
http://diveintogreasemonkey.org/
http://diveintogreasemonkey.org/patterns/rewrite-link.html
http://diveintogreasemonkey.org/download/stopthepresses.user.js
:-)
// Use amazon freely!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // version 0.1 // 2007-11-25 // Copyright (c) 2007, iws@iws.dyndns.org // Released under the GPL license version 3 // http://www.gnu.org/copyleft/gpl3.html // // -------------------------------------------------------------------- // // This is a Greasemonkey user script. To install it, you need // Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/ // Then restart Firefox and revisit this script. // Under Tools, there will be a new menu item to "Install User Script". // Accept the default configuration and install. // // To uninstall, go to Tools/Manage User Scripts, // select "Stop The Presses!", and click Uninstall. // // -------------------------------------------------------------------- // // ==UserScript== // @name free_amazon // @namespace ??? // @description make links to amazon more simple // @include * // ==/UserScript== var pageAddr, links, a, href; pageAddr = window.location.href; links = document.evaluate( "//a[@href]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < links.snapshotLength; i++) { a = links.snapshotItem(i); href = a.href; // amazon.co.jp if ((href.match(/\/\/www\.amazon\.co\.jp\//i)) & href.match(/nosim=/i)) { // ここから先が問題 } }今日はここまで。
これでビデオから音声トラックをmp3に落したり、theora oggで保存録画したり、 かなり便利ツールになった。
#!/usr/bin/python
# -*-mode:python-*-
import os, re, sys
# configuration variables
command = 'ffmpeg -i %(fin)s %(args)s -vsync 2 -async 2 %(fout)s'
kinds = {'iPod high rate':('-s 320x240 -b 700k', 'mp4'),
'iPod long video':('-s 320x240 -b 400k -ab 64k -r 18', 'mp4'),
# 'iPod h264':('-s 320x240 -b 660k -vcodec libx264 -ab 100k -acodec libfaac', 'mp4'),
'audio only(mp3)':('-vn -ab 128k', 'mp3'),
'audio voribs ogg':('-vn -ab 128k -acodec libvorbis', 'ogg'),
'VGA theora ogg':('-s 640x480 -b 1600k -vcodec libtheora -acodec libvorbis', 'ogg')}
debug = False
# '(ipod mp3)':('-s 320x240 -b 700k -vcodec mpeg4 -acodec libmp3lame', 'mp3'),
# '(ipod aac)':('-s 320x240 -b 660k -vcodec libx264 -acodec libfaac', 'm4v'),
log = []
total = len(sys.argv)
count = 0
if total > 1:
progress = os.popen('echo -n "%s" | zenity --list --column=2 --checklist --column="ffmpeg setting"' % ('\n'+('\n\n'.join(kinds.keys())) + '\n'))
kind = progress.read().split('\n')[0]
if not kind:
print "No format selected"
sys.exit(0)
try:
for f in sys.argv[1:]:
args = kinds[kind][0]
suffix = kinds[kind][1]
fin = os.path.abspath(f)
fout = ''
count += 1
if not os.path.splitext(fin)[1] in ['.avi', '.divx', '.flv', '.mpeg', '.mpg', '.ogg', '.VOD', '.wmv']:
os.popen('zenity --error --text="%s can not be converted"' % fin)
continue
basename = re.sub(r'(.+)\.(avi|divx|flv|mpeg|mpg|ogg|VOD|wmv)$', '\\1', fin)
basename = re.sub('[:|()&# !]+', '_', basename)
if basename + '.' + suffix == fin:
basename += '-resized'
for number in ['', '-01', '-02', '-03', '-04', '-05']:
fout = basename + number + '.' + suffix
# os.popen('zenity --error --text="%s"' % fout)
if fout == fin:
continue
if not os.path.exists(fout):
break
pass
else:
progress = os.popen('zenity --error --text="filename for converted is used %s"' % fout)
continue
dic = {'num':count,
'fin':re.sub('([&;() ])', r'\\\1', fin),
'fout':fout,
'_fin':os.path.basename(fin),
'_fout':os.path.basename(fout),
'suffix':suffix,
'args':args}
if total == 2:
message = "Generating %(_fout)s from %(_fin)s ..." % dic
elif count == 2:
message = "Generating 2nd file: %(_fout)s from %(_fin)s ..." % dic
else:
message = "Generating %(num)dth file: %(_fout)s from %(_fin)s ..." % dic
pass
progress = os.popen('zenity --progress --text="%s" --auto-close' % message, 'w', 0)
if debug:
print command % dic
else:
os.system(command % dic)
progress.write("%d\n" % (100.0*count/total))
pass
pass
except Exception, e:
progress = os.popen('zenity --info --text="Error %s"' % e, 'w', 0)
pass
pass
else:
print "Please call this script inside nautilus"
sys.exit(0)
#!/usr/bin/python
import os, re, sys
# configuration variables
ffmpeg = 'ffmpeg -i %s -b 640k -s 320x240 -vsync 2 -async 2 %s'
log = []
total = len(sys.argv)
count = 0
if total > 1:
try:
for f in sys.argv[1:]:
fin = os.path.abspath(f)
fout = ''
count += 1
if not os.path.splitext(fin)[1] in ['.avi', '.dvix', '.flv', '.mpeg', '.mpg', '.ogg', '.VOD', '.wmv']:
os.popen('zenity --error --text="%s can not be converted"' % fin)
continue
basename = re.sub(r'(.+)\.(avi|dvix|flv|mpeg|mpg|ogg|VOD|wmv)$', '\\1', fin)
basename = re.sub('[|()#& !]+', '_', basename)
if basename + '.mp4' == fin:
basename += '-resized'
for suffix in ['', '-01', '-02', '-03', '-04', '-05']:
fout = basename + suffix + '.mp4'
# os.popen('zenity --error --text="%s"' % fout)
if fout == fin:
continue
if not os.path.exists(fout):
break
pass
else:
os.popen('zenity --error --text="filename for converted is used %s"' % fout)
continue
progress = os.popen('zenity --progress --text="Generating %d-th mp4 %s from %s ..." --auto-close' % (total - 1, os.path.basename(fout), os.path.basename(fin)), 'w', 0)
os.system(ffmpeg % (fin, fout))
progress.write("%d\n" % (100.0*count/total))
pass
pass
except Except, e:
progress = os.popen('zenity --info --text="Error %d"' % e, 'w', 0)
pass
pass
else:
print "Please call this script inside nautilus"
sys.exit(0)
#!/usr/bin/python
import os,re,string,sys
# configuration variables
ffmpeg = 'ffmpeg -i %s -b 600k -s 320x240 -vsync 2 -async 2 %s'
log = []
total = len(sys.argv)
count = 0
if total > 1:
progress = os.popen('zenity --progress --text="Generating %d mp4..." --auto-close' % (total - 1), 'w', 0)
try:
for f in sys.argv[1:]:
fin = os.path.abspath(f)
count += 1
fout = re.sub(r'(.+)\.(ogg|VOD|mpg|flv)$', '\\1.mp4', fin)
if fout == fin:
continue
#print ffmpeg % (fin, fout)
os.system(ffmpeg % (fin, fout))
progress.write("%d\n" % (100.0*count/total))
pass
pass
except Except, e:
progress = os.popen('zenity --info --text="Error %d"' % e, 'w', 0)
pass
pass
else:
print "Please call this script inside nautilus"
sys.exit(0)
ffmpegのマニュアルで調べて
-vysncというのを使えばいいようだ。
他にも関連しそうなのがあって、どれが正解かわからないので、こういうふうに
ffmpeg -i p*-f*-s*-[b*].ogg -b 400k -vsync 2 -copyts-async -async 2 P*-B*.mp4いろいろ付けてやったらずれなくなった。やったね。
-vsyncの引数が
本当はよくわからないんだよなぁ。

