.O.
..O
OOO


About

自転車(ロードレーサー見る話/乗る話。ママチャリやMTBの話はありません), CG(Mayaやgimpを使用)、読書などに関するweblogです。


Calendar

< November 2007 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
252627282930 


Category

[site map]
/ (1828)
  CG/ (35)
    Maya/ (79)
    artist/ (2)
    gimp/ (7)
    practice/ (24)
      2003/ (23)
      2004/ (101)
      2005/ (106)
      2006/ (42)
      2007/ (66)
  SF/ (29)
  bicycle/ (102)
    2003/ (76)
    2004/ (199)
    2005/ (148)
    2006/ (184)
    2007/ (133)
  book/ (1)
    comic/ (7)
    misc/ (14)
    novel/ (55)
  misc/ (18)
    Perfume/ (40)
    body/ (19)
    design/ (6)
    elect/ (2)
    ent/ (7)
    food/ (10)
    game/ (14)
    media/ (54)
    memo/ (2)
    misc-news/ (5)
    movie/ (11)
    music/ (45)
    net/ (9)
    science/ (5)
    software/ (5)
    sports/ (4)
  moblog/ (16)
  personal/ (0)
    IWS03/ (3)
    bicycle/ (90)
      2003/ (49)
      2004/ (159)
      2005/ (128)
      2006/ (119)
      2007/ (90)
    diary/ (93)
    how-about/ (16)
    photo/ (1)
    site-admin/ (23)


Archive

2008-Dec
2008-Nov
2008-Oct
2008-Sep
2008-Aug
2008-Jul
2008-Jun
2008-May
2008-Apr
2008-Mar
2008-Feb
2008-Jan
2007-Dec
2007-Nov
2007-Oct
2007-Sep
2007-Aug
2007-Jul
2007-Jun
2007-May
2007-Apr
2007-Mar
2007-Feb
2007-Jan
2006-Dec
2006-Nov
2006-Oct
2006-Sep
2006-Aug
2006-Jul
2006-Jun
2006-May
2006-Apr
2006-Mar
2006-Feb
2006-Jan
2005-Dec
2005-Nov
2005-Oct
2005-Sep
2005-Aug
2005-Jul
2005-Jun
2005-May
2005-Apr
2005-Mar
2005-Feb
2005-Jan
2004-Dec
2004-Nov
2004-Oct
2004-Sep
2004-Aug
2004-Jul
2004-Jun
2004-May
2004-Apr
2004-Mar
2004-Feb
2004-Jan
2003-Dec
2003-Nov
2003-Oct
2003-Sep


Search

In-site search using google



RSS feeds

Subscribe to a syndicated feed of my weblog, brought to you by the wonders of RSS 0.91/ 1.0/ Atom 0.3

Referrers


Flavours

There's more than one way to view this weblog; try these flavours on for size.

  • RSS 0.91
  • RSS 1.0(rdf)
  • Atom 0.3

  • Creative Commons License
    This work is licensed under a Creative Commons License.
    Copyright (C) 2003 IWS iws @ iws.dyndns.org









    Schedule

    10/11Perfume TV
    10/16新型PSP
    11/06Perfume 武道館


    Ranking

    1. Perfume
      余人を以て替え難し!!!!!
    2. Pefume/20080503DRUM LOGOS公演
    3. Pefume/GAME
    4. Perfume/エレクトロ・ワールド
    5. Perfume/Baby cruising Love*マカロニ
    6. Perfume/Seventh Heaven
    7. Perfume/Fan Service [bitter]
    8. Perfume/ポリリズム
    9. くりらじ/サイクルメカニクル
      自転車雑誌買わなくなった
    10. Autodesk/Maya2008
    11. 米村圭伍/おたから蜜姫
    12. Doctor Who
      NHK教育火曜
    13. iPod touch
    14. capsule/capsule rmx
    15. 木村カエラ/You know you love me?
    16. 機本伸司/メシアの処方箋
    17. Perfume/Fan Service [sweet]
    18. OGK/Mostro
    19. Trek/Madone2008モデル
    20. Maya 8.5
    21. Gran Theft Auto(PSP)
    22. Google Earth + TdF2006ライブデータ
    23. チャングムの誓い
    24. compiz
    25. グレッグ・イーガン/ディアスポラ
    26. 酒見賢一/泣き虫弱虫諸葛孔明
    27. 堀亮/バビロニアウェーブ
    28. CG|toolkit, The Art of Rigging vol.2
    29. TREK/バズキル
    30. 東芝RD-X6 + スカパー連動
    31. BAND-AID キズパワーパッド
    32. 諸星大二郎/グリムのような物語 トゥールデおばさん



    2007/Nov/16 (Friday)
    Nautiusスクリプト for iPod Version 3

    iPod用ビデオ変換スクリプトをいっそのことなん でもOKなffmpeg用GUIにすることにした。

    これでビデオから音声トラックを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)
    

    08:00 | /misc/software | #(0) | TB

    iPod用ビデオ変換スクリプトをいっそのことなん でもOKなffmpeg用GUIにすることにした。

    これでビデオから音声トラックを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)
    




    Your feedback (comment or TB), please!

    Comment-back

    Name/御芳名 (REQUIRED):


    E-mail/連絡先 (optional):


    URL/御住所 (optional):


    Comment/御意見 (REQUIRED):


        

    Track-back

    TB URL: http://iws.dyndns.org/blog/tb/misc/software/Nautilus-script-for-iPod3

    The site name/サイト名 (optional):

    Title of the page/そのページのタイトル (optional):

    The page's url/そのURL (REQUIRED):
    Excerpt/概要 (REQUIRED and reject if empty):


        

    Ping-back

    NOT AVAILABLE NOW


    Powered by Pyblosxom