View Issue Details

IDProjectCategoryView StatusLast Update
0006382MMW v4Properties/Auto-Toolspublic2011-11-14 21:50
ReporterLudek Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.2 
Target Version4.1Fixed in Version4.0 
Summary0006382: Tagging of large MP4 files takes too long
DescriptionI found that tagging of large MP4 file (e.g. > 200 MB video file) takes 30 seconds on my system. This is because the workflow seems to be this:

1. The whole file "Filepath.MP4" is copied to "Filepath.mp4.XXXXXX"
2. Then copy "Filepath.mp4.XXXXXX" is tagged
3. The original "Filepath.MP4" is replaced by the copy "Filepath.mp4.XXXXXX"

Question is: Is it really neccessary to create the copy, isn't it possible to tag the original directly like in case of the other filetypes?
TagsNo tags attached.
Fixed in build1425

Relationships

related to 0001449 resolveduser9 MMW v4 AAC (m4p, m4a, mp4) Tagging support (failed scans / crash on scan) 
related to 0005487 resolvedjiri MMW v4 Multiple LIST INFO Chunks in WAV files are not cleared during Tag save 
related to 0007251 closedmichal MMW v4 Tagging and playing of very large MP4 files does not work. 
related to 0007626 closedmichal MMW v4 Tagging QuickTime files (MOV) 
related to 0008309 assignedmichal MMW v4 Add 'Optimize for Streaming' to Advanced tagging functions 
related to 0008310 closedmichal AAC / Video codec plugin Optimize MP4 muxer, so it will generate files optimized for streaming 
related to 0008466 closedmichal MMW v4 Some m4a files make no sound on iPod/iPhone (regression) 

Activities

michal

2010-06-21 10:41

developer   ~0020271

It is probably possible, but it leads to complete rework of the file saving algorithm. The AAC plugin now reads the atoms from the source file and creates new file from them. New algorithm should analyze the file and try to write metadata to the free space in the header or to the end of the file (and make free space from existing metadata, if there is not enough space in the header).

Ludek

2010-11-26 16:03

developer   ~0021491

Note that iTunes has the same issue and even worse, because they don't tag on background and therefore iTunes freezes completely in such a case.

peke

2010-11-26 18:44

developer   ~0021493

Just a suggestion. Something Similar is done with FLAC and with WAVE. I remember I had similar issues with them

Maybe we could optimize routine to be more efficient (WAVE have JUNK Chunk for allowing appending LISTINFO Chunk on the end of file, ...)

michal

2010-11-26 18:54

developer   ~0021495

peke: yes, this is what I've meant. I use similar algorithm for AVI tagging. We need to change the whole saving algorithm.

Ludek

2010-11-26 23:42

developer   ~0021503

If we decide to do something about it then we should ensure that it will not cause any problems with regard to readability by the others applications!

michal

2010-11-27 06:33

developer   ~0021504

Ludek: sure, we talk about standard atoms and structure of course, MP4 has standard atom for free space too, it is all about smarter saving algorithm.

peke

2010-11-27 08:16

developer   ~0021505

Do not forget that we need to take in consideration Network Tagging which is currently performance bottleneck.

peke

2010-12-11 00:11

developer   ~0021728

Michal: You are completely right see 0005487

jiri

2011-04-29 08:22

administrator   ~0024566

As discussed with Michal over IM, the best suggested approach is:

1. To rewrite the mp4 plug-in, due to old complex and inefficient code.

2a. Try to write MOOV to the beginning of tagged file.
2b. Always keep a reserve in the newly written MOOV, so that further updates are fast.

3. In case there isn't any space available at the beginning of file, we either:
3a. Write MOOV to the beginning anyway, relocate the rest of file - for smaller files, like < 10MB?
3b. Write MOOV to the end of file for larger files.

4. Since MOOV should be at the beginning of file for streaming purposes, we could add an entry to Advanced tagging functions - 'Optimize for Streaming' that would move MOOV to the beginning regardless of file size.

5. Our MP4 muxer currently writes MOOV to the end of file. We should try to fix this, so that user doesn't have to use 4. for streaming fix. It seems that the best approach would be to keep a reserve for MOOV (needs to be estimated) and update it when A/V data are written. In case the reserve was underestimated, the file would have to be relocated after conversion.

michal

2011-08-29 17:50

developer   ~0027401

Last edited: 2011-08-29 17:53

1-3b fixed in build 1425. New f_MP4.dll plugin introduced, it will handle all tagging/parsing functionality of MP4-like files instead of f_AAC.dll.

michal

2011-08-29 19:54

developer   ~0027404

Resolving. The rest is tracked as 0008309 and 0008310.

peke

2011-11-14 21:50

developer   ~0028877

Verified 1459