summaryrefslogtreecommitdiff
path: root/libavformat/mxfenc.c
Commit message (Collapse)AuthorAge
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/packet_internal: make avpriv_packet_list_* functions use an internal ↵James Almer2021-03-17
| | | | | | | | | struct The next pointer is kept at the end for backwards compatability until the major bump, when it should ideally be moved at the front. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mxfenc: Discard audio until valid video has been receivedAndreas Rheinhardt2021-02-16
| | | | | | | | | | | | | Normally, video packets are muxed before audio packets for mxf (there is a dedicated interleave function for this); furthermore the first (video) packet triggers writing the actual header. Yet when the first video packet fails the checks performed on it, it will be an audio packet that leads to writing the header and codec_ul (a value set based upon properties of the bitstream which necessitates actually inspecting packets) may be wrong. Therefore this commit discards audio packets until a valid video packet has been received. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfenc: Fix typoAndreas Rheinhardt2021-02-16
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfenc: Use user-specified version even when bitexactAndreas Rheinhardt2021-02-16
| | | | | | Doing so is still bitexact. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfenc: Never set codec_ul UID to NULLAndreas Rheinhardt2021-02-16
| | | | | | | | | | | | | | | | | mxf distinguishes codec profiles by different UIDs and therefore needs to check that the input is actually compatible with mxf (i.e. if there is a defined UID for it). If not, then sometimes the UID would be set to NULL and writing the (video) packet would fail. Yet the following audio packet would trigger writing the header (which has been postponed because the UID is not known at the start) and if the UID is NULL, this can lead to segfaults. This commit therefore stops setting the UID to NULL if the input is incompatible with mxf (it has initially been set to a generic value in mxf_write_header()). Fixes #7993. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfenc: prefer to use the configured metadataLimin Wang2021-02-05
| | | | | | | | | | | | | | | | The metadata company_name, product_name, product_version from input file will be deleted to avoid overwriting information Please to test with below commands: ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf and ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy \ -metadata company_name="xxx" \ -metadata product_name="xxx" \ -metadata product_version="xxx" \ out.mxf Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mxf: add platform local tagLimin Wang2021-02-05
| | | | | | | | | | | Please check the string of platform with below command: ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf ./ffmpeg -i out.mxf .... application_platform: Lavf (linux) Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mxf: Establish register of local tagsTomas Härdin2021-02-01
| | | | | | Tags can be marked "not used" upfront, saving some space in the primer. av_asserts0() is used to enforce that only tags that are in the primer can actually be written. Sharing of MasteringDisplay ULs is now done via macros.
* avformat/mxfenc: add Coding Equations and Color Primaries to local tagsMarton Balint2021-01-27
| | | | | | Fixes ticket #9079. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxf: Deduplicate random_index_pack_keyAndreas Rheinhardt2021-01-08
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavf: move AVStream.last_in_packet_buffer to AVStreamInternalAnton Khirnov2020-10-28
| | | | | Those are private fields, no reason to have them exposed in a public header.
* avformat/mxfenc: Write Mastering Display Colour Volume to MXFHarry Mallon2020-09-17
| | | | | | Described in Annex B SMPTE ST 2067-21:2020 Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* avformat/mxfdec: Read Mastering Display Colour Volume from MXFHarry Mallon2020-09-17
| | | | | | Described in Annex B SMPTE ST 2067-21:2020 Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* libavformat/mxfenc: color_range should be inclusiveHarry Mallon2020-08-29
| | | | | | | | MXF CDCI color range was being set to (1<<sc->component_depth) - 1 for full range but it should be (1<<sc->component_depth) as 0 is a valid value. Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* avformat/mxfenc: Write color metadata to MXFHarry Mallon2020-08-12
| | | | | | | Writes color_primaries, color_trc and color_space to mxf headers. ULs are from https://registry.smpte-ra.org/ site. Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* avformat/avc, mxfenc: Avoid allocation of H264 SPS structure, fix memleakAndreas Rheinhardt2020-06-26
| | | | | | | | | | | | | | | | | | | | | | Up until now, ff_avc_decode_sps would parse a SPS and return some properties from it in a freshly allocated structure. Yet said structure is very small and completely internal to libavformat, so there is no reason to use the heap for it. This commit therefore changes the function to return an int and to modify a caller-provided structure. This will also allow ff_avc_decode_sps to return better error codes in the future. It also fixes a memleak in mxfenc: If a packet contained multiple SPS, only the SPS structure belonging to the last SPS would be freed, the other ones would leak when the pointer is overwritten to point to the new SPS structure. Of course, without allocations there are no leaks. This is Coverity issue #1445194. Furthermore, the SPS structure has been renamed from H264SequenceParameterSet to H264SPS in order to avoid overlong lines. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: implement retiming directly in mxfenc and gxfencMarton Balint2020-05-07
| | | | | | | | | | Generic retime functionality is replaced by a few lines of code directly in the muxers which used it, which seems a lot easier to understand and this way the retiming is not dependant of the input durations. Also remove retimeinterleave, since it is not used by anything anymore. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/audiointerleave: only keep the retime functionality of the audio ↵Marton Balint2020-05-07
| | | | | | | | | | | interleaver And rename it to retimeinterleave, use the pcm_rechunk bitstream filter for rechunking. By seperating the two functions we hopefully get cleaner code. Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat/mux, mxfenc: Don't initialize unnecessarilyAndreas Rheinhardt2020-04-18
| | | | | | | | | | | When no packet could be output, the interleavement functions nevertheless initialized the packet destined for output (with the exception of the data and size fields, making the initialization pointless), although it will not be used at all. So remove the initializations. Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfenc: allow all frame rates if -strict mode is set to unofficial ↵Marton Balint2020-03-14
| | | | | | | | | | or lower There was no consensus wheter or not to allow unofficial frame rates due to possible interoperability issues, a compromise is to only allow it if -strict mode is set to unofficial. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfenc: factorize timecode checking and settingMarton Balint2020-03-14
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxf: get rid of samples per frame array usageMarton Balint2020-03-14
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/audiointerleave: disallow using a samples_per_frame arrayMarton Balint2020-03-14
| | | | | | | Only MXF used an actual sample array, and that is unneeded there because simple rounding rules can be used instead. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfenc: Reorder fields in MXFIndexEntry to make it smallerAndreas Rheinhardt2020-03-14
| | | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfenc: use a zero based continuity counterMarton Balint2020-03-02
| | | | | | | | | | The standard does not seem to require the counter to be zero based, but some checker tools (MyriadBits MXFInspect, Interra Baton) have validations against 0 start... Fixes ticket #6781. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfenc: Add deinit functionAndreas Rheinhardt2020-01-26
| | | | | | | | Fixes memleaks when allocating the private data of the timecode_track fails or when the trailer is never written. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfenc: Don't free priv_data of AVStreamAndreas Rheinhardt2020-01-26
| | | | | | | It will be freed when the AVStream is freed later anyway. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: convert some avio_flush() calls to ↵Marton Balint2020-01-07
| | | | | | | | | | | | | | | | | avio_write_marker(AVIO_DATA_MARKER_FLUSH_POINT) Converting explicit avio_flush() calls helps us to buffer more data and avoid flushing the IO context too often which causes reduced IO throughput for non-streamed file output. The user can control FLUSH_POINT flushing behaviour using the -flush_packets option, the default typically means to flush unless a non-streamed file output is used, so this change should have no adverse effect on streaming even if it is assumed that after an avio_flush() the output buffer is clean so small seekbacks within the output buffer will work even when the IO context is not seekable. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: remove avio_flush() calls from the end of write_packet functionsMarton Balint2020-01-07
| | | | | | | | | | | | | | | | Removing explicit avio_flush() calls helps us to buffer more data and avoid flushing the IO context too often which causes reduced IO throughput for non-streamed file output. The user can control flushing behaviour at the end of every packet using the -flush_packets option, the default typically means to flush unless a non-streamed file output is used. Therefore this change should have no adverse effect on streaming, even if it is assumed that a new packet has a clean buffer so small seekbacks within the output buffer work even when the IO context is not seekable. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfenc: simplify d-10 ul handlingBaptiste Coudurier2019-11-23
|
* avformat/mxfenc: simplify dv ul handlingBaptiste Coudurier2019-11-23
|
* avformat/mxfenc: correctly set width values for dvcprohdBaptiste Coudurier2019-11-13
|
* avformat/mxfenc: fix warning: unused function 'klv_ber_length' ↵Limin Wang2019-09-04
| | | | | | [-Wunused-function] Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mux: Use const AVPacket * in compare functionsAndreas Rheinhardt2019-08-15
| | | | | | | | | There is no reason for these functions to modify the given packets at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfenc: fix index byte count in partition headerBaptiste Coudurier2019-07-22
|
* avformat/mxfenc: support XAVC long gopBaptiste Coudurier2019-05-20
|
* avformat/mxfenc: allow user comments for opatom muxerMark Reid2019-03-13
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfenc: support writing subsecond precision timestampsMarton Balint2018-12-25
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfenc: fix typoPaul B Mahol2018-12-17
|
* avformat/mxfenc: calculate and store DAR from user SARPaul B Mahol2018-12-10
|
* avformat/mxfenc: allow muxing proresPaul B Mahol2018-12-10
|
* avformat/mxfenc: simplify dnxhd handling and add more flavorsBaptiste Coudurier2018-10-24
|
* lavf/mxfenc: Remove a write-only variable.Carl Eugen Hoyos2018-10-17
| | | | | Fixes the following warning: libavformat/mxfenc.c:2125:22: warning: variable 'frame_size' set but not used
* lavf/mxfenc: Remove two unused variables.Carl Eugen Hoyos2018-10-13
| | | | | | Fixes the following warnings: libavformat/mxfenc.c:2036:9: warning: unused variable 'i' libavformat/mxfenc.c:2125:9: warning: unused variable 'i'
* lavf/mxfenc: support creating s436m data tracksBaptiste Coudurier2018-10-12
|
* avformat/mxfenc: correctly set content package rate in system elementBaptiste Coudurier2018-10-12
|
* avformat/mxfenc: update body partition with footer offsetBaptiste Coudurier2018-10-12
|
* avformat/mxfenc: add mpeg-2 specific metadata, fix compatibility with sony ↵Baptiste Coudurier2018-10-12
| | | | content browser
* avformat/mxfenc: write index delta entry array needed by sony vegas pro 11Baptiste Coudurier2018-10-12
|