renaming video files - General Help and Assistance on using CHDK stable releases - CHDK Forum
supplierdeeply

renaming video files

  • 13 Replies
  • 7763 Views
renaming video files
« on: 10 / October / 2011, 21:03:26 »
Advertisements
Today I renamed on my computer a 2 meg video file that I created on my computer - mvi. I renamed it so that its suffix was jpg, and copied it to my eye-fi 2gig card.  When placed in my Canon 540, the file was copied by wi-fi to my laptop.  I then renamed it as mvi on my computer, and it ran okay as a video.

First generation eye-fi cards do not transfer videos, only jpegs.  So if I could rename my video as a jpeg in camera, I might be able to transfer it at least to my computer, and perhaps to flickr, although it would have to be renamed at the receiving end.

I see reference to a new text editor combined with browser as a script.  Is that the direction to go, or could someone think of a script that would do a simple jpg/avi name switch?

Re: renaming video files
« Reply #1 on: 11 / October / 2011, 10:49:44 »
Isn't it the same you asked here:
http://chdk.setepontos.com/index.php?topic=6921.msg74196#msg74196
?

It's not ok to ask the same question in different threads. I've posted you a link to http://chdk.wikia.com/wiki/Lua and I said you have to read about os.rename() function. I guess that's good direction you have to go.

CHDK text editor is rather not needed here. Nevertheless file_browser() command would be usefull here. If you don't know, how to use a scripts, read here: http://chdk.wikia.com/wiki/Scripts

I guess your script should look as follows:

Code: [Select]
file=file_browser("A")
new_file=file..".jpg"
os.rename(file, new_file)

I'm not really sure, if rename() function works correctly with CHDK.

You have to use one of the lastest builds (changeset 1360 or newer) since file_browser() command is very new.

PS. When you run above script (if it works...) you should see a file browser. Select a file you need to rename. It'll be renamed automatically. I hope;p
« Last Edit: 11 / October / 2011, 10:51:59 by outslider »
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: renaming video files
« Reply #2 on: 11 / October / 2011, 15:39:37 »
Sorry about double posting.  The second post was after doing the conversion test that I described.
I tried your script.  I copied it and pasted it to notepad.  I saved it as a text file and then changed txt to bas.  After placing on my card, in the script area, it showed in chdk as a script.  while it ran, it simply gave me the standard script opeing page.  when i went to the play mode, my camera froze.

Eventually I had to remove the script with the card in my computer.

Perhaps I did not read the commands of the script correctly in camera.
I am using the newest chdk for the 540.
Thanks for your reply.
John Elliott

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: renaming video files
« Reply #3 on: 11 / October / 2011, 16:36:04 »
I copied it and pasted it to notepad.  I saved it as a text file and then changed txt to bas.
That's wrong. This is a lua script, change the ending in lua.

while it ran, it simply gave me the standard script opeing page.
Sure you run the script by pressing shutter in ALT mode? It's seems you pressed the FUNC.SET key.

After file renaming maybe a camera reboot is necessary, so that the files are detected.

msl
CHDK-DE:  CHDK-DE links


Re: renaming video files
« Reply #4 on: 11 / October / 2011, 21:31:58 »
:1: attempt to call global file browser. (nill value)

Is the message i got on running the lua script by using the shutter, with and without the alt icon on screen, in both the play and record modes.

I also tried using the chdk file browser and once over an avi file clicking the shutter to initiate the conversion seuence.

No luck so far.

thanks for your patience.
If successful, this could be significant for all of us who are limited to using eye-fi with only the 2 gig sd card- not sdhc which allows raw and video transfers.

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: renaming video files
« Reply #5 on: 12 / October / 2011, 03:15:06 »
:1: attempt to call global file browser. (nill value)
Your script now runs correctly! But it says, you have a CHDK version without lua function file_browser(). See what outslider wrote:
You have to use one of the lastest builds (changeset 1360 or newer) since file_browser() command is very new.
Dowload a recent version from autobuild server and try it again.

msl
CHDK-DE:  CHDK-DE links

Re: renaming video files
« Reply #6 on: 12 / October / 2011, 07:15:02 »
My chdk is running other lua scripts- eg the one for remote capture.
If I download a new build, do I need to first remove all existing chdk files on my card?
Or does the installer give me the option for automatic removal of the old build while installing (afraid of messing up what is working now)

Thanks

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: renaming video files
« Reply #7 on: 12 / October / 2011, 07:29:25 »
If I download a new build, do I need to first remove all existing chdk files on my card?

No, you need only overwrite diskboot.bin and ps.fi2/ps.fir with the most recent version from autobuild server. All other files and folders you can keep.

msl
CHDK-DE:  CHDK-DE links


Re: renaming video files
« Reply #8 on: 12 / October / 2011, 07:41:14 »
If I download a new build, do I need to first remove all existing chdk files on my card?

No, you need only overwrite diskboot.bin and ps.fi2/ps.fir with the most recent version from autobuild server. All other files and folders you can keep.

msl

However, the configuration file CCHDK.CFG that holds any changes you make to your local setup will still be on the card.   This can be a good thing if you want to keep your current setup (e.g. OSD icon settings) when updating versions.   However, it can be annoying if you have made a mess of your setup.  And in rare cases - like when testing beta versions - it can cause bugs if the new code does not work with the old cfg file.
So if your update behaves strangely, one of the first things to do is delete the CCHDK.CFG file. u
Ported :   A1200    SD940   G10    Powershot N    G16

Re: renaming video files
« Reply #9 on: 12 / October / 2011, 19:33:25 »
I downloaded the most recent build for the 540- I think 9.9, 1206, not in the 1300 range.  No change ; likely the one I already had.
I then tried a lua script that is titled "rename".  For its apples, banana argument  substituted avi-jpg. on running it said "unexpected symbol near" (not sure I read the last word correctly)

I wonder if I misunderstood the example in rename.lua

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal