Which box of fmp4 file contains CTTS information similar to that of ordinary MP4 file? - mp4

I converted fmp4 files into TS files by imitating the code of converting MP4 files into TS files.
I encountered a problem:
There is CTTS box in MP4 file, but there is no CTTS box in fmp4 file. The information inside CTTS (PTS = STTS + CTTS) is needed when calculating video PTS. What should I do?
My h264 frame has no B frame. Do I need a CTTS box?

fmp4 encodes timestamps, flags and sizes in the trun box

Related

.HEIC file to .JPG not identified by PIL.Image

I am running a script to extract the EXIF data from a list of images in a folder that are imported from an iPhone using Python's pillow:
from PIL import Image
image = Image.open(path)
But before anything, some of the pictures need to be converted from iOS' format .HEIC to .jpg. I successfully managed to do so but when I try to open the image that was converted I get the following:
PIL.UnidentifiedImageError: cannot identify image file '.../pictures/IMG_4294.jpg'
See this image comparing the info of two files. The one on the left was converted from .HEIC to .jpg and doesn't work. The one on the right is originally a .jpg and works just fine.
Any thoughts on how I can solve this?

How to convert .SFF file format to .BMP or .PNG or .JPG?

I need to convert my SFF file to PDF, then i need verify the document. i.e SFF file and converted file.
For that, I think to convert SFF file to image file and PDF file to image file.
Then comparing the both file using image processing.
To do this method:
Im searching for a program to convert SFF to BMP
Does anyone know such a program or has another idea how to do the job?
Thank you in advance...
Looks like you need reaConvertor. It appears to be a matured tool you can rely on. There is an online version of the tool here
I think:
https://github.com/Sonderstorch/sfftools
will do what you need (convert sff -> tiff/jpeg/..) and then you can use imageMagic (for example) to go to PDF.
Clearly not a current well used image format, however if you have legacy.sff Structured Fax Format, they are similar (not exactly identical) to a Monochrome G4 format.
By far the simplest programmable method to convert is using IrfanView which can Read Modify and Resave as other formats in batches.
Out put can be any other modern image type including Mono.BMP, G4.fax or as PDF (with or without GhostScript)

can a MP4 file contains more than one movie atom?

we know movie atom in a MP4 container file stores information that describes a movie's data. I am wondering if a single MP4 file can contain more than one movie atoms (atom type of 'moov')?
anyone knows? Thanks
A valid MP4 file may only contain one single 'moov' box. This is stated in 8.2.1 of the ISO 14496-12 specification:
The metadata for a presentation is stored in the single Movie Box which occurs at the top-level of a file.
Normally this box is close to the beginning or end of the file, though this is not required.
If you are using fragmented MP4 files the role of the 'moov' is mostly played by 'moof' boxes and those typically exist multiple times.

copy part of audio file into a new file in iOS

I want to copy a part of the audio file, given the starting and ending point(in terms of time which I'll convert to packets or frames-is the conversion right?), and create a new audio file for the copied snippet. How do I copy?
Please advice.
Regards,
Namratha
For what file format(s)?
For the simplest and common .WAV (RIFF) file format, you can just copy the canonical 44-byte header (after checking to make sure the file is using only this simple format), update with the target file length, and then copy a selected sub-range of bytes (multiply time by sample rate by frame size) from the source file, and append that PCM data to the copied header. Apple's codec does not complain about audio files patched together this way.
For other formats, you might be able to convert them either to a simple WAVE file, or to an array of raw PCM samples of suitable sample rate, data type and endianess, and then do the above.

Problem of converting caf files using libsnd

I m building a voice recording application in iPhone. The recorded file is transfer to linux server and it need to be converted to wav file.
However, when I try to convert caf file using libsnd, it gives an error.
Error : Not able to open input file testfile.caf
For testing I converted some wave file to caf using libsnd and vice versa.
So I think that there is a problem of my recorded file in iphone.
Anyone has got such an experience ?
I hope can someone help me.
Thanks.
If you use AVAudioRecorder, AudioFile, or any of the other Core Audio APIs, you should be able to record directly to a WAV file, and skip the entire conversion process altogether.
But if you need to convert audio files, first check if the CAF file is a valid file. Does it play? Is the header correct? What is the data format? Is it compressed? Does libsnd support the data format?
(The data format is separate from the file format, which is just a container for various bits of data as well as the sample data. The data format could be PCM, or it could be compressed in any format such as MP3, AAC, uLaw, etc.)