1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-20 00:05:06 +02:00
Commit Graph

162 Commits

Author SHA1 Message Date
Michael Niedermayer
e2b19a533d avformat/segment: atomically update list if possible
Fixes Ticket4802

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-28 00:09:56 +02:00
Michael Niedermayer
dda6925357 avformat/segment: Do not free the filename twice
Bug introduced in 83a508cda5

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-26 03:50:52 +02:00
Carl Eugen Hoyos
83a508cda5 lavf/segment: Fix memleak.
Reviewed-by: Stefano Sabatini
Reviewed-by: Ganesh Ajjanagadde
2015-08-25 13:36:24 +02:00
Ronald S. Bultje
229843aa35 Replace av_dlog with ff_dlog.
ff_dlog checks compilability, and is non-public. av_dlog is deprecated
and no longer exists if FF_API_DLOG=0.
2015-08-18 10:24:01 -04:00
Michael Niedermayer
449c74f629 Merge commit '8a78ae2d2101622fd244b99178d8bc61175c878e'
* commit '8a78ae2d2101622fd244b99178d8bc61175c878e':
  segment: Check open_null_ctx() return value

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-12 22:10:47 +02:00
Vittorio Giovara
8a78ae2d21 segment: Check open_null_ctx() return value
Reported-By: infer
2015-06-12 17:02:48 +01:00
Rodger Combs
e60b018c74 lavf/segment: add an option to allow breaking on non-keyframes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-09 13:26:00 +02:00
Michael Niedermayer
235589ee9e avformat/segment: Change enum to int, which is accessed via AVOption as int
This fixes depending on implementation defined behavior

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 23:21:48 +02:00
Rodger Combs
5cba5291a7 lavf/segment: style nits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-31 04:34:32 +02:00
Rodger Combs
de2aaf1a2a lavf/segment: Mark output contexts as non-seekable when applicable
This prevents sub-muxers from trying to seek back to the beginning of the
whole stream, only to find themselves overwriting some video data in the
current (often last) segment.

We only do this when not writing individual header/trailers.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-29 19:04:17 +02:00
Rodger Combs
7b060a96ad libavformat/segment: add an option to write the header to a separate file
This permits some interesting segmenting techniques with formats like Matroska,
where you can concatenate the header and segments [N, nb_segments) and get
a working file that starts at segment N's start time.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-29 16:17:04 +02:00
Rodger Combs
481f0f153a libavformat/segment: don't leave the list pb open when not in use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-29 14:44:21 +02:00
Michael Niedermayer
a0fe1a25fa Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'
* commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e':
  avformat: Don't anonymously typedef structs

Conflicts:
	libavformat/adtsenc.c
	libavformat/aiffenc.c
	libavformat/avidec.c
	libavformat/gif.c
	libavformat/iff.c
	libavformat/img2dec.c
	libavformat/jvdec.c
	libavformat/matroskadec.c
	libavformat/udp.c
	libavformat/wtvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 21:07:40 +01:00
Diego Biurrun
daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
Vittorio Giovara
3a6dfec864 segment: Check av_get_frame_filename() return value
CC: libav-stable@libav.org
Bug-Id: CID 1265713
2015-01-23 14:55:03 +00:00
Michael Niedermayer
e2404096b0 avformat/segment: Clear contexts after deallocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-07 22:29:16 +01:00
Michael Niedermayer
2a741baeff Merge commit 'b3f04657368a32a9903406395f865e230b1de348'
* commit 'b3f04657368a32a9903406395f865e230b1de348':
  segment: Fix the failure paths

Conflicts:
	libavformat/segment.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-07 22:15:45 +01:00
Luca Barbato
b3f0465736 segment: Fix the failure paths
A failure in segment_end() or segment_start() would lead to freeing
a dangling pointer and in general further calls to seg_write_packet()
or to seg_write_trailer() would have the same faulty behaviour.

CC: libav-stable@libav.org
Reported-By: luodalongde@gmail.com
2015-01-07 12:36:28 +01:00
Pedro E. M. Brito
202947a066 libavformat/segment.c: Add strftime expansion for segment filename templates
Allows expansion of the filename template with strftime() with the option
-strftime 1 (disabled by default). This allows segments to be named by time of
creation, adding some flexibility.

Fixes Ticket 4104 (add strftime to segment muxer)

Signed-off-by: Pedro E. M. Brito <pedroembrito@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-28 21:48:44 +01:00
Michael Niedermayer
68fa549230 avformat/segment: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-25 12:51:48 +01:00
Michael Niedermayer
ce80f9fee9 avformat/segment: export inner muxer timebase
Fixes "Non-monotonous DTS in output stream 0:0"
Fixes Ticket4020

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-16 03:02:29 +01:00
Michael Niedermayer
32a2876b12 avformat/segment: use time_internal.h, simplify code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-02 20:07:34 +01:00
Mika Raento
75c8d7c2b4 hlsenc.c, segment.c: propagate defaults to mpegts
This fixes the abnormally high ts overhead in the files produced by the
HLS and segments muxers. See https://trac.ffmpeg.org/ticket/2857 . For
example makes it much more likely that it can produces streams that fit
under the 64kb App store limit.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-17 21:31:25 +02:00
Michael Niedermayer
3726d07a2a Merge commit '28816050e47b6dba430a52e429d21a864cffda8e'
* commit '28816050e47b6dba430a52e429d21a864cffda8e':
  lavf: Set the stream time base hint properly for chained muxers

Conflicts:
	libavformat/segment.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-07 02:51:08 +02:00
Martin Storsjö
28816050e4 lavf: Set the stream time base hint properly for chained muxers
This avoids warnings about using the codec time base as time
base hint.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-06 23:30:52 +03:00
Stefano Sabatini
f51de9cac2 lavf/segment: abort in case of invalid segment format options 2014-09-08 15:22:55 +02:00
Stefano Sabatini
4f5493fe23 lavf/segment: add segment_format_options option 2014-09-07 13:17:46 +02:00
Mika Raento
502fc3b3d4 segment: fix copying stream metadata
To get mpegts metadata copied when segmenting.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-02 12:31:04 +02:00
Mika Raento
413fa76f61 segment: use mpegts_flags instead of the deprecated resend_headers option
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-02 12:31:04 +02:00
Michael Niedermayer
0ffe32cf8f avformat/segment: Use avformat_alloc_output_context2()
This avoids having to assign oformat, allows returning the
correct error code and allocates priv_data

Based on patch by: Mika Raento <mika.raento@elisa.fi>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-02 12:31:04 +02:00
Mika Raento
58e0402e02 segment: don't access outside seg->frames array
Fixes wrong number of segments output and undefined memory access.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-02 11:38:36 +02:00
Gabriel Dume
4b1f5e5090 cosmetics: Write NULL pointer inequality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 05:34:13 -07:00
Michael Niedermayer
66ae994c54 avformat/segment: re-interleave packets if needed
Fixes part of Ticket 3797

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-24 23:22:33 +02:00
Michael Niedermayer
351b22caae avformat/mux: support re-interleaving packets in ff_write_chained()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-24 22:39:22 +02:00
Stefano Sabatini
44071b0d25 lavf/segment: sanitize segment end time in case last packet do not have a defined duration
In particular, avoids to set segments with duration set to 0
(e.g. segment with a single reference frame for which duration is
undefined).
2014-07-22 13:53:31 +02:00
Stefano Sabatini
713157484a lavf/segment: do not allow to create segments with no key-frames
Fix trac ticket #3749.
2014-07-22 13:43:06 +02:00
Stefano Sabatini
526bd7bdfa lavf/segment: set segment end time when the first packet arrives
Avoid negative durations in case there is a single packet in the current
segment, since in that case the end time is still set to the previous
segment end time.
2014-07-17 16:51:51 +02:00
Stefano Sabatini
3d38c99041 lavf/segment: fix weird indent 2014-07-17 16:51:51 +02:00
Stefano Sabatini
b6a8c5245f lavf/segment: show incoming packet duration in debug message 2014-07-17 16:51:51 +02:00
Stefano Sabatini
5acad50056 lavf/segment: only use reference frames for computing the segment end time
This avoids a systematic overestimate of the segments duration when there
are several streams.

Fix trac ticket #3724.
2014-07-17 16:51:50 +02:00
Simon Thelen
fa6716c66d libavformat/segment: change segment_list_size behavior to match hls_list_size behavior.
Make the segment muxer keep segment_list_size segments instead of
segment_list_size + 1 segments. This patch also changes the
documentation for segment_list_size to reduce possible confusion over
how many segments are kept.

this allows the segment list to
be limited to containing only one segment which used to be impossible
because a segment_list_size of 0 kept all the segments and a
segment_list_size of 1 kept 2 segments.

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-17 02:35:56 +02:00
Michael Niedermayer
7125b6ca90 avformat/segment: remove gettimeofday() use, remove sys/time.h
It causes portability issues, and would need ifdef hell if its kept

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-08 22:52:39 +02:00
Michael Niedermayer
b8d017adba avformat/segment: simplify localtime* use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-07 22:57:36 +02:00
Deti fliegl
8cda23f341 avformat/segment: Support cutting at clocktime
Signed-off-by: Deti fliegl <fliegl@baycom.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-07 22:56:55 +02:00
Michael Niedermayer
1394e0a9e0 avformat/segment: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 23:11:04 +02:00
Michael Niedermayer
67979b5936 Merge commit '87a3ea3192bf5e4aafa08bca8686a2b577eae818'
* commit '87a3ea3192bf5e4aafa08bca8686a2b577eae818':
  segment: Report the current media sequence

Conflicts:
	libavformat/segment.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-30 20:14:50 +02:00
Luca Barbato
87a3ea3192 segment: Report the current media sequence
Useful for debugging mostly.
2014-04-30 17:52:03 +02:00
Michael Niedermayer
fd601ba6b1 Merge commit '5c08ae4f37281441188447cd04dcaf7cd7ce031f'
* commit '5c08ae4f37281441188447cd04dcaf7cd7ce031f':
  segment: Add an option to prepend a string to the list entries

Conflicts:
	doc/muxers.texi
	libavformat/segment.c

See: 5e278c19c7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-29 15:57:43 +02:00
Enrique Arizón Benito
5c08ae4f37 segment: Add an option to prepend a string to the list entries
Useful to generate lists with absolute urls.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-04-29 12:14:00 +02:00
Willy Aubry
65c95de213 avformat/HLS: modified EXT-X-MEDIA-SEQUENCE header in order to follow the HLS standard
When using the wrap option the EXT-X-MEDIA-SEQUENCE header of the playlist file was reset instead of being incremented.
It is now incremented by one for every media URI removed from the playlist file as the standard states.

Signed-off-by: Willy Aubry <waubry@viotech.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 16:46:22 +01:00