On Wed, 29 Oct 2014, Yusuke Nakamura wrote:
2014-10-29 22:54 GMT+09:00 Martin Storsjö <[email protected]>:
On Wed, 29 Oct 2014, Yusuke Nakamura wrote:
2014-10-29 22:00 GMT+09:00 Martin Storsjö <[email protected]>:
On Wed, 29 Oct 2014, Yusuke Nakamura wrote:
This patch produces out-of-spec files about the file format
compatibility.
Fragmented files with default-base-is-moof shall not contain brands
earlier
than iso5.
I know such broken files exist e.g. DASH-IF test vectors, but the spec
clearly says that default-base-is-moof shall not be set under the
earlier
brands even if moof contains only one traf.
Right, so would it be ok if I'd add something like this:
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2881,8 +2881,12 @@ static int mov_write_ftyp_tag(AVIOContext *pb,
AVFormatCo
ffio_wfourcc(pb, "piff");
ffio_wfourcc(pb, "iso2");
} else {
- ffio_wfourcc(pb, "isom");
- ffio_wfourcc(pb, "iso2");
+ if (mov->flags & FF_MOV_FLAG_DEFAULT_BASE_MOOF) {
+ ffio_wfourcc(pb, "iso5");
+ } else {
+ ffio_wfourcc(pb, "isom");
+ ffio_wfourcc(pb, "iso2");
+ }
if (has_h264)
ffio_wfourcc(pb, "avc1");
}
(Possibly the same also for the ISM case above.)
Still insufficient because of major_brand when mov->mode == MODE_MP4.
And "brand" option could also produce broken files.
Sure, the brand option obviously can produce anything...
So, if we are using default-base-is-moof, we should set major == iso5 and
not include any extra isom/iso2 in compatible_brands, right? But it's ok to
keep e.g. avc1 in that list?
More or less right.
To begin with, the use of the brands of ISOBMFF for the major_brand is not
preferable as the spec says (at Annex E.1).
If using default-base-is-moof, we shall not include isom, avc1, iso2, iso3
and iso4 in major_brand and compatible_brands.
The avc1 brand is positioned between isom and iso2 brand and not an AVC
specific brand contrary to its name.
By the way, tfdt is defined in iso6 or later brands.
So, adding iso6 brand is strongly preferable for writing tfdt by another
preceding patch.
Should we set iso6 as major_brand unconditionally when using tfdt and
remove all other iso* compatible brands as well, or is it ok to keep it as
isom and just add iso6 in the list of compatible brands? A file that uses
tfdt should be mostly playable even if a player doesn't understand tfdt
(unless the start is truncated), contrary to default-base-is-moof which
completely breaks reading by anybody who doesn't understand it.
There is no incompatibility within ISOBMFF about the use of tfdt, so it is
ok to keep the earlier brands when adding iso6 brand.
As long as keeping the compatibility, you can add any box in ISOBMFF and
its derived file formats.
Ok, so hopefully I've got it right now, in the following 2 patches.
// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel