UIImagePicker: what file format is used when saving a movie? - ios

When I use an UIImagePicker to record video and then want to save it to disk, what file format is used? In other words.. when I have the file on disk and want to transport it over to a server, what kind if MIME type should I use?

The format that is used when you take a video with UIImagePickerController is Apple's quicktime format .MOV.
The MIME-type you are looking for is video/quicktime
Hope this helps!

Related

.m4a is considered audio/m4a or audio/mp4

I'm trying to make an audio upload to S3 and I'm a little confused what I should declare my mime type as. My audio file is an m4a recorded on an iphone as kAudioFormatMPEG4AAC. Would this be considered audio/m4a or audio/mp4? I'm seeing conflicting answers online.
The m4 in m4a is short-hand for MPEG-4, just like mp4 is short-hand for MPEG-4.
In fact, m4a, m4v and mp4 files all have the same internal MPEG-4 atom structure. The difference between the files is their content (video files have video atoms as well as audio atoms.)
The codec of the audio can also be different despite using the same file extension, for example both alac and AAC formats use the MPEG-4 container format with the m4a file extension.
So to answer your question, it really doesn't make much difference. My personal preference would be audio/mp4 since that is effectively saying
Audio data in MPEG-4 container
Whereas, audio/m4a is like saying
Audio data in MPEG-4 container containing audio
Use audio/mp4. audio/m4a may work, but it's invalid.
MP4 MIME type registration:
2. Selection of MIME Types for MP4 Files
The MIME types to be assigned to MP4 files are selected according to
the contents. Basic guidelines for selecting MIME types are as
follows:
a) if the file contains neither visual nor audio presentations, but
only, for example, MPEG-J or MPEG-7, use application/mp4;
b) for all other files, including those that have MPEG-J, etc., in
addition to video or audio streams, video/mp4 should be used;
however:
c) for files with audio but no visual aspect, including those that
have MPEG-J, etc., in addition to audio streams, audio/mp4 may be
used.
In any case, these indicate files conforming to the "MP4"
specification, ISO/IEC 14496-1:2000, systems file format.
Further, the list of standard MIME types includes audio/mp4, not audio/m4a, and non-standard MIME types should include “x-”, like audio/x-m4a.
In 2021 for me audio/mp4 for an .m4a file worked on Firefox + Chrome (Linux), Opera (Android) but not on iPhone Safari. For some formats the OS plays a role due to codecs.
I used a source tag with type attribute set and I also set the same type in the Content-Type header of the streamed / downloaded file.
https://en.wikipedia.org/wiki/HTML5_audio#Supported_audio_coding_formats
https://developer.mozilla.org/en-US/docs/Web/Guide/Audio_and_video_delivery/Cross-browser_audio_basics
https://developer.mozilla.org/en-US/docs/Web/HTTP/Configuring_servers_for_Ogg_media
Also see: How to play .m4a with HTML5 audio in IE(9+) and Safari (Pad)?

swift stream hls without m3u8 extension

I would like to ask you for help with HLS stream.
I would like to stream video in swift but problem is the format of downloaded file. I download m3u file from resource and there are links like:
http://192.168.2.100:8003/1:0:1:13F1:C87:3:EB0000:0:0:0:
Is it possible to play link like that or do I have to create an m3u8 file with link and then play it?
The stream is from enigma2 box.
Thank you and have a nice day.
The file name doesn't matter as long as the server returns the correct Content-Type http header.

Can I extract or convert a video file to audio?

I have a case where i need to get audio out from video file. Is this possible in iOS ??
I need only the output file as an audio any type. I have the video file in my documents directory which I record earlier in application.
1.Convert Video Reverse
2.Extract audio from a video file
3.Add Audio & Video Together
Download Code From Here
may be helpful to you.
Yes, it can be done. See Extract audio from video file for ideas.
Extracting is probably the more accurate term.

Convert .Caf file to more standard format programatically in iOS

I know this has been asked around, but couldn't find a straight answer.
My App uploads .caf files from ios to Webserver, where .caf isn't a recognized format. What Should I do programatically in iOS to turn it into mp3, .wav..etc before uploading to server?
EDIT : I had the same problem and solution is given below
I had same issue, As .caf isn't a recognized format in ISS 6.0 or greater (not sure about which ISS) so u convert into base64 then save in server as .cab file
When retrieving again convert form .cab to .caf file
I couldn't find an easy way to do this. So, I ended up downloading caf players on my windows machine.

Can you add ActionScript or other code to an flv

I'm curious if it's possible for an flv file to contain code like ActionScript or if it can only contain the audio/video data for the video.
I'm specifically asking related to the security of allowing an FLV file to be uploaded a site.
Edit: assume that the contents have been validated to be a real "flv" - the question is whether the format natively supports code inside of the flv.
the question is whether the format natively supports code inside of
the flv.
To that question, the answer is no. For further security discussions, see the other answers.
FLV files are for video/audio: http://en.wikipedia.org/wiki/Flash_Video. but I can rename any executable file of course and add the .FLV extension to it. so I believe you will need to read the uploaded files and check whether they are FLV indeed.
FLV is only a video format. Like akonsu said, you should check if the file is really a FLV file, not just checking it's extension.
You should check if the file's mime type is "video/x-flv".
More info about FLV: http://osflash.org/flv

Resources