Commit Graph

65 Commits

Author SHA1 Message Date
28b7a82ac1 format: add support for Chapters
Read chapters from an input context and add chapters to an output context.

Note: unlike avformat_new_stream, the equivalent function for chapter is private:
avpriv_new_chapter (part of libavformat/internal.h). I couldn't find any other
solution but re-implementing it in format::context::output::add_chapter.
2017-09-23 20:42:51 +02:00
052d342baf format: fix segmentation fault
Double free error.

On failure avformat_open_input frees AVFormatContext. I had it wrapped with context::Input::wrap. On avformat_open_input failure it would free AVFormatContext and Drop implementation for context::Input would try to call avformat_close_input on same AVFormatContext resulting in segmentation fault.
2017-08-21 19:38:36 +02:00
5afe774f40 crate: update bitflags 2017-07-10 11:35:49 +02:00
206ccd4e5a format/stream: add stream metadata 2017-07-08 17:07:46 +02:00
991bbc24e8 format: add interrupt callback support 2017-07-08 17:05:44 +02:00
5ac0527bdc *: use latest ffmpeg-sys using bindgen
* Update bindings to newest ffmpeg version for new ffmpeg-sys, which is mostly generated by bindgen
* Bring back removed feature flags
* Fix whitespace formating
* Remove prepended enum names to enum variants
* Remove unneeded allows
2017-07-08 17:00:27 +02:00
471b48ddd4 format/stream: add avg_frame_rate accessors 2017-06-14 13:02:19 +02:00
b67e4eb6d9 format/context: close AVIOContext before freeing AVFormatContext 2017-04-27 17:58:37 +02:00
meh
ef11b2bec4 format/context/output: return the Dictionary on write_header_with 2017-02-25 19:30:08 +01:00
meh
8562de8e44 format/context/ouptut: revert pass muxer options to avformat_write_header"
This reverts commit e04e9da298.

There's already a function for that, `write_header_with`.
2017-02-25 19:28:02 +01:00
meh
b48521108e *: update dependencies 2017-02-19 01:45:05 +01:00
e04e9da298 format/context/output: pass muxer options to avformat_write_header 2017-02-01 17:18:19 +01:00
36ac2513c1 codec/parameters: make api more flexible and consistent 2016-12-03 01:43:21 +01:00
606847cc50 codec: introduce Parameters
As of ffmpeg 3.1, a new `AVCodecParameters` type and related API introduced.
This commit contains minimal changes to support new API.
2016-12-03 01:41:29 +01:00
981eb2a801 format/format: make description() to return long_name 2016-11-28 23:50:33 +01:00
0328dc111a format: fix avformat_find_stream_info return handling
According to:
https://ffmpeg.org/doxygen/2.8/group__lavf__decoding.html#gad42172e27cddafb81096939783b157bb

...avformat_find_stream_info returns ">=0 if OK, AVERROR_xxx on error".
This occurs with several common formats, including MP4 and MKV.
2015-11-22 00:15:35 +01:00
a736c8b438 format/context/input: add seek() method 2015-10-14 18:24:11 +02:00
110c5a533c format/context: add duration() method 2015-10-14 17:50:46 +02:00
meh
132c514e3f *: returning &mut Self from setters was an awful idea
Deref breaks things.
2015-10-04 03:21:52 +02:00
5a07671b92 format/context/input: implement pause() and play() 2015-10-03 00:16:25 +02:00
meh
7161b02eba format/stream: rename frame_rate to rate 2015-10-01 20:43:04 +02:00
meh
510e8604b6 *: refactor setters to return self 2015-09-26 18:01:23 +02:00
meh
66284eb045 codec: add magic traits to get codecs by name and id 2015-09-25 21:33:08 +02:00
bde17a8bae format: add _with() variants to open() 2015-09-25 16:43:17 +02:00
meh
9736980b02 codec/context: make destructors safe 2015-09-17 17:33:31 +02:00
855f3fd618 format/output: add flags() method 2015-09-14 13:54:17 +02:00
a76cdd7086 format: add Flags (AVFMV_*) 2015-09-14 13:53:48 +02:00
87ea1bd196 format: refactor format handling 2015-09-09 13:48:10 +02:00
ced43fe83b format/context: implement set_metadata() 2015-09-08 18:46:40 +02:00
meh
f2fb08e491 util/dictionary: refactor and make more sound 2015-09-08 18:26:29 +02:00
meh
1f80007e5e format: split input and output formats 2015-09-04 16:30:19 +02:00
34cbb9b1e6 format/context: add write_trailer() method 2015-09-02 16:14:53 +02:00
a082998e48 format/context: add write_header{_with}() methods 2015-09-02 16:14:38 +02:00
a48233cbfe format/context: add new_stream() method 2015-09-02 16:13:31 +02:00
471a768b8e format/context: implement Context opening as output 2015-09-02 14:52:02 +02:00
9b612fc90f format: rename open* function to open_input* 2015-09-02 14:51:56 +02:00
edcddc91e7 format/stream: add set_time_base() 2015-08-30 16:39:28 +02:00
meh
549727b084 format/context: implement best stream retrieval 2015-08-28 16:33:04 +02:00
meh
b839b5fe2f *: implement ExactSizeIterator where possible 2015-08-25 16:13:42 +02:00
meh
62acd3ef02 *: use Into<Rational> instead of Rational for setters 2015-08-25 15:53:46 +02:00
meh
a282d85662 format/stream: avoid unsoundness splitting Stream into StreamMut 2015-08-25 15:45:55 +02:00
f486b7c051 format/context: expose the metadata dictionary 2015-08-19 14:01:27 +02:00
meh
0f494cd9cb format: fix some memory unsafety in helpers 2015-07-02 07:52:59 +02:00
meh
bb4263b7be util/rational: some more refactoring 2015-06-25 22:23:33 +02:00
meh
b712412e77 format/context: fix the packets iterator 2015-06-24 13:34:52 +02:00
meh
24af20b79d format/context: do not use unstable to_cstring 2015-06-10 22:03:25 +02:00
meh
72965fc57a format/context: make it Send 2015-06-09 23:47:31 +02:00
meh
e188c69030 format/context: use AsRef<Path> instead of Path 2015-06-08 20:41:32 +02:00
meh
ea89b6f73f format/context: add a packets iterator 2015-06-08 15:49:54 +02:00
meh
d56ac34413 *: use is_null instead of == ptr::null() 2015-06-08 15:48:28 +02:00