Commit Graph

20234 Commits

Author SHA1 Message Date
Rodger Combs 5c9373385d Merge commit 'dce2929efa8e82b0832a828f7e8cb81ff8c20a4e'
* commit 'dce2929efa8e82b0832a828f7e8cb81ff8c20a4e':
  dashenc: copy language and role metadata from streams assigned to sets

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:11:50 -03:00
Rodger Combs 3f7a8bb67b Merge commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115'
* commit 'ca9bc9de690258d4761a19b0df6e9c9113b80115':
  dashenc: default to one AdaptationSet per stream

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:11:25 -03:00
Rodger Combs c0fae3ff90 Merge commit 'efd2fc41b3f0749f9715d50b581f22bbaa8c5b99'
* commit 'efd2fc41b3f0749f9715d50b581f22bbaa8c5b99':
  dashenc: allow assigning all streams of a media type to an AdaptationSet

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:11:02 -03:00
Rodger Combs 777d53c793 Merge commit '3d23a5f96ad72961c14ba3a0c2add8f2ab374b61'
* commit '3d23a5f96ad72961c14ba3a0c2add8f2ab374b61':
  dashenc: add support for assigning streams to AdaptationSets

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:10:30 -03:00
Rodger Combs 3b9ef13588 Merge commit '9df9309d233f59d9706444a1e24ac24139f2640d'
* commit '9df9309d233f59d9706444a1e24ac24139f2640d':
  dashenc: calculate stream bitrate from first segment if not available

Merged-by: Rodger Combs <rodger.combs@gmail.com>
2017-09-26 14:02:44 -03:00
James Almer 52223ffe44 Revert "lavf/dashenc: update bitrates on dash_write_trailer"
This reverts commit 89c0fda5f4.

A different solution will be committed instead.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-26 13:59:56 -03:00
Moritz Barsnick 6bf48c4805 lavf/tls_gnutls: fix warnings from version check
The GnuTLS version is checked through the macro GNUTLS_VERSION_NUMBER,
but this wasn't introduced before 2.7.2. Building with older versions
of GnuTLS (using icc) warns:

src/libavformat/tls_gnutls.c(38): warning #193: zero used for undefined preprocessing identifier "GNUTLS_VERSION_NUMBER"
  #if HAVE_THREADS && GNUTLS_VERSION_NUMBER <= 0x020b00

This adds a fallback to the older, deprecated LIBGNUTLS_VERSION_NUMBER
macro.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
2017-09-26 15:05:32 +02:00
Moritz Barsnick 16c8a9feea lavf/tls_gnutls: fix compilation with GnuTLS 2.x
Commit 598e416840 added use of
GNUTLS_E_PREMATURE_TERMINATION, which wasn't introduced to GnuTLS
before 2.99.x / 3.x. This fixes compilation with older versions.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
2017-09-26 15:05:00 +02:00
James Almer 89a2472ec5 avformat/img2enc: remove av_dup_packet() call
It's unnecessary after a call to av_packet_ref().

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-25 23:44:53 -03:00
James Almer a447b75de8 avformat: replace all uses of av_copy_packet()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-25 21:26:38 -03:00
Martin Vignali 45c15b7490 libavformat : add mov dataformat tag for HapAlphaOnly and HapQAlpha
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-24 21:54:13 +02:00
Jörn Heusipp 3d2da6d585
avformat/libopenmpt: Query duration and metadata after selecting subsong
Duration depends on the selected subsong and thus must be queried after
selecting the subsong. There is no compelling reason to query other
metadata earlier either.

Tested with libopenmpt version: 0.2.8760-beta27
Libopenmpt configure options: --without-ogg --without-vorbis
--without-vorbisfile --without-portaudio --without-portaudiocpp
--without-mpg123 --without-pulseaudio --without-sndfile --without-flac

Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2017-09-24 15:54:38 +01:00
James Almer 86be73c7c1 avformat/mpeg: zero initialize idx_pkt
Prevents use of uninitialized stack.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-23 19:37:21 -03:00
Marton Balint 01911b9b3c avformat/mxfdec: use the common packet pts setter function for opatom files
Fixes ticket #6631.

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-09-23 19:07:54 +02:00
Marton Balint 7f80b065a6 avformat/mxfdec: factorize packet pts setter function
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-09-23 19:07:54 +02:00
James Almer afe674734b avformat/gif: use av_packet_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-23 02:18:47 -03:00
James Almer bb4b7624d9 avformat/apngenc: use av_packet_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-23 02:18:36 -03:00
Lou Logan 183fd30e0f Fix several typos
"apix_fmts" found by Marc Péchaud.
"speedloss" found by Mikhail V.

Signed-off-by: Lou Logan <lou@lrcd.com>
2017-09-21 16:17:02 -08:00
Carl Eugen Hoyos 724cf83f10 Remove some unneeded casts of bit_rate. 2017-09-22 01:33:22 +02:00
Steven Liu c34c0e3a64 avformat/hlsenc: support http method for hls fmp4 init file
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-21 23:10:57 +08:00
Steven Liu 7e9cdd3f49 avformat/hlsenc: fix CID 1418106
fix the "Uninitialized scalar variable (UNINIT)" problem.

Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-21 23:08:00 +08:00
Tatsuyuki Ishi 598e416840 GnuTLS: eat PREMATURE_TERMINATION error
GnuTLS is too strict on the SSL shutdown alert, and it's neither
mandatory in the spec or critical. As it's ignored in OpenSSL, we
should also suppress it in GnuTLS as well.

Ticket: #6667

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-21 03:02:24 +02:00
Anton Khirnov 5a3b602acd avformat/cafdec: reject multichannel Opus streams
Multichannel Opus streams require channel mapping information in extradata.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-19 23:06:42 -03:00
Carl Eugen Hoyos b4093e60c5 lavf/caf: Support demuxing Opus.
Introduced in macOS High Sierra and iOS 11.
2017-09-20 03:31:48 +02:00
Carl Eugen Hoyos ca72cd137d lavf/mpegts: Consider stream_type 0x0f just a hint towards AAC.
It is also used in the wild to signal latm.

Fixes ticket #6657.
2017-09-20 02:20:32 +02:00
Carl Eugen Hoyos 2f3a3a7e32 lavf/utils: Do not force chapter end time before chapter start.
Fixes ticket #6671.
2017-09-20 00:57:29 +02:00
Tobias Rapp 3ffd3b7f5f avformat/mxfenc: cosmetic changes
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2017-09-18 08:57:09 +02:00
Tobias Rapp 35d6be199a avformat/mxfenc: fix aspect ratio when writing 16:9 DV frames
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2017-09-18 08:56:28 +02:00
Aman Gupta 73bf0f42e3 avformat/hlsenc: fix segfault when using -hls_segment_type fmp4 with -hls_segment_filename
previously, specifying -hls_segment_filename meant
s->base_output_dirname was never set, causing a segfault:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x00007fffbf7d82d0 libsystem_platform.dylib`_platform_strcmp + 80
frame #1: 0x00000001005f4dcf libavformat.57.dylib`io_open_default(s=0x000000010481cc00, pb=0x0000000104806020, url=0x0000000000000000, flags=2, options=0x0000000000000000) at options.c:107
frame #2: 0x0000000100528968 libavformat.57.dylib`hls_mux_init(s=0x000000010481cc00) at hlsenc.c:595
frame #3: 0x00000001005273cb libavformat.57.dylib`hls_write_header(s=0x000000010481cc00) at hlsenc.c:1518
frame #4: 0x00000001005c08d0 libavformat.57.dylib`write_header_internal(s=0x000000010481cc00) at mux.c:486
frame #5: 0x00000001005c0774 libavformat.57.dylib`avformat_write_header(s=0x000000010481cc00, options=0x00000001029026e8) at mux.c:539
2017-09-16 10:32:28 +08:00
Clément Bœsch 6743351558 lavf/http: fix compilation without zlib
Regression since e2f8f14052.
2017-09-15 15:10:49 +02:00
Jacek Jendrzej e2f8f14052 lavf/http: Reset compressed header flag, fix http 302 request
Fixes ticket #6404.
Fixes ticket #6666.

Signed-off-by: Jacek Jendrzej <satbaby@kawaii.com>
2017-09-15 13:33:23 +02:00
Paras Chadha 6ce4a635ed avformat/fitsenc: fill header line with spaces
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-12 21:39:57 -03:00
Michael Niedermayer de03eb622d avformat/mxfenc: Correct the Sample rate for PCM outside D10
Based on mail from IRT

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 19:24:25 +02:00
Michael Niedermayer 4c33ec004f avformat/mxfenc: Comment edit rate write code like the surrounding code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 19:24:25 +02:00
Michael Niedermayer 4c88087f93 avformat/mxfenc: Replace more literal magic numbers by enum values.
This also moves the enum table up as it is needed earlier

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 19:24:25 +02:00
Petri Hintukainen 7a6bd54152 Add SUP/PGS subtitle muxer
Fixes ticket #2208
2017-09-09 12:07:14 +02:00
Steven Liu ab96e2ca81 avformat/dashdec: free resource allocated by xml
modify from av_free to xmlFree

Suggested-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-09-09 08:34:07 +08:00
Steven Liu 96d70694ae avformat/dashdec: add dash demuxer base version
ffmpeg need a dash demuxer for demux the dash formats base on
https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/000001_add_dash_demux.patch

TODO:
1. support multi bitrate dash.

v2 fixed:
1. from autodetect to disabled
2. from camelCase code style to ffmpeg code style
3. from RepType to AVMediaType
4. fix variable typo
5. change time value from uint32_t to uint64_t
6. removed be used once API
7. change 'time(NULL)`, except it is not 2038-safe.' to av_gettime and av_timegm
8. merge complex free operation to free_fragment
9. use API from snprintf to av_asprintf

v3 fixed:
1. fix typo from --enabled-xml2 to --enable-xml2

v4 fixed:
1. from --enable-xml2 to --enable-libxml2
2. move system includes to top
3. remove nouse includes
4. rename enum name
5. add a trailing comma for the last entry enum
6. fix comment typo
7. add const to DASHContext class front
8. check sscanf if return arguments and give warning message when error
9. check validity before free seg->url and seg
10. check if the val is null, before use atoll

v5 fixed:
1. fix typo from mainifest to manifest

v6 fixed:
1. from realloc to av_realloc
2. from free to av_free

v7 fixed:
1. remove the -lxml2 from configure when require_pkg_config

v8 fixed:
1. fix replace filename template by av_asprintf secure problem

v9 modified:
1. make manifest parser clearly

v10 fixed:
1. fix function API name code style
2. remove redundant strreplace call
3. remove redundant memory operation and check return value from get_content_url()
4. add space between ) and {
5. remove no need to log the value for print

v11 fixed:
1. from atoll to strtoll
Suggested-by: Michael Niedermayer <michael@niedermayer.cc>

v12 fixed:
1. remove strreplace and instead by av_strreplace
Suggested-by: Nicolas George <george@nsup.org>

v13 fixed:
1. fix bug: cannot play:
http://dash.edgesuite.net/akamai/bbb_30fps/bbb_30fps.mpd
Reported-by: Andy Furniss <adf.lists@gmail.com>

v14 fixed:
1. fix bug: TLS connection was non-properly terminated
2. fix bug: No trailing CRLF found in HTTP header
Reported-by: Andy Furniss <adf.lists@gmail.com>

v15 fixed:
1. play youtube link: ffmpeg -i $(youtube-dl -J "https://www.youtube.com/watch?v=XmL19DOP_Ls" | jq -r ".requested_formats[0].manifest_url")
2. code refine for timeline living stream
Reported-by: Ricardo Constantino <wiiaboo@gmail.com>

v16 fixed:
1. remove the snprintf and instead by get_segment_filename make safety
2. remove unnecessary loops
3. updated xmlStrcmp and xmlFree to av_* functions
4. merge code repeat into one function
5. add memory alloc faild check
6. update update_init_section and open_url
7. output safety error message when filename template not safe
Suggested-by : wm4 <nfxjfg@googlemail.com>

v17 fixed:
1. add memory alloc faild check
2. fix resource space error at free_representation

v18 fixed:
1. add condition of template format

v19 fixed:
1. fix typo of the option describe

v20 fixed:
1. add the c->base_url alloc check
2. make the DASHTmplId same to dashenc

v21 fixed:
1. remove get_repl_pattern_and_format and get_segment_filename
2. process use dashcomm APIs

v22 fixed:
1. modify the include "dashcomm.h" to include "dash.h"
2. use internal API from dash_fill_tmpl_params to ff_dash_fill_tmpl_params

Signed-off-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: samsamsam <samsamsam@o2.pl>
2017-09-09 08:32:03 +08:00
James Almer 27b7800ba9 avformat/matroskaenc: also write tags when output is WebM
WebM supports a subset of elements from the Tags master.
See https://www.webmproject.org/docs/container/#tagging

Reviewed-by: Ivan Janatra <janatra@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-08 20:02:43 -03:00
Michael Niedermayer afc9c683ed avformat/asfdec: Fix DoS in asf_build_simple_index()
Fixes: Missing EOF check in loop
No testcase

Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-07 15:19:22 +02:00
Michael Niedermayer 9cb4eb7728 avformat/mov: Fix DoS in read_tfra()
Fixes: Missing EOF check in loop
No testcase

Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-07 15:19:22 +02:00
Michael Niedermayer 913feb6263 avformat/gdv: Make FixedSize static
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-07 15:19:22 +02:00
Steven Liu ef7fe81b85 flvdec: Check the avio_seek return value after reading a metadata packet
merge from libav: 585dc1aece

If the metadata packet is corrupted, flv_read_metabody can accidentally
read past the start of the next packet. If the start of the next packet
had been flushed out of the IO buffer, we would be unable to seek to
the right position (on a nonseekable stream).

Prefer to clearly error out instead of silently trying to read from a
desynced stream which will only be interpreted as garbage.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-09-07 08:30:14 +08:00
Karthick J 837c55e072 avformat/hlsenc: Added configuration to override HTTP User-Agent
Signed-off-by: Karthick J <kjeyapal@akamai.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-05 23:30:52 +08:00
Alex Converse 4d2b9ece45 avformat/flvdec: Set need_context_update when setting the initial extradata
Fixes ticket 6398.

Debugged with the help of James Almer and Hendrik Leppkes.
2017-09-03 20:01:39 -07:00
wm4 5d76674756 lavf: make avio_read_partial() public
Main use-case is proxying avio through a foreign I/O layer and a custom
AVIO context, without losing latency and performance characteristics.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Merged from Libav commit 173b56218f.
2017-09-01 17:56:33 +02:00
James Almer 877076ffa1 avformat/avio: update avio_alloc_context() doxy
It must be freed using avio_context_free() starting with commit
b12e4d3bb8.

Found-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-01 12:26:36 -03:00
Steven Liu adeb41afb8 avformat/dash:add copyright to dash.c
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-09-01 18:52:56 +08:00
Anton Khirnov 78a7af823b Use the new AVIOContext destructor.
(cherry picked from commit 6f554521af)
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-01 02:16:33 -03:00
Anton Khirnov b12e4d3bb8 avio: add a destructor for AVIOContext
Before this commit, AVIOContext is to be freed with a plain av_free(),
which prevents us from adding any deeper structure to it.

(cherry picked from commit 99684f3ae7)
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-01 01:51:15 -03:00