Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m4a issue #331

Closed
bouscram opened this issue Apr 28, 2020 · 15 comments
Closed

m4a issue #331

bouscram opened this issue Apr 28, 2020 · 15 comments

Comments

@bouscram
Copy link

In the numerous formats available in Lossless Cut, there is not a "pure audio" mp4 (aka .m4a) file format, as expected by Apple programs.
You can remove the video track from a file, but the resulting file is not recognised by iTune or Music as an audio file. You can add it to the library (if you change the extension to .m4a), but information tags are not added to it. They are only kept in iTune or Music's database. The most visual clue of it is that you can't add an illustration image.
I guess there is something missing in the file format.
There is a workaround, which is to open the file with Quicktime Player, and export it as an audio file, but it's a bit tedious if you have many files. So if you could add it, it would really be a nice addition (thanks for the program anyway, it is really useful!)

@mifi
Copy link
Owner

mifi commented May 3, 2020

Hi. Have you tried the ipod output format? It will produce an m4a which is identical to ffmpeg -i ... output.m4a. (See also #28)

@mifi
Copy link
Owner

mifi commented May 3, 2020

I will improve the description of the ipod format to say m4a instead

@bouscram
Copy link
Author

bouscram commented May 3, 2020

I did some additional tests with the "iPod" format, but it's still not right. When imported into Music or iTunes, it is still not possible to add metadata in the file. I have then opened the file with Quicktime Player and exported the audio to compare the format with Mediainfo: the format profile is the same (Apple audio with iTunes info), but the the codec ID is different - M4A (isom/iso2) when exported by Lossless Cut/ffmpeg, M4A (M4A /isom/mp42) when exported by Quicktime. Maybe this is the cause, but I guess there is nothing to do except open a ticket in ffmpeg.
Here is a zip with both versions if you want to look at it:
Archive.zip

@mifi
Copy link
Owner

mifi commented May 3, 2020

Which losslesscut version are you runnning? For me when exporting to ipod format, I get a file with similar metadata to your QuickTime version

@mifi mifi changed the title Missing "audio only" mp4 file format m4a issue May 3, 2020
@bouscram
Copy link
Author

bouscram commented May 3, 2020

I use version 3.21.0, so this is strange... I did a new test using the command line to be sure that I was using the ffmpeg version embedded in Lossless Cut, and I still get the problem. Can you send me one example of your exports ?

mifi added a commit that referenced this issue May 3, 2020
@mifi
Copy link
Owner

mifi commented May 3, 2020

try this one
PJ Party Sundays-00.06.24.998-00.11.49.996-Hallelujah Quicktime-00.00.00.000-00.01.23.295.m4a.zip

So the problem is that they will import and play nicely but they will not be processed or loaded properly into iTunes?

@bouscram
Copy link
Author

bouscram commented May 3, 2020

Same... The problem is that they are correctly imported in the iTunes or Music library, but it's impossible to add metadata IN the file with one of these programs.
There are 2 ways to see it: the easiest is to try to add artwork to the file. You can do it in the UI, but it's not kept... The other way is to delete the song (after having put some info in the tags). If you get the file out of the trash and re-import it, nothing is there anymore (these metadata were only in iTune or Music's database apparently).
I suppose there is something in the file format which prevents it to be fully recognised. The only difference I could see was the codec ID, but I'm not an expert and I don't have advanced tools to look at details.

@mifi
Copy link
Owner

mifi commented May 4, 2020

Maybe we need -movflags +faststart

Could you try again the command line with -movflags +faststart appended before output.m4a and see if it helps?

@mifi
Copy link
Owner

mifi commented May 4, 2020

I just tested and it seems to work! at least I can add art work

@mifi
Copy link
Owner

mifi commented May 4, 2020

Upon more testing, it seems it's not fixed by adding -movflags +faststart, but rather fixed by removing -movflags use_metadata_tags

@bouscram
Copy link
Author

bouscram commented May 4, 2020

I succeeded in 2 ways: by adding only +faststart before -y output.m4a (not changing anything else) or by removing -movflags use_metadata_tags.

@mifi
Copy link
Owner

mifi commented May 4, 2020

What's your full command line with +faststart ? for me this one does not work:

ffmpeg -hide_banner -i 'PJ Party Sundays-00.06.24.998-00.11.49.996-Hallelujah.m4a' -avoid_negative_ts make_zero -c copy -map '0:0' -map_metadata 0 -movflags use_metadata_tags -movflags '+faststart' -ignore_unknown -f ipod -y output.m4a

But this one works:

ffmpeg -hide_banner -i 'PJ Party Sundays-00.06.24.998-00.11.49.996-Hallelujah.m4a' -avoid_negative_ts make_zero -c copy -map '0:0' -map_metadata 0 -ignore_unknown -f ipod -y output.m4a

mifi added a commit that referenced this issue May 4, 2020
@mifi
Copy link
Owner

mifi commented May 4, 2020

I have now changed the logic so that when we are outputting ipod (m4a), we will remove the -movflags use_metadata_tags and instead add -movflags +faststart. You can try when the next version is built

@bouscram
Copy link
Author

bouscram commented May 4, 2020

The command which worked was this one: ffmpeg -hide_banner -I 'input.m4a' -c copy -map '0:0' -map_metadata 0 -movflags use_metadata_tags -ignore_unknown -f ipod +faststart -y 'output.m4a'
When I look at ffmpeg documentation, I don't understand how it can work... ;-)

@bouscram
Copy link
Author

bouscram commented May 5, 2020

It seems fixed in 3.22.2, closing issue. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants