Keep original creation & modification timestamp while exporting with quicktime using applescript - quicktime

I realized that my GoPro videos are very large and that I can compress them by around 80% by loading the video in Quicktime and exporting the video in the 1080p format.
I found this automation for my problem: applescript to batch export with quicktime pro
Unfortunately, I use to batch rename my video files according to the date & time taken (e.g. "2022-10-12, 15.24.13.mp4"). For the compressed video file, the creation & modification timestamp is not copied from the original file.
Any idea, how I can keep the original creation & modification timestamp for the compressed file? Or copy the creation & modification timestampe later from the original file into the compressed file? Maybe it helps that the files are named similarly except that the extension changes from "mp4" to "mov".
Thanks a lot in advance for any help!

Related

How to export and share a .gltf file as .usdz file in iOS through code? [duplicate]

I am creating an app where users can scan objects in 3D, I have a scene which I can easily save in documents directory and share it in .scn format, but I want to share this .scn file as .usdz file via UIActivityController.
Basically I am using this library https://github.com/StandardCyborg/StandardCyborgCocoa
In this library, a scene file is saved as .gltf format, but I want to share this .gltf file which is not supported on iOS devices. Apple only support .usdz file format. So, I want to convert this .gltf file into .usdz file before sharing.
I have been searching different solutions over internet for a week, but nothing is working till now.
Can anyone help me to resolve this issue?
Any help is greatly appreciated.
It's not documented, but SCNScene's write method works with a .usdz URL, at least since iOS 14.7. This is what I'm using in my app.

How to convert convert .CAF file into .MP3 in iOS?

I am recording audio file. It is recorded with .caf extension.
How can I convert this format into .mp3 format?
There is a open source project lame . The challenge would be making it work for iphone. This would give a direction towards cross compiling for ios.
There is also an iOSMp3Recorder available on GIT and one another example
Record and audio conversion in internet.
I hope above examples may help you.
Using Lame, you can do this. Ther is no default function for this. It will also reduce the file size also. For 60 second audio file .caf will take approx 5mb - 10mb but after converting to .mp3 it will take 0.6mb to 0.7mb. Set 'Enable Bitcode' to 'NO' in build setting for new xocde, otherwise you will get error.
For sample code use this LINK.

Comparing should-be identical AAC audio files - timestamp?

I have problems encoding AAC/M4A audio files on iPhone (iOS) and in simulator in a way so that
mono/stereo and
the track duration
are recognized correctly by external players like VLC.
For closing in on the problems on various devices, I have written code which generates test files for various encoding configurations. The encoded sound is a generated sine wave which is identical all the time. This works nicely. In the next step, I do a binary comparison of these test files which were generated on different divices and in the simulator. To my surprise, the .m4a files are never identical (the aac files are identical all the time). I use the ExtAudioFile...() methods for writing the files and I use the file type identifier kAudioFileM4AType.
I suspect that there is a timestamp included in these files which confuses my binary comparison.
Can anybody confirm or refute that there is a timestamp in M4A files, which will always confuse a binary comparison?
M4A is a container format, and would almost certainly contain some metadata. It's very likely some of this metadata is different from one encoding to another, as you suspect.
You might do better writing some kind of algorithm to see if your M4A file contains a byte stream that matches the AAC data you have. One way to approach this would be to compare both files (M4A and AAC with same raw sound data) manually in a Hex editor and try to find the offset where the AAC data begins and/or ends, and then just compare that data.

Audio file issue on iOS

I have 3000 small sized audio files in my iphone project. File sizes are generally between 1kb and 50kb. I copied all files to one directory and I can play them. To decrease project size what should I do? What about compressing files to a zip file and then unzip on iphone for the first run? Is there any way to combine all of these files and play from one file? What is the ideal solution?
If your files are mp3s, there is little chance that you could make them smaller by compressing them. Indeed, mp3 is a format that allows you to obtain very high compression rates.
What you could do is reducing the encoding, and you could get a substantial gain. E.g., if your files are 256kbps, you could go to 192, or 128... another option that would provide a huge advantage is converting the file to a mono audio file.
I am not saying that all this could be done sensibly for your app, they are just options.
In any case, I would not be too much worried at the 20MB, and you can surely keep all of those files in the resource directory of the app.

Ruby/Rails Audio Conversion Plugins?

I am looking for a good gem/plugin to convert user-uploaded audio files to different formats. One format in particular that I am interested in is converting to Apple .caf with ima4 compression for inclusion in an iPhone app.
I have been using afconvert on my mac for this so far, but I need to do it on my linux box, server-side. Ideally, I would be able to work into paperclip.
As an additional solution, ffmpeg could work, but I have not seen any .caf options for it. Anybody know of one?
The Sound eXchange project supports lots of audio file conversions. I've used this in the past to convert aiff files output by the OS X "say" program to ulaw files for Asterisk. This yields rather nice text-to-speech. For my purposes, I also found a Ruby extension on github called sox-ruby that wraps the libsox functions directly.

Resources