Commit Graph

390 Commits

Author SHA1 Message Date
Marton Balint 8360fd2610 avformat: implement retiming directly in mxfenc and gxfenc
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>
2020-05-07 23:12:24 +02:00
Marton Balint c5324d92c5 avformat/audiointerleave: only keep the retime functionality of the audio 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>
2020-05-07 23:12:24 +02:00
Andreas Rheinhardt e79309fde6 libavformat/mux, mxfenc: Don't initialize unnecessarily
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>
2020-04-18 01:24:56 +02:00
Marton Balint 425b6a9a2c avformat/mxfenc: allow all frame rates if -strict mode is set to unofficial 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>
2020-03-14 22:25:25 +01:00
Marton Balint 331b96acb5 avformat/mxfenc: factorize timecode checking and setting
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-14 22:25:25 +01:00
Marton Balint 27a8146990 avformat/mxf: get rid of samples per frame array usage
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-14 22:25:25 +01:00
Marton Balint aef2016bb0 avformat/audiointerleave: disallow using a samples_per_frame array
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>
2020-03-14 22:25:25 +01:00
Andreas Rheinhardt 1fea6795a3 avformat/mxfenc: Reorder fields in MXFIndexEntry to make it smaller
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>
2020-03-14 18:24:04 +01:00
Marton Balint 121b6c7aa7 avformat/mxfenc: use a zero based continuity counter
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>
2020-03-02 22:01:47 +01:00
Andreas Rheinhardt e6aa9b11bf avformat/mxfenc: Add deinit function
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>
2020-01-26 17:24:41 +01:00
Andreas Rheinhardt 360aeccf46 avformat/mxfenc: Don't free priv_data of AVStream
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>
2020-01-26 17:24:41 +01:00
Marton Balint 3414115cd4 avformat: convert some avio_flush() calls to 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>
2020-01-07 21:51:45 +01:00
Marton Balint c371463915 avformat: remove avio_flush() calls from the end of write_packet functions
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>
2020-01-07 21:51:45 +01:00
Baptiste Coudurier d65aaf8ea9 avformat/mxfenc: simplify d-10 ul handling 2019-11-23 11:02:04 -08:00
Baptiste Coudurier 635a5c11a6 avformat/mxfenc: simplify dv ul handling 2019-11-23 11:02:04 -08:00
Baptiste Coudurier 11a38be99c avformat/mxfenc: correctly set width values for dvcprohd 2019-11-13 08:53:27 -08:00
Limin Wang 787c56b9e9 avformat/mxfenc: fix warning: unused function 'klv_ber_length' [-Wunused-function]
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2019-09-04 18:55:00 +02:00
Andreas Rheinhardt 1147759552 avformat/mux: Use const AVPacket * in compare functions
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>
2019-08-15 01:26:21 +02:00
Baptiste Coudurier 9e24b98b15 avformat/mxfenc: fix index byte count in partition header 2019-07-22 13:17:42 -07:00
Baptiste Coudurier b401a4ab8a avformat/mxfenc: support XAVC long gop 2019-05-20 11:58:12 -07:00
Mark Reid 283ce69a10 avformat/mxfenc: allow user comments for opatom muxer
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-03-13 12:39:51 +01:00
Marton Balint 70c86deb8e avformat/mxfenc: support writing subsecond precision timestamps
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-12-25 20:16:29 +01:00
Paul B Mahol 7b2a9aaa0b avformat/mxfenc: fix typo 2018-12-17 21:06:36 +01:00
Paul B Mahol 14156e607d avformat/mxfenc: calculate and store DAR from user SAR 2018-12-10 17:35:38 +01:00
Paul B Mahol 5e0d54a031 avformat/mxfenc: allow muxing prores 2018-12-10 17:25:49 +01:00
Baptiste Coudurier 8c733013af avformat/mxfenc: simplify dnxhd handling and add more flavors 2018-10-24 09:07:19 -07:00
Carl Eugen Hoyos b9136c1b90 lavf/mxfenc: Remove a write-only variable.
Fixes the following warning:
libavformat/mxfenc.c:2125:22: warning: variable 'frame_size' set but not used
2018-10-17 20:47:14 +02:00
Carl Eugen Hoyos b4e29e6225 lavf/mxfenc: Remove two unused variables.
Fixes the following warnings:
libavformat/mxfenc.c:2036:9: warning: unused variable 'i'
libavformat/mxfenc.c:2125:9: warning: unused variable 'i'
2018-10-13 13:08:32 +02:00
Baptiste Coudurier 9b7ab57953 lavf/mxfenc: support creating s436m data tracks 2018-10-12 12:28:22 -07:00
Baptiste Coudurier bb89109a0a avformat/mxfenc: correctly set content package rate in system element 2018-10-12 12:27:58 -07:00
Baptiste Coudurier 84e8a87ca0 avformat/mxfenc: update body partition with footer offset 2018-10-12 12:27:43 -07:00
Baptiste Coudurier ea55a11ced avformat/mxfenc: add mpeg-2 specific metadata, fix compatibility with sony content browser 2018-10-12 12:26:01 -07:00
Baptiste Coudurier 3d38e45eb8 avformat/mxfenc: write index delta entry array needed by sony vegas pro 11 2018-10-12 12:15:38 -07:00
Jason Stevens 384dcd66a2 libavformat/mxfenc: fix dnxhr ul typo
byte 8 of dnxhr codec ul should be 0x0D

Signed-off-by: Jason Stevens <jay@wizardofthenet.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-15 20:00:45 +02:00
Jason Stevens 5632044939 libavformat/mxfenc: add missing dnxhr mxfcontainer essence ULs
Add missing dnxhr mxf container essence ULs to the mxf encoder.

This fixes dnxhr mxf files being quarantined by Avid Media Composer.

Signed-off-by: Jason Stevens <jay@wizardofthenet.com>

Reviewed-by: Baptiste Coudurier
2018-09-10 23:17:54 +02:00
Baptiste Coudurier 130de9142e avformat/mxfenc: automatically update descriptors klv size 2018-08-22 08:07:35 -07:00
Baptiste Coudurier 955a989341 avformat/mxfenc: fix muxing when audio tracks are longer than video track 2018-08-21 12:10:41 -07:00
Michael Niedermayer df3d962d2e libavformat/mxfenc: Add some () to attempt to workaround build issue on osx
fixes ticket7209

Tested-by: Jim DeLaHunt <from.ffmpeg-dev@jdlh.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-27 21:38:33 +02:00
Michael Niedermayer 10ca419dd8 avformat/mxfenc: Set color siting to 0 for D10-MXF
SMPTE 386M (D-10) lists 4 as value to be used
SMPTE 377-1-2009 says
    "The definitions of 00h (coSiting) and 04h (Rec 601) are equivalent. The value of 04h is deprecated. New
     MXF encoders shall use the value of 00h instead."

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-12 01:08:01 +02:00
Michael Niedermayer d628caf54f avformat/mxfenc: Add Sample width/height/x offset/y offset, Display x offset and F2 offset
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-12 01:08:01 +02:00
Thomas Mundt a3a6d4da62 avformat/mxfenc: add h264 profiles
Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-10 02:10:12 +02:00
Michael Niedermayer 293a6e8332 avformat/mxfenc: Write transfer characteristic
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00
Michael Niedermayer c35ca7e01c avformat/mxfenc: Add Stored F2 Offset / Image Start/End Offset for D10
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00
Michael Niedermayer 530ac1e50b avformat/mxfenc: Write Audio Ref Level for D10
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00
Michael Niedermayer 1246754c80 avformat/mxfenc: Add Padding Bits
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00
Michael Niedermayer 6d0339096e avformat/mxfenc: add white/black ref /color range
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00
Michael Niedermayer 2bee43b67d avformat/mxfenc: Add vertical subsampling support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00
Michael Niedermayer 77cbe698cd avformat/mxfenc: Fix stored width
This fixes the width to have computations matching the height

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00
Michael Niedermayer 1b6c89ca8d avformat/mxfenc: Add object model version
Other tools (XFConvert at least) write this as well.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00
Michael Niedermayer 86c9250923 avformat/mxfenc: Add Product Version, Toolkit version and Platform
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-08 23:02:58 +02:00