1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

20604 Commits

Author SHA1 Message Date
Karthick Jeyapal
9e25fe4204 avformat/hlsenc: Modularized audio rendition playlist write to allow reuse
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-29 13:45:31 +08:00
Steven Liu
be4dfbf7b7 avformat/avio: check input URLContext value NULL
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Karthick Jeyapal <kjeyapal@akamai.com>
2017-12-28 12:07:22 +08:00
Aman Gupta
1dd82edea5 avformat/hls: enable http_multiple only for http/1.1 servers
Some http/1.0 implementations, like python's SimpleHTTPServer, can only support one client connection at a time. Making a second request while the first is still connected leads to a deadlock.

This change enables multiple connections for http/1.1 servers only, which need to support keepalive by default and should have no problem with concurrent requests.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-26 14:53:19 -08:00
Aman Gupta
039007c928 avformat/http: export http_version from response
Can be used by the api user to figure out what http features the server supports based on the response received.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-26 14:52:36 -08:00
Aman Gupta
ac19e63b18 avformat/hls: respect http_persistent only for http playlist urls
Fixes a segfault when reading a live playlist (without end tag) from non-http url (like a file on disk).

Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-26 14:48:14 -08:00
Aman Gupta
11f989945e avformat/http: avoid ff_http_do_new_request after http/1.0 response
This makes do_new_request fail early when dealing with a http/1.0 server, avoiding unnecessary "reconnecting" warnings shown to the user.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-26 14:48:14 -08:00
Aman Gupta
a232a72d77 avformat/hls: return AVERROR_PROTOCOL_NOT_FOUND when http protocol is not available
Fixes compile error when building with network or protocols disabled.

This code would never be reached (because the demuxer fails much earlier on http playlists or segments), so it doesn't matter much what we do here as long as it compiles.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-26 14:48:13 -08:00
Aman Gupta
2f9ca64556 avformat/hls: remove repeated http proto_name checks in open_url()
Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-26 14:48:13 -08:00
wm4
86a13bf2ff lavc, lavf: move avformat static mutex from avcodec to avformat
It's completely absurd that libavcodec would care about libavformat
locking, but it was there because the lock manager was in libavcodec.

This is more stright forward. Changes ABI, but we don't require ABI
compatibility currently.
2017-12-26 02:50:00 +01:00
Steven Liu
2aee5a8723 avformat/hlsenc: fix resource leak
fix CID: 1426931 1426929
2017-12-25 23:51:25 +08:00
Karthick Jeyapal
be2da4c522 avformat/hlsenc: Signal http end of chunk(http_shutdown) during hlsenc_io_close()
Currently http end of chunk is signalled implicitly in hlsenc_io_open().
This mean playlists http writes would have to wait upto a segment duration to signal end of chunk causing delays.
This patch will fix that problem and improve performance.
2017-12-25 12:08:06 +08:00
Karthick Jeyapal
6848201f70 avformat/http: Avoid calling http_shutdown() if end of chunk is signalled already 2017-12-25 12:07:43 +08:00
Aman Gupta
207e98b4e5 avformat/hls: fix SEGV in previous commit
Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-24 12:31:27 -08:00
Aman Gupta
b33cf73507 avformat/hls: fix memory leak with non-http segments
Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-24 11:59:32 -08:00
Aman Gupta
3d95868d1b avformat/hls: fix CID 1426930
Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-24 11:58:30 -08:00
Aman Gupta
9e5e3236f4 avformat/internal: fix compile error with some versions of g++
Fixes #6926

Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-23 12:36:22 -08:00
Vishwanath Dixit
d02289c386 avformat/hlsenc:addition of #EXT-X-MEDIA tag and AUDIO attribute
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-23 13:42:00 +08:00
Aman Gupta
4c78bbd313 avformat/internal: log underlying error with ff_rename failure
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: wm4 <nfxjfg@googlemail.com>
2017-12-22 18:00:47 -08:00
Aman Gupta
5f4a32a6e3 avformat/hls: hide misleading warning when http reconnect is required
AVERROR_EOF is an internal error which means the http socket is no longer
valid for new requests. It informs the caller that a new connection must
be established, and as such does not need to be surfaced to the user as
a warning.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-22 16:41:41 -08:00
Aman Gupta
54d0ef1738 avformat/http: return EOF from ff_http_do_new_request if previous response said Connection:close
This fixes a deadlock when using the hls demuxer's new http_persistent feature
to stream a youtube live stream over HTTPS. The youtube servers are http/1.1
compliant, but return a "Connecton: close". Before this commit, the demuxer
would attempt to send a new request on the partially shutdown connection and
cause a deadlock in the tls protocol.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2017-12-22 16:39:37 -08:00
Aman Gupta
1f0eaa02aa avformat/hls: add http_multiple option
This improves network throughput of the hls demuxer by avoiding
the latency introduced by downloading segments one at a time.

The problem is particularly noticable over high-latency network
connections: for instance, if RTT is 250ms, there will a 250ms idle
period between when one segment response is read and the next one
starts.

The obvious solution to this is to use HTTP pipelining, where a
second request can be sent (on the persistent http/1.1 connection)
before the first response is fully read. Unfortunately the way the
http protocol is implemented in avformat makes implementing pipleining
very complex.

Instead, this commit simulates pipelining using two separate persistent
http connections. This has the advantage of working independently of
the http_persistent option, and can be used with http/1.0 servers as
well. The pair of connections is swapped every time a new segment starts
downloading, and a request for the next segment is sent on the secondary
connection right away. This means the second response will be ready and
waiting by the time the current response is fully read.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
2017-12-22 14:42:50 -08:00
Aman Gupta
03765aa6fa avformat/hls: allow open_input to be re-used
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
2017-12-22 14:42:50 -08:00
Aman Gupta
b7d6c0cd48 avformat/hls: add http_persistent option
This teaches the HLS demuxer to use the HTTP protocols
multiple_requests=1 option, to take advantage of "Connection:
Keep-Alive" when downloading playlists and segments from the HLS server.

With the new option, you can avoid TCP connection and TLS negotiation
overhead, which is particularly beneficial when streaming via a
high-latency internet connection.

Similar to the http_persistent option recently implemented in hlsenc.c

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
2017-12-22 14:42:50 -08:00
Aman Gupta
9395e44b8d avformat/http: add "Opening" info logging to ff_http_do_new_request
This mimics logging that was added in 53e0d5d724 for security
purposes.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-22 14:42:50 -08:00
Aman Gupta
28358e466d avformat/http: return EINVAL from ff_http_do_new_request() if re-used with different hostname
This will prevent improper use of ff_http_do_new_request() if the user
tries to send a request for a different host to a previously connected
persistent http/1.1 connection.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Karthick J <kjeyapal@akamai.com>
2017-12-22 14:42:35 -08:00
Karthick J
e3b2c8502b avformat/dashenc: avformat/dashenc: Fix the EXT-X-TARGETDURATION as per the hls specification 2017-12-22 07:44:51 +08:00
Karthick J
93a0e47876 avformat/hlsenc: set EXT-X-TARGETDURATION use lrint(EXTINF) 2017-12-22 07:43:54 +08:00
James Almer
bc10260f49 avformat/mov: simplify parsing of mdcv atom using av_make_q()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-21 01:23:17 -03:00
Karthick J
3ac76d890d avformat/hlsenc: Fix a memory leak when http_persistent is 1
Reviewed-by: Steven Liu <lq@onvideo.cn>
2017-12-21 11:39:24 +08:00
Steven Liu
7feae7be5b avformat/hlsenc: reindent after previous commits
Reviewed-by: Karthick J <kjeyapal@akamai.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-21 11:17:08 +08:00
Steven Liu
8318f60845 avformat/hlsenc: fix first fragment mp4 do not split bug
fix ticket id: 6888

Tested-by: beloko <beloko@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-21 11:14:32 +08:00
Sasi Inguva
58a25aeb8e lavf/mov.c: Guess video codec delay based on PTS while parsing MOV header.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-20 22:27:06 +01:00
Michael Niedermayer
74f408cc8e avformat/mov: Fix the the typo
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-18 19:57:43 +01:00
Carl Eugen Hoyos
9b79c65ec0 lavu/lavc/lavf/lavfi: Do not use type modifier %zu on Windows MSVCRT. 2017-12-17 18:05:42 +01:00
sfan5
387ee1d6aa libavformat: LibreSSL (libtls) support
Signed-off-by: sfan5 <sfan5@live.de>
2017-12-17 17:32:42 +11:00
Karthick J
b2d27d912b avformat/hlsenc: Extend persistent http connections to playlists
Before this patch persistent http connections would work only for media segments.
The playlists were still opening a new connection everytime.
This patch extends persistent http connections to playlists as well.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-15 22:15:07 +08:00
Karthick J
6ae18228cd avformat/hlsenc: Handle NULL input in IO open and close utility functions
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-15 22:14:54 +08:00
Karthick J
deceb7d9ae avformat/hlsenc: Call avio_flush during persistent http connections
Since close is not called, during http persistent connection,
flush needs to be called so that output is written on time.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-15 22:14:43 +08:00
Steven Robertson
2d131fc31b avformat/movenc: Add support for more colorspaces
With FCPX 10.4, Apple has expanded the set of colorspace, primaries,
and trc flags officially supported in QuickTime files. The expanded set
matches the codepoints used in ffmpeg and many other specs.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-15 00:08:56 +01:00
Rodger Combs
2e391a576c lavf/mpegts: mark packets with TEI flag as corrupted 2017-12-13 20:07:00 -06:00
Tristan Matthews
e8f0a463b0 ivfenc: add AV1 support
libaom tools work with ivf files.
2017-12-13 15:10:07 +00:00
James Almer
0e2fbd68e2 avformat/mux: factorize AVFormatContext->avoid_negative_ts initialization
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-12-12 20:18:29 -03:00
Steven Liu
0e5260226a avformat/hlsenc: reindent after previous commits 2017-12-12 11:50:23 +08:00
Steven Liu
08d28ee182 avformat/hlsenc: move init operations from write_header to init
Reviewed-by: Vishwanath Dixit <vdixit@akamai.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-12-11 11:03:25 +08:00
James Almer
dae6d27aa0 Merge commit 'f6161fccf8c5720ceac1ed1df8ba60ff8fed69f5'
* commit 'f6161fccf8c5720ceac1ed1df8ba60ff8fed69f5':
  rtsp: only break on parse_rtsp_message on error

Merged-by: James Almer <jamrial@gmail.com>
2017-12-10 20:44:26 -03:00
tiejun.peng
6bf5d69b2f lavf/mov: modify code indentation
Signed-off-by: tiejun.peng <tiejun.peng@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-09 23:12:30 +01:00
tiejun.peng
ab651587a7 lavf/mov: add some useful warning log of eof
Signed-off-by: tiejun.peng <tiejun.peng@foxmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-09 23:12:30 +01:00
Mark Reid
901d87aa83 avformat/mxfenc: write reel_name if metadata key is present
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-08 20:02:16 +01:00
Mark Reid
ad2641c36b avformat/mxfenc: use track count to generate component instance uuid
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-12-08 20:02:16 +01:00
Paul B Mahol
a41a5db797 avformat: add NSP demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-12-08 16:01:09 +01:00