+ Post New Thread
Results 1 to 4 of 4
Network and Classroom Management Thread, Avi to wmv script across Home Dirs? in Technical; Did someone have a script to convert avi to wmv (using ffmpeg - I think!) that recurses into sub folders? ...
  1. #1
    daveyboy's Avatar
    Join Date
    Jun 2005
    Location
    Bath / Bristol
    Posts
    280
    Thank Post
    38
    Thanked 19 Times in 17 Posts
    Rep Power
    22

    Avi to wmv script across Home Dirs?

    Did someone have a script to convert avi to wmv (using ffmpeg - I think!) that recurses into sub folders? - I can vagley remember someones post about running it on user areas.

    Can I find that post? - no. Hummm, must be searching for the wrong thing. Should have gone to a well known high st opticians.

    If you have, would you care to share?..

    Ta muchly.............

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,897
    Thank Post
    3,420
    Thanked 1,081 Times in 997 Posts
    Rep Power
    369
    Quote Originally Posted by daveyboy View Post
    Did someone have a script to convert avi to wmv (using ffmpeg - I think!) that recurses into sub folders? - I can vagley remember someones post about running it on user areas.

    Can I find that post? - no. Hummm, must be searching for the wrong thing. Should have gone to a well known high st opticians.

    If you have, would you care to share?..

    Ta muchly.............
    If you go to google and type the following or something along the lines of the below

    avi to wmv site:EduGeek.net

    search text at the start with a space then the word site with : directly afterwards ie site: then the url of the site you want to search for so in this case EduGeek.net

    that way it will search for anything that is related to avi to wmv on edugeek.

    something like below

    Google

    convert xvid (.avi) to windows media 9

  3. #3

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,157
    Thank Post
    116
    Thanked 529 Times in 452 Posts
    Blog Entries
    2
    Rep Power
    124
    Something like this will recurse the folders and process them.

    I use this to transcode files on my media PC from .ts to .mp4 but the principle is the same - you'll just need to get the right ffmpeg line!

    It assumes you're going to convert files under C:\recordings - I'd guess yours will be something like d:\homedirs\year7

    It writes a log to c:\temp\transcode.log

    It assumes you want an mp4 file - change the line at the top to whatever it needs to be

    It looks for .ts files to transcode; change that to whatever extension you're transcoding from.

    There's a commented out line at the end to delete the input file; I really, really wouldn't do this - YMMV but I find ffmpeg often fails to complete the transcoding. You're then left with a zero byte output file and no input file if you auto-delete. (I think the problems I have is because the MPG2 transport stream that you record from Freeview is not perfect so this may not be a problem for you)

    Code:
    const sLog="c:\temp\transcode.log"
    const sExtension=".mp4"
    const sRecordings="c:\recordings"
    
    set oShell=createobject("wscript.shell")
    set oFSO=createobject("scripting.filesystemobject")
    if not ofso.fileexists(sLog) then
      set oLog=ofso.createtextfile(sLog)
    else
      set oLog=ofso.opentextfile(sLog,8)
    end if
    
    set oFolder=ofso.getfolder(sRecordings)
    for each osubFolder in oFolder.subfolders
      for each oFile in oSubFolder.files
        Encode oFile
      next
    next
    for each oFile in oFolder.files
      encode oFile
    next
    
    oLog.close
    
    
    sub Encode(oFile)
      sExt=lcase(oFso.getextensionname(oFile))
      if sExt="ts" then
        sTitle=ofso.getbasename(oFile)
        sInput=oFile.parentfolder & "\" & oFile.name
        sOutput=oFile.parentfolder & "\" & sTitle & ".mp4"
        if not ofso.fileexists(sOutput) then
          oLog.writeline now & "~" & sTitle
          sCmd="c:\utils\ffmpeg.exe -i """ & sInput & """ -b 384k -s qvga -r 25 -aspect 4:3 -vcodec mpeg4 -acodec libfaac -ab 112k -ac 2 """ & sOutput & """"
          oLog.writeline sCmd
          oShell.run sCmd,,true
    
         'this line is destructive!!!
         'ofso.deletefile sInput,true
         'the line above is destructive!!!
    
        end if
      end if
    end sub

  4. Thanks to srochford from:

    mac_shinobi (5th February 2010)

  5. #4
    daveyboy's Avatar
    Join Date
    Jun 2005
    Location
    Bath / Bristol
    Posts
    280
    Thank Post
    38
    Thanked 19 Times in 17 Posts
    Rep Power
    22
    Steve, thank you very much - I will be looking at this later today.



SHARE:
+ Post New Thread

Similar Threads

  1. .MOD to avi/wmv conversion
    By Mr.Ben in forum AV and Multimedia Related
    Replies: 11
    Last Post: 19th January 2010, 08:07 AM
  2. OS X Home dirs not working properly
    By HodgeHi in forum Mac
    Replies: 15
    Last Post: 3rd September 2009, 08:59 PM
  3. terminal script to create home dirs in OS X
    By HodgeHi in forum Coding
    Replies: 6
    Last Post: 3rd July 2009, 10:13 AM
  4. Moving Home Dirs?
    By mmoseley in forum Wireless Networks
    Replies: 19
    Last Post: 1st October 2007, 11:57 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •