Welcome Guest.   Make a donation to an author on the site December 19, 2014, 09:44:19 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Free DonationCoder.com Member Kit: Submit Request.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Podcast Conversion and dates  (Read 2490 times)
oblivion
Supporting Member
**
Posts: 361


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« on: March 21, 2011, 09:30:00 AM »

I am a bit of a podcast addict. Sadly, I get a bit behind and -- because I TRY to be organised -- I keep my podcasts in a single folder, so I can sort them in date order, and transfer the oldest first to my MP3 player.

Mostly, this works very well. But one of the podcasts I regularly get comes in M4A format. Although the software I use to transfer stuff to my player converts things on the fly, I prefer to do the conversion myself so I can control the output quality and filesize a bit better.

So far, I have found the easiest way to do this is to use fre:ac (the new version of BonkEnc, still free though) to do the conversion to MP3, output the files somewhere away from the originals, then use another little freebie (filedate) to re-datestamp the new files to match the originals, so they don't get sorted to the end of the list. Fiddly and time-consuming, especially if you've only just got round to it after a few weeks of letting M4As build up...

Two related requests, then. Either a program that can suck in an audio file (or a list of files) and squirt out an MP3 with the same time/datestamp as the original, optionally deleting the original... or if doing that is too complex for a "snack", a program that can display two lists of files, allow them to be lined up by hand in case filenames don't quite match, then apply the date/timestamps from the source list to the destination list.
Logged

-- bests, Tim

...this space unintentionally left blank.
mouser
First Author
Administrator
*****
Posts: 33,785



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: March 21, 2011, 09:32:14 AM »

interesting...  in thinking about a general purpose solution, one question is, can you keep the base filenames the same?
if so then a good general purpose solution might be an app that scans a directory and sets the file date stamps for all sets of files with same basename (and different extensions) to the date of earliest datestamp in the set.

Logged
skwire
Global Moderator
*****
Posts: 4,180



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: March 21, 2011, 11:17:43 AM »

Either a program that can suck in an audio file (or a list of files) and squirt out an MP3 with the same time/datestamp as the original

fre:ac actually comes with a commandline version in its install so that, combined with a small bit of AHK script, would make this a piece of cake.  Heck, you could even use the lame.exe file directly.  Do you have AutoHotkey installed?
Logged

oblivion
Supporting Member
**
Posts: 361


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: March 21, 2011, 11:37:20 AM »

fre:ac actually comes with a commandline version in its install so that, combined with a small bit of AHK script, would make this a piece of cake.  Heck, you could even use the lame.exe file directly.  Do you have AutoHotkey installed?

I've got a portable copy somewhere, but I've never tried to use it. You're a proper programmer, I just pretend to know what it's about sometimes.  embarassed

(I can sometimes write very simple and mechanistic black boxes -- take some input textfile, chop it up, put it back together in a different order, exit. Anything requiring screen design or direct access to the Windows API, I'm running away so fast people are choking on the dust.)
Logged

-- bests, Tim

...this space unintentionally left blank.
oblivion
Supporting Member
**
Posts: 361


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: March 21, 2011, 11:56:51 AM »

Do you have AutoHotkey installed?

Okay, just had a bit of a look at the helpfile for it. It looks like a file loop could be used to retrieve the file list and operate on them one at a time, and if I can throw commands at fre:ac or Lame, I might even be able to puzzle something out.

What I'm less sure about is -- as I suggested previously -- putting a front end on it. To make it reliable, I'd want a front end on it that allowed the specification of the input and output sources and a path to LAME or fre:ac or whatever, and I suppose to make it bulletproof it'd probably have to be able to specify encoder options and suddenly it's looking like I really should be running away from all this ui stuff  embarassed  smiley
Logged

-- bests, Tim

...this space unintentionally left blank.
skwire
Global Moderator
*****
Posts: 4,180



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: March 21, 2011, 12:07:08 PM »

Here's a proof-of-concept script.  

  • Save this to <whatever>.ahk and put it in your fre:ac folder.
  • Edit the myOutputDir variable to an output folder of your choice.
  • Run the script.  You should see a small square begging for you to drop some files on it.
  • Drop some files on it!
  • They will be converted to mp3 and placed in your chosen output directory with the original modification times.

Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. ; Set up environment.
  2. SetWorkingDir, %A_ScriptDir%
  3.  
  4. ; Variables.
  5. AppName     := "Podblivion"
  6. myOutputDir := "c:\tmp2"
  7.  
  8. ; Build simple drop target.
  9. Gui, Add, Text, xm ym w150 h150 Center 0x200 vtxtDisplay, Drop files here...
  10. Gui, Show, , % AppName
  11. Return ; End of auto-execute section.
  12.  
  13.  
  14. GuiDropFiles:
  15. {
  16.    myFiles := A_GuiEvent
  17.    Loop, Parse, myFiles, `n
  18.    {
  19.        If ( A_LoopField != "" )
  20.        {
  21.            myFilePath := A_LoopField
  22.  
  23.            ; Notify user that we're doing something.
  24.            SetTimer, Progress, On
  25.  
  26.            ; Get modified time of dropped file.
  27.            FileGetTime, modTime, % myFilePath, M
  28.  
  29.            ; Crack path and form up output filename with mp3 extension.
  30.            SplitPath, myFilePath, , , , myFileNameNoExt
  31.            myOutputFile := myOutputDir . "\" . myFileNameNoExt . ".mp3"
  32.  
  33.            ; Set parameters for the freaccmd.exe program.
  34.            cmdParams := "-e LAME -m VBR -b -q 5 -d " . myOutputDir . " """ . myFilePath . """"
  35.  
  36.            ; Convert file.
  37.            RunWait, % A_ScriptDir . "\freaccmd.exe " . cmdParams, , Hide
  38.  
  39.            ; Set output file's modified time to input file's value.
  40.            FileSetTime, % modTime, % myOutputFile, M
  41.        }
  42.    }
  43.    SetTimer, Progress, Off
  44.    GuiControl, Text, txtDisplay, Drop files here...
  45. }
  46.  
  47.  
  48. {
  49.    GuiControl, Text, txtDisplay, Converting |
  50.    Sleep, 250
  51.    GuiControl, Text, txtDisplay, Converting /
  52.    Sleep, 250
  53.    GuiControl, Text, txtDisplay, Converting -
  54.    Sleep, 250
  55.    GuiControl, Text, txtDisplay, Converting \
  56.    Sleep, 250
  57. }
  58.  
  59.  
  60. {
  61.    ExitApp
  62. }
Logged

oblivion
Supporting Member
**
Posts: 361


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: March 23, 2011, 05:17:34 AM »

interesting...  in thinking about a general purpose solution, one question is, can you keep the base filenames the same?
if so then a good general purpose solution might be an app that scans a directory and sets the file date stamps for all sets of files with same basename (and different extensions) to the date of earliest datestamp in the set.
Sorry, I didn't notice this response before. I don't see why you couldn't constrain most conversion apps to work in that way, and it occurs to me that a general purpose app that took that approach might be useful for all sorts of things where you might want the creation date to be retained in a different file format. Photos as well as audio -- maybe even MORE than audio, since I suspect my idiosyncratic approach to podcasts may not be "normal."  smiley
Logged

-- bests, Tim

...this space unintentionally left blank.
oblivion
Supporting Member
**
Posts: 361


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: March 23, 2011, 05:58:32 AM »

Here's a proof-of-concept script. 

Thanks!

It doesn't seem to want to work, though. The script is in the freac app directory (\portableapps\freacportable\app\freac) and freaccmd.exe is present in the same place. I can drop an m4a onto it and it does the "converting" thing for a little while then stops, but I can't find any sign of the output file in the folder I specified (g:\temp) or, indeed, anywhere else.

Any idea what might be going wrong, or how I can watch what it's doing in more detail, perhaps?
Logged

-- bests, Tim

...this space unintentionally left blank.
skwire
Global Moderator
*****
Posts: 4,180



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #8 on: March 23, 2011, 12:16:13 PM »

Any idea what might be going wrong, or how I can watch what it's doing in more detail, perhaps?

On line 43, you can take off the "Hide" keyword.  This will allow you to see the freaccmd.exe window.
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.069s | Server load: 0.08 ]