Also make sure we set a valid track index sid and a valid track edit rate in
order for the index to be useful.
Signed-off-by: Marton Balint <cus@passwd.hu>
Consider edit rate when determining edit_units_per_packet and also make sure
that checks are done in edit rate time base and not in stream time base.
Fixes some errors reported with the sample in ticket #5863.
Signed-off-by: Marton Balint <cus@passwd.hu>
Obviously this is still not perfect, but better then it was. Using the first
index table and mxf->current_edit_unit is still hardcoded in many places, so
this change has hopefully the less chance of breaking anything that works
now.
Signed-off-by: Marton Balint <cus@passwd.hu>
Use body_offset of the partitions to search for the partition with the given
offset in the essence. This makes the function find the correct partition for
non frame-wrapped essences as well, where only the essence data is part of the
the edit unit byte count, not the KLV-s.
Signed-off-by: Marton Balint <cus@passwd.hu>
In order to do that we have to parse the EssenceContainerData and assign the
proper body_sid and index_sid to the tracks from the corresponding source
packages.
This fixes packets returned in the wrong stream for some OP1-b files.
Based on a patch by Alex Mogurenko from https://github.com/da8eat/FFmpeg
Reference: http://mogurenko.com/2018/01/02/mxf-op1b-ffmpeg-part1/
Signed-off-by: Marton Balint <cus@passwd.hu>
The reference point for a KAG is the first byte of the key of a Partition Pack.
Fixes ticket #2817.
Fixes ticket #5317.
Signed-off-by: Marton Balint <cus@passwd.hu>
The current edit unit cannot be reliably determined for the last packet of a
video stream, because we can't query the start offset of the next edit unit
from the index. This caused missing timestamps for the last video packet.
Therefore from now on, we allow setting the PTS even if we are not sure of the
current edit unit if mxf_set_current_edit_unit returned a specific failure, and
the assumed current edit unit is the last.
Fixes last packet timestamp of:
ffprobe -fflags nofillin -show_packets tests/data/lavf/lavf.mxf -select_streams v
Signed-off-by: Marton Balint <cus@passwd.hu>
Fixes: 20170829B.mxf
Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com>
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Fixes: 20170829A.mxf
Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com>
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Metadata streams have priv_data set to NULL.
Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Metadata streams have priv_data set to NULL.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Read video_line_map from MXF generic picture essence descriptor and use
it to derive the coded field order. Use field_dominance to derive the
display field order from coded field order. If field_dominance is not
available the default value "1" is used as defined in SMPTE S377-1.
Fixes field_order detection for a bunch of DV/DVCPRO files. The heuristic
for deriving coded field order from video_line_map is inspired by
MediaInfo.
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
It is supposed to be a flag. The only currently defined value is
AVIO_SEEKABLE_NORMAL, but other ones may be added in the future.
However all the current lavf code treats this field as a bool (mainly
for historical reasons).
Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
Use proper ISO 8601 timestamps which also signal that they are in UTC.
This changes the format of creation_time and modification_date metadata values
from 2016-06-01 22:30:00 to 2016-01-01T22:30:00.000000Z
Fixes ticket #5673.
Signed-off-by: Marton Balint <cus@passwd.hu>