I'm trying to understand how to configure / set the "compatible_brands" field in an MP4 file, or otherwise control the exact format of the file.
I'm generating H.264 MP4 files from Adobe Premiere. They don't play on some devices, including one of my TVs, which I always assumed was just a device issue - older devices won't play the files.
I recently discovered that if I re-encode the Adobe output file in Handbrake (same video parameters), it plays. I've since discovered if I pass the file through ffmpeg as a straight copy, it also plays. i.e. ffmpeg -i "adobe.mp4" -c copy "ffmpeg.mp4"
After much testing/analysis, the difference seems to be that the Adobe file is output as mp42 (mp42/mp41), the Handbrake file comes out as mp42 (isom/iso2/avc1/mp41), the ffmpeg copy comes out as isom (isom/iso2/avc1/mp41).
So it seems like the H.264 video Adobe generates within the file is playable by all devices, it's just a file format issue? In which case:
- Is this really just a file format issue I am looking at? It seems this way - it seems the ffmpeg file otherwise contains an identical copy of the video/audio data?
- Why does Adobe Premiere / Media Encoder create a "less compatible" file format, and are there settings I can use to force the file format / compatibility (I can't seem to find any)?
- Same question for ffmpeg, how does it decide exactly what file format / compatible_brands list will be used in the output file? Can I force this?
- Anything else I should know - is forcing a file format that is compatible on more older devices going to create issues elsewhere for me?
Apologies if there's a write up on all this somewhere, I've tried googling a lot of what's going on here with the various file types keywords, compatible brands, etc, but I can't seem to find a definitive write up that gets me to the bottom of exactly what all these types mean, or how to force them from the various software.
+ Reply to Thread
Results 1 to 11 of 11
-
-
Many TV players have problems with certain profile levels. For example, an avc high 3.1 cannot be played, but a high 3.0 can be played without problems.
With clever Ffmpeg-GUI you can change the level without recoding.
Just try it out. -
Thanks - I've taken a look at Clever Ffmpeg-GUI, it does indeed let you change the profile, I'm wondering what it's doing under the hood (using ffmpeg, or just editing the file details directly), although I don't think altering the video profile is my issue in this case.
The video I've encoded is 1080p50, which under the specification requires a minimum of Main Profile 4.2:
https://en.wikipedia.org/wiki/Advanced_Video_Coding
That's the profile Adobe has used on the video stream, and the same profile is in place on the Handbrake & ffmpeg copies I've made from the Adobe source. Some of those files play, some don't, the issue doesn't seem to be the video data, just the format of the MP4 file holding the data.
I can change the Profile settings when outputting the Adobe file (and alter the video parameters as required to be compliant), but I don't seem to be able to alter the file format, and that's what seems to be the issue. Adobe's file format is advertising itself as mp42 (mp42/mp41), which appears to be the least compatible, although I still can't find info on any of these apps that points to where/how the exact file format gets decided, or anything that can be done to influence that one. -
I've run some more tests, including changing the profile, which "works", but I think only because the file is again re-written in a different format. The results are:
1. Adobe encoded file, video profile is Main@L4.2, file Codec ID: mp42 (mp42/mp41). This raw file plays.
2. Same Adobe file from 1, added chapter stops with Subler, file no longer playable on a variety of devices
3. Handbrake of file 1, video profile is Main@L4.2, file Codec ID: mp42 (isom/iso2/avc1/mp41). File plays
4. Same Handbrake file from 3, added chapter stops with Subler, file still plays fine.
5. ffmpeg copy of file 1, video profile is Main@L4.2, file Codec ID: isom (isom/iso2/avc1/mp41). File plays.
6. Same ffmpeg file from 5, added chapter stops with Subler, file still plays fine.
7. Handbrake of file from 2, video profile Main@L4.2, file Codec ID: mp42 (isom/iso2/avc1/mp41). File now plays.
8. ffmpeg copy of file from 2, video profile Main@L4.2, file Codec ID: isom (isom/iso2/avc1/mp41). File now plays.
9. Clever Ffmpeg-gui copy of file from 2, video profile Main@L3, file Codec ID: isom (isom/iso2/avc1/mp41). File now plays.
So the only file that doesn't play is file #2, which is the Adobe file with chapters added. Files generated from everywhere else play, and the ffmpeg files in steps 5,6 & 8 contain the identical audio/video/chapter streams as the Adobe file, ffmpeg has just formatted the file different. Step 8 has even taken the non-working Adobe file from step 2, and simply repackaged the internals, and made a working file. Step 9, changing the profile, as noted worked, but it didn't retain the Adobe file format - I doubt changing the profile had any impact here, it was simply ffmpeg under the hood re-writing the file format that fixed it. As a further test of this:
10. Adobe encoded file using profile Main@L3, file Codec ID: mp42 (mp42/mp41). This raw file plays.
11. Same Main@L3 file from 10, added chapter stops with Subler, file no longer playable.
So it seems Adobe likes to write its files as "mp42 (mp42/mp41)" format, and that file format is the primary compatibility issue. When ffmpeg copies the exact same contents from that file, just in a different format, all is good. So I'm still curious as to why Adobe is going with that format, and whether that can be changed, and also just as curious as to why ffmpeg chooses what it does, and whether that can also be set. Apart from analysing the files after the fact, and seeing these different Codec ID strings, I don't really know what is going on or why, and can't seem to find any documentation anywhere.
The obvious work around if I want the "most compatibility" is to re-package all my Adobe files with ffmpeg for now, but it would be nice to get to the bottom of what's happening, particularly if there's any drawback to that work around - this is all just guesswork right now. -
Here's Media Info for file #2 (the non-playing file)
General
Complete name : F:\adobe_chaps.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/mp41)
File size : 137 MiB
Duration : 2 min 53 s
Overall bit rate mode : Variable
Overall bit rate : 6 643 kb/s
Encoded date : UTC 2022-02-01 12:07:35
Tagged date : UTC 2022-02-01 12:37:14
TIM : 00:00:00:00
TSC : 50
TSZ : 1
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4.2
Format settings : CABAC / 3 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 3 frames
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2 min 53 s
Bit rate : 6 317 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 50.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.061
Stream size : 130 MiB (95%)
Language : English
Encoded date : UTC 2022-02-01 12:07:35
Tagged date : UTC 2022-02-01 12:07:35
Menus : 3
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 2 min 53 s
Source duration : 2 min 53 s
Bit rate mode : Variable
Bit rate : 317 kb/s
Maximum bit rate : 313 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 6.55 MiB (5%)
Source stream size : 6.55 MiB (5%)
Language : English
Default : Yes
Alternate group : 1
Encoded date : UTC 2022-02-01 12:07:35
Tagged date : UTC 2022-02-01 12:07:35
tagc : public.main-program-content
Menu
ID : 3
Codec ID : text
Duration : 2 min 53 s
Language : English
Encoded date : UTC 2022-02-01 12:37:14
Tagged date : UTC 2022-02-01 12:37:14
Bit rate mode : CBR
Menu For : 1
Duration_FirstFrame : -10960
Duration_LastFrame : -3120
00:00:00.000 : Chapter 1
00:00:51.440 : Chapter 2
00:01:53.840 : Chapter 3
Bit rate mode : Constant -
For reference, here is also Media Info for file #4 (which plays), the ffmpeg re-packaged copy of file #1, with chapters added in Subler, same as was done for #2:
General
Complete name : F:\ffmpeg_chaps.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/iso2/avc1/mp41)
File size : 137 MiB
Duration : 2 min 53 s
Overall bit rate mode : Variable
Overall bit rate : 6 641 kb/s
Tagged date : UTC 2022-02-01 12:38:02
Writing application : Lavf59.16.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4.2
Format settings : CABAC / 3 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 3 frames
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 2 min 53 s
Bit rate : 6 317 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 50.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.061
Stream size : 130 MiB (95%)
Language : English
Menus : 3
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 2 min 53 s
Bit rate mode : Variable
Bit rate : 317 kb/s
Maximum bit rate : 313 kb/s / 317 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 6.55 MiB (5%)
Language : English
Default : Yes
Alternate group : 1
tagc : public.main-program-content
Menu
ID : 3
Codec ID : text
Duration : 2 min 53 s
Language : English
Encoded date : UTC 2022-02-01 12:38:02
Tagged date : UTC 2022-02-01 12:38:02
Bit rate mode : CBR
Menu For : 1
Duration_FirstFrame : -10960
Duration_LastFrame : -3120
00:00:00.000 : Chapter 1
00:00:51.440 : Chapter 2
00:01:53.840 : Chapter 3
Bit rate mode : Constant -
Seems to me from your descriptions that the Adobe file, per se, is not at fault, but the Adobe file - AS MODIFIED BY SUBLER - is. And so it would be more likely to presume that Subler is at fault in that it cannot handle that file sub-format correctly.
Scott -
You could be right - I guess it could either be the devices barfing on not liking the chapters in combination with the stated file format, or Subler might be doing something non-compliant with the file. Although just about everything else still plays the file, just the older devices having issues, so it's difficult to know on which side the problem lies.
Short of digging in with a hex editor, I'm not sure if there's anywhere further I can go from here. Even then I'd still need a lot more documentation on the file formats of the various compatible brands, to be able to validate if the files are correct to what is expected or not. And at the end of the day, I guess it's still not fixable anyway - Adobe is still going to output their format, with no apparent option to do otherwise, and feeding the chapter marks into that format is going to give me a file that won't work on some devices.
For now I will likely just re-package the Adobe files through ffmpeg, which doesn't appear to create any subsequent issue. I've also discovered the Voukoder plug-in, which generates it's files closer to the ffmpeg style as well, maybe the solution is to use that as the encoder. It seems from this that the outputted file format goes hand in hand with the encoder, I had previously assumed the encoder just created the audio/video streams, and Adobe packaged the final output, but that seems not to be the case. So while I can't force Adobe to use a different format on their files, at least I've learned a few new things about how the process works while looking into this!
Thanks everyone for your help.
Similar Threads
-
How to change date and time of MP4 (or any format) video file ?
By chetan_bokhani in forum Newbie / General discussionsReplies: 5Last Post: 3rd Mar 2022, 10:11 -
Error: The file 'MKV3D_3D.264' could not be opened for reading: end of file
By xenomatic in forum Newbie / General discussionsReplies: 26Last Post: 31st Dec 2021, 18:11 -
Original file in mp4 format from Reflecta 8mm Super 8mm scanner
By Sajmon in forum RestorationReplies: 0Last Post: 27th Feb 2021, 11:56 -
How To Convert .m3u8 file in MP4 Format
By Aashik420 in forum Video Streaming DownloadingReplies: 5Last Post: 30th Jul 2018, 22:55 -
Can I convert videos from a DVD to a file format such as MP3/MP4 surround?
By R.STEED in forum Video ConversionReplies: 1Last Post: 29th Sep 2017, 10:12