summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
Commit message (Collapse)AuthorAge
* avformat/movenc: Ensure packet is writable before modifying itAndreas Rheinhardt2022-07-09
| | | | | | | | Fixes e.g. ffmpeg -i fate-suite/h264/bbc2.sample.h264 -c:v rawvideo -map 0:v -frames:v 10 -pix_fmt gray8 -f tee "first.mov|second.mov" Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Fix invalid checkAndreas Rheinhardt2022-06-30
| | | | | | | | Regression since c9de096851803d45444ae9dfe3a390a2d53ac71b. Fixes Coverity ID 1506839. Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: limit ISOBMFF AC-3 mapping to bsids <=8Jan Ekström2022-06-30
| | | | | | | | | | This leaves out RealAudio DolbyNet, which utilizes bsids 9 and 10, It is not clear whether the interpreted bit rate value (divided by 2 or 4 depending on the variant), or the original bit rate value should be utilized to receive the bit_rate_code index. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/movenc: handle OOM situations when parsing AC-3 headersJan Ekström2022-06-30
| | | | Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/movenc: utilize existing AC-3 parsing workflow for AC-3Jan Ekström2022-06-30
| | | | Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/movenc: move eac3_info definition so that it can be used for AC-3Jan Ekström2022-06-30
| | | | Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/movenc: enable handle_eac3 to handle AC-3 tracksJan Ekström2022-06-30
| | | | | | | | | | | Add the AC-3 frame type, as well as early exit from additional packet parsing in case of AC-3, as only a single packet is required to get the required information. Additionally, expose ac3_bit_rate_code via the eac3_info struct as it is required for AC3SpecificBox. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* {configure,avformat/movenc}: enable AC-3 parser for movencJan Ekström2022-06-30
| | | | | | | | | | | | This simplifies the code to no longer have #ifs in a manner which does not require handling avpriv_ac3_parse_header returning ENOSYS. As an existing example, the MPEG-TS muxer already requires the AC-3 parser, and in order to fix existing issues with the current AC-3 movenc code, switching to use the AC-3 parser is required, so this is an enabling change for that. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/movenc: Support alpha channel for AVIFVignesh Venkatasubramanian2022-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AVIF specification allows for alpha channel as an auxiliary item (in case of still images) or as an auxiliary track (in case of animated images). Add support for both of these. The AVIF muxer will take exactly two streams (when alpha is present) as input (first one being the YUV planes and the second one being the alpha plane). The input has to come from two different images (one of it color and the other one being alpha), or it can come from a single file source with the alpha channel extracted using the "alphaextract" filter. Example using alphaextract: ffmpeg -i rgba.png -filter_complex "[0:v]alphaextract[a]" -map 0 -map "[a]" -still-picture 1 avif_with_alpha.avif Example using two sources (first source can be in any pixel format and the second source has to be in monochrome grey pixel format): ffmpeg -i color.avif -i grey.avif -map 0 -map 1 -c copy avif_with_alpha.avif The generated files pass the compliance checks in Compliance Warden: https://github.com/gpac/ComplianceWarden libavif (the reference avif library) is able to decode the files generated using this patch. They also play back properly (with transparent background) in: 1) Chrome 2) Firefox (only still AVIF, no animation support) Reviewed-by: James Zern <jzern@google.com> Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
* avformat/movenc: enable compressorname for mp4 modeZhao Zhili2022-06-24
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/mov: refactor to use avutil/uuidPierre-Anthony Lemieux2022-06-12
|
* avformat/movenc: Add support for AVIF muxingVignesh Venkatasubramanian2022-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an AVIF muxer by re-using the existing the mov/mp4 muxer. AVIF Specification: https://aomediacodec.github.io/av1-avif Sample usage for still image: ffmpeg -i image.png -c:v libaom-av1 -still-picture 1 image.avif Sample usage for animated AVIF image: ffmpeg -i video.mp4 animated.avif We can re-use any of the AV1 encoding options that will make sense for image encoding (like bitrate, tiles, encoding speed, etc). The files generated by this muxer has been verified to be valid AVIF files by the following: 1) Displays on Chrome (both still and animated images). 2) Displays on Firefox (only still images, firefox does not support animated AVIF yet). 3) Verified to be valid by Compliance Warden: https://github.com/gpac/ComplianceWarden Fixes the encoder/muxer part of Trac Ticket #7621 Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
* avformat/av1: Add a parameter to av1c to omit seq headerVignesh Venkatasubramanian2022-05-13
| | | | | | | | | Add a parameter to omit seq header when generating the av1C atom. For now, this does not change any behavior. This will be used by a follow-up patch to add AVIF support. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
* avformat/utils: Move ff_get_packet_palette() to rawutils.cAndreas Rheinhardt2022-05-10
| | | | | | | | | | ff_get_packet_palette() and ff_reshuffle_raw_rgb() belong together: E.g. the former takes the return value of the latter as argument. So move ff_get_packet_palette() to rawutils.c (which consists solely of ff_reshuffle_raw_rgb()). Also add a separate header for these two functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/internal: Move muxing-only functions to new mux.h headerAndreas Rheinhardt2022-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* movenc: add write_btrt optionerankor2022-05-02
| | | | | | | supports forcing or disabling the writing of the btrt atom. the default behavior is to write the atom only for mp4 mode. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/movenc: sidx earliest_presentation_time is applied after editlistZhao Zhili2022-04-29
| | | | | | Fix #8334 Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/movenc: don't use mono layout when a front center label is expectedJames Almer2022-04-05
| | | | | | | | | | | | | | | | On output streams where a multichannel stream needs to be stored as one track per channel, each track will have a channel layout describing the position of the channel they contain. For the track with front center, the mov muxer was using the mov layout "mono" instead of the label for the front center position. Since our channel layout API considers front center == mono, we need to do some heuristics. To achieve this, we make sure all audio tracks contain streams with a single channel, and only one of them is front center. In that case, we write the front center label instead of signaling mono layout. Fixes the last part of ticket #2865 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: write channel descriptions when a known layout or a bitmap ↵James Almer2022-04-05
| | | | | | | | can't be used Fixes part of ticket #2865 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: use warning log level and small adjustment for the logLimin Wang2022-03-22
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/movenc: initialize pts/dts of timecode packetLimin Wang2022-03-22
| | | | | | | | | | | | | | | Fix below error message when timecode packet is written. "Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format" try to reproduce by: ffmpeg -y -f lavfi -i color -metadata "timecode=00:00:00:00" -t 1 test.mov Note although error message is printed, the timecode packet will be written anyway. So the patch 2/2 will try to change the log level to warning. Fixes ticket #9488 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-16
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Split version.hMartin Storsjö2022-03-16
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: convert to new channel layout APIVittorio Giovara2022-03-15
| | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* movenc: Use LIBAVFORMAT_IDENT instead of LIBAVCODEC_IDENTMartin Storsjö2022-03-13
| | | | | | | | The muxer seems to have had one seemingly accidental use of LIBAVCODEC_IDENT, while LIBAVFORMAT_IDENT probably is the relevant one (which is used multiple times in the same file). Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/movenc: Simplify creating chapter track extradataAndreas Rheinhardt2022-03-11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: fix duration in mdhd boxZhao Zhili2022-01-10
| | | | | | | mvhd and tkhd present the post-editlist duration, while mdhd should have the pre-editlist duration. Regression since c2424b1f3. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/packet_internal: Add proper PacketList structAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | Up until now, we had a PacketList structure which is actually a PacketListEntry; a proper PacketList did not exist and all the related functions just passed pointers to pointers to the head and tail elements around. All these pointers were actually consecutive elements of their containing structs, i.e. the users already treated them as if they were a struct. So add a proper PacketList struct and rename the current PacketList to PacketListEntry; also make the functions use this structure instead of the pair of pointers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/utils: Unavpriv avpriv_toupper4()Andreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | This function is quite small (96B with GCC 11.2 on x64 Ubuntu 21.10 at -O3), making it more economical to duplicate it into libavformat instead of exporting it as avpriv: Doing so saves 2x24B in .dynsim, 2x16B in .dynstr, 2x2B .gnu.version, 24B in .rela.plt, 16B in .plt, 16B in .plt.sec (if enabled), 4B .gnu.hash; besides the actual duplicated code this also adds 2x8B .eh_frame_hdr and 24B .eh_frame. In other words: Duplicating is neutral size-wise (it is also presumed neutral for other systems). Given that it avoids the runtime overhead of dynamic symbols, it is advantageouos to duplicate the function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/raw: Reduce number of avpriv symbolsAndreas Rheinhardt2022-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libavcodec currently exports four avpriv symbols that deal with PixelFormatTags: avpriv_get_raw_pix_fmt_tags, avpriv_find_pix_fmt, avpriv_pix_fmt_bps_avi and avpriv_pix_fmt_bps_mov. The latter two are lists of PixelFormatTags, the former returns such a list and the second searches a list for a pixel format that matches a given fourcc; only one of the aforementioned three lists is ever searched. Yet for avpriv_pix_fmt_bps_avi, avpriv_pix_fmt_bps_mov and avpriv_find_pix_fmt the overhead of exporting these functions actually exceeds the size of said objects (at least for ELF; the following numbers are for x64 Ubuntu 20.10): The code size of avpriv_find_pix_fmt is small (GCC 10.2 37B, Clang 11 41B), yet exporting it adds a 20B string for the name alone to the exporting as well as to each importing library; there is more: Four bytes in the exporting libraries .gnu.hash; two bytes each for the exporting as well as each importing libraries .gnu.version; 24B in the exporting as well as each importing libraries .dynsym; 16B+24B for an entry in .plt as well as the accompanying relocation entry in .rela.plt for each importing library. The overhead for the lists is similar: The strings are 23B and the .plt+.rela.plt pair is replaced by 8B+24B for an entry in .got and a relocation entry in .rela.dyn. These lists have a size of 80 resp. 72 bytes. Yet for ff_raw_pix_fmt_tags, exporting it is advantageous compared to duplicating it into libavformat and potentially libavdevice. Therefore this commit replaces all library uses of the four symbols with a single function that is exported for shared builds. It has an enum parameter to choose the desired list besides the parameter for the fourcc. New lists can be supported with new enum values. Unfortunately, avpriv_get_raw_pix_fmt_tags could not be removed, as the fourcc2pixfmt tool uses the table of raw pix fmts. No other user of this function remains. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Use dedicated pointer for access to MOVTrackAndreas Rheinhardt2022-01-04
| | | | | | | | | Improves readability and slightly decreases codesize. While just at it, also remove a check whether the packet list is nonempty before freeing it, as freeing an empty list is fine and basically a no-op. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/(aiff|flac|mov|mp3|tta)enc: Don't create unnecessary referencesAndreas Rheinhardt2022-01-04
| | | | | | | | | The packet given to muxers is not used afterwards; it is always unreferenced by libavformat. Ergo muxers are allowed to keep the references in the packets and e.g. move the ownership to a packet list. This is what this commit does. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Refactor mov_write_dvcc_dvvc_tag to use ff_isom_put_dvcc_dvvcquietvoid2022-01-04
| | | | | | | | Improves code legibility by not using bit shifts. Also avoids duplicating the dvcC/dvvC ISOM box writing code. Signed-off-by: quietvoid <tcChlisop0@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: factorize data shiftingMarton Balint2022-01-03
| | | | | | And move data shift function from movenc to utils. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/utils: Make ff_data_to_hex() zero-terminate the stringAndreas Rheinhardt2021-12-08
| | | | | | Most callers want it that way anyway. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Avoid allocation of AVPacketAndreas Rheinhardt2021-11-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Add AVStream parameter to check_bitstream() sigAndreas Rheinhardt2021-11-27
| | | | | | | | | | For most check_bitstream() functions this just avoids having to dereference s->streams[pkt->stream_index] themselves; but for meta-muxers it will allow to forward the packet to stream with a different stream_index (belonging to a different AVFormatContext) without using a spare packet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mov: make STTS duration unsigned intGyan Doshi2021-11-22
| | | | | | | | | | As per 8.6.1.2.2 of ISO/IEC 14496-12:2015(E), STTS sample offsets are to be always stored as uint32_t. So far, they have been signed ints which led to desync in files with very large offsets. The MOVStts struct was used to store CTTS offsets as well. These can be negative in version 1. So a new struct MOVCtts was created and all declarations for CTTS usage changed to MOVCtts.
* avformat/movenc: support dvwC box for Dolby VisionLimin Wang2021-10-28
| | | | | | By <<Dolby Vision Streams Within the ISO Base Media File Format Version 2.2>> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/{isom,mov,movenc}: add support for CMAF DASH rolesJan Ekström2021-10-04
| | | | | | | | | | | | | | | | This information is coded in a standard MP4 KindBox and utilizes the scheme and values as per the DASH role scheme defined in MPEG-DASH. Other schemes are technically allowed, but where multiple schemes define the same concepts, the DASH scheme should be utilized. Such flagging is additionally utilized by the DASH-IF CMAF ingest specification, enabling an encoder to inform the following component of the roles of the incoming media streams. A test is added for this functionality in a similar manner to the matroska test. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* lavf/movenc: Write 'dby1' minor brand if Dolby content is being muxed to MP4Derek Buitenhuis2021-10-01
| | | | | | | | | This is as per: * mp4ra: http://mp4ra.org/#/brands * Dolby Vision muxing spec (which is public): https://professional.dolby.com/siteassets/content-creation/dolby-vision-for-content-creators/dolby_vision_bitstreams_within_the_iso_base_media_file_format_dec2017.pdf Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/movenc: Simplify reserving space for tfrf tagsAndreas Rheinhardt2021-09-27
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Limit ism_lookahead to a sane valueAndreas Rheinhardt2021-09-27
| | | | | | | | There can only be a maximum of 255 entries in a tfrf tag, so using more makes no sense; moreover, several size computations can overflow in this case. Fix this by limiting it to 255. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: Avoid calling strlen multiple timesAndreas Rheinhardt2021-08-27
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: add support for TTML muxingJan Ekström2021-08-25
| | | | | | | | | | | Includes basic support for both the ISMV ('dfxp') and MP4 ('stpp') methods. This initial version also foregoes fragmentation support in case the built-in sample squashing is to be utilized, as this eases the initial review. Additionally, add basic tests for both muxing modes in MP4. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* movenc: Get rid of frag_startHu Weiwen2021-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "frag_start" is redundant, and every occurance can be replaced with cluster[0].dts - start_dts The proof of no behaviour changes: (All line number below is based on commit bff7d662d728) "frag_start" is read at 4 place (with all possible call stacks): mov_write_packet ... mov_flush_fragment mov_write_moof_tag mov_write_moof_tag_internal mov_write_traf_tag mov_write_tfxd_tag (#1) mov_write_tfdt_tag (#2) mov_add_tfra_entries (#3) mov_write_sidx_tags mov_write_sidx_tag (#4) mov_write_trailer mov_auto_flush_fragment mov_flush_fragment ... (#1 #2 #3 #4) mov_write_sidx_tags mov_write_sidx_tag (#4) shift_data compute_sidx_size get_sidx_size mov_write_sidx_tags mov_write_sidx_tag (#4) All read happens in "mov_write_trailer" and "mov_write_moof_tag". So we need to prove no behaviour change in these two functions. Condition 1: for every track that have "trk->entry == 0", trk->frag_start == trk->track_duration. Condition 2: for every track that have "trk->entry > 0", trk->frag_start == trk->cluster[0].dts - trk->start_dts. Definition 1: "Before flush" means just before the invocation of "mov_flush_fragment", except for the auto-flush case in "mov_write_single_packet", which means before L5934. Lemma 1: If Condition 1 & 2 is true before flush, Condition 1 & 2 is still true after "mov_flush_fragment" returns. Proof: No update to the tracks that have "trk->entry == 0" before flushing, so we only consider tracks that have "trk->entry > 0": Case 1: !moov_written and moov will be written in this iteration trk->entry = 0 L5366 trk->frag_start == trk->cluster[0].dts - trk->start_dts Lemma condition trk->frag_start += trk->start_dts + trk->track_duration - trk->cluster[0].dts; L5363 So trk->entry == 0 && trk->frag_start == trk->track_duration Case 2: !moov_written and moov will NOT be written in this iteration nothing changed Case 3: moov_written trk->entry = 0 L5445 trk->frag_start == trk->cluster[0].dts - trk->start_dts Lemma condition trk->frag_start += trk->start_dts + trk->track_duration - trk->cluster[0].dts; L5444 So trk->entry == 0 && trk->frag_start == trk->track_duration Note that trk->track_duration may be updated for the tracks that have "trk->entry > 0" (mov_write_moov_tag will update track_duration of "tmcd" track, but it must have 1 entry). But in all case, trk->frag_start is also updated to consider the new value. Lemma 2: If Condition 1 & 2 is true before "ff_mov_write_packet" invocation, Condition 1 & 2 is still true after it returns. Proof: Only the track corresponding to the pkt is updated, and no update to relevant variables if trk->entry > 0 before invocation. So we only need to prove "trk->frag_start == trk->cluster[0].dts - trk->start_dts" after trk->entry increase from 0 to 1. Case 1: trk->start_dts == AV_NOPTS_VALUE Case 1.1: trk->frag_discont && use_editlist trk->cluster[0].dts = pkt->dts at L5741 trk->frag_start = pkt->pts at L5785 trk->start_dts = pkt->dts - pkt->pts at L5786 So trk->frag_start == trk->cluster[0].dts - trk->start_dts Case 1.2: trk->frag_discont && !use_editlist trk->cluster[0].dts = pkt->dts at L5741 trk->frag_start = pkt->dts at L5790 trk->start_dts = 0 at L5791 So trk->frag_start == trk->cluster[0].dts - trk->start_dts Case 1.3: !trk->frag_discont trk->cluster[0].dts = pkt->dts at L5741 trk->frag_start = 0 init trk->start_dts = pkt->dts at L5779 So trk->frag_start == trk->cluster[0].dts - trk->start_dts Case 2: trk->start_dts != AV_NOPTS_VALUE Case 2.1: trk->frag_discont trk->cluster[0].dts = pkt->dts at L5741 trk->frag_start = pkt->dts - trk->start_dts at L5763 So trk->frag_start == trk->cluster[0].dts - trk->start_dts Case 2.2: !trk->frag_discont trk->cluster[0].dts = trk->start_dts + trk->track_duration at L5749 trk->track_duration == trk->frag_start Lemma condition So trk->frag_start == trk->cluster[0].dts - trk->start_dts Lemma 3: Condition 1 & 2 is true in all case before and after "ff_mov_write_packet" invocation, before flush and after "mov_flush_fragment" returns. Proof: All updates to relevant variable happen either in "ff_mov_write_packet", or during flush. And Condition 1 & 2 is true initially. So with lemma 1 & 2, we can prove this use induction. Noticed that all read of "frag_start" only happen in "trk->entry > 0" branch. Now we need to prove Condition 2 is true before each read. Because no update to variables relevant to Condition 2 between "before flush" and "mov_write_moof_tag" invocation, we can conclude Condition 2 is true before every invocation of "mov_write_moof_tag". No behaviour change in "mov_write_moof_tag" is proved. In "mov_write_trailer", No update to relevant variables after the last flush and before the invocation of "mov_write_sidx_tag". So no behaviour change to "mov_write_trailer" is proved. Q.E.D. Signed-off-by: Hu Weiwen <sehuww@mail.scut.edu.cn> Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Ensure no separate moof written for empty trackHu Weiwen2021-08-18
| | | | | | | | track->mdat_buf can be not NULL while the track is still empty if the last packet write failed. Signed-off-by: Hu Weiwen <sehuww@mail.scut.edu.cn> Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Don't try to fix the fragment end duration if none will be writtenMartin Storsjö2021-08-10
| | | | | | | | | If autoflushing on a new packet (e.g. due to the frag_every_frame flag being set), there's no samples to be written in the new fragment, so we can't overwrite the track duration in order to make it line up with the next packet to be written. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/avcodec: Stop including channel_layout.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include channel_layout.h directly wherever used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>