595 Commits

Author SHA1 Message Date
Zhiming Wang
61024149b5
README: explain versioning differences from semver 2020-08-08 01:24:01 +08:00
Zhiming Wang
6f44fb79fd
codec: deprecate encoder's encode/flush and decoder's decode 2020-08-08 01:16:44 +08:00
Zhiming Wang
55c8b5fa02
Bump to v4.4.0-dev to indicate breakage 2020-08-08 01:04:09 +08:00
Zhiming Wang
10a1da9486
examples/avi-to-ppm: rename to dump-frames
The old name isn't fitting since the program isn't specific to AVI at all...
2020-08-08 00:58:18 +08:00
Zhiming Wang
93b7f58ebc
examples/avi-to-ppm: reimplement with modern API
Avoid decoder.decode.
2020-08-08 00:57:44 +08:00
Zhiming Wang
e1cabad5c9
examples/transcode-audio: reimplement with modern API
Avoid encoder.encode and decoder.decode.
2020-08-08 00:55:24 +08:00
Zhiming Wang
07fe207ac2
codec: implement DerefMut for encoder::Audio and encoder::Subtitle 2020-08-08 00:38:09 +08:00
Zhiming Wang
363001febe
codec: expose modern send/receive packet/frame APIs
avcodec_encode_video2()/avcodec_decode_video2/avcodec_encode_audio2()/avcodec_decode_audio4()
have been deprecated since FFmpeg 3.1, with modern
avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/avcodec_receive_packet()
as replacements.

This commit adds send_packet(), send_eof() and receive_frame() to
decoder::Opened; send_frame(), send_eof() and receive_packet() to
encoder::Encoder to expose these modern APIs.
2020-08-08 00:37:54 +08:00
Zhiming Wang
f88f1a981c
Merge branch 'kornelski/miscfixes' into master
Closes #26.
2020-08-07 23:01:23 +08:00
Kornel Lesiński
516f8069f6
Packet setters 2020-08-07 22:43:53 +08:00
Kornel Lesiński
50e1ccaca4
Don't panic on OOM 2020-08-07 22:43:53 +08:00
Kornel Lesiński
f0903fb69b
Allow null codec 2020-08-07 22:43:52 +08:00
Kornel Lesiński
f73dca70b4
Debug for Context 2020-08-07 22:43:52 +08:00
Kornel Lesiński
aa8df7d0d2
DRY nb_streams 2020-08-07 22:42:17 +08:00
Kornel Lesiński
53570d13d7
Add Debug for dictionary 2020-08-07 22:42:17 +08:00
Vasily Chekalkin
b31b5507fb
Add Send trait to resampling::Context 2020-08-07 22:31:11 +08:00
Zhiming Wang
f1ccd4e696
filter::Source: add close method
Expose av_buffersrc_close.
2020-08-03 18:49:14 +08:00
Zhiming Wang
d3270133be
Add log::util module 2020-08-03 18:46:49 +08:00
Zhiming Wang
75b8fbbcfa
Bump to v4.3.4 2020-08-02 11:53:32 +08:00
Zhiming Wang
131c2c103b
README: add documentation links 2020-08-02 11:52:57 +08:00
Zhiming Wang
b28e852eb0
Implement automatic FFmpeg version detection
Based on ffmpeg-sys-next 4.3.2.
2020-08-02 11:44:13 +08:00
Zhiming Wang
a5a897f42f
build.yml: clippy: turn warnings into errors
Otherwise we'll never know.
2020-08-01 21:59:27 +08:00
Zhiming Wang
0a029316af
Bump to v4.3.3 2020-07-26 13:01:32 +08:00
Zhiming Wang
26b29b30b1
Add CI build on GitHub Actions 2020-07-26 12:52:50 +08:00
Zhiming Wang
1d0d42d81a
filter: test_paditer: register_all before testing the overlay filter
avfilter_register_all required on FFmpeg <4 before avfilter_get_by_name can
find the builtin filters.
2020-07-26 12:42:57 +08:00
Zhiming Wang
e947bc5606
Fix clippy::transmute_ptr_to_ptr 2020-07-26 12:26:20 +08:00
Zhiming Wang
c9c6031a53
Fix clippy::ptr_offset_with_cast 2020-07-26 01:01:21 +08:00
Zhiming Wang
73b66ea438
Fix clippy::redundant_field_names 2020-07-26 01:01:13 +08:00
Zhiming Wang
ceb1a7ea7c
Allow clippy::{missing_safety_doc, module_inception, too_many_arguments} 2020-07-26 01:00:54 +08:00
Zhiming Wang
6639f02b80
Fix filter::filter::PadIter to actually iterate
Bug caught by clippy:

  error: offset calculation on zero-sized value
    --> src/filter/filter.rs:98:33
     |
  98 |             let pad = Pad::wrap(self.ptr.offset(self.cur));
     |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `#[deny(clippy::zst_offset)]` on by default
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zst_offset

The problem is that `AVFilterPad` is zero-sized:

  #[repr(C)]
  #[derive(Debug, Copy, Clone)]
  pub struct AVFilterPad {
      _unused: [u8; 0],
  }

which is in turn due to `AVFilterPad` being an opaque type in
`libavfilter/avfilter.h`:

  typedef struct AVFilterContext AVFilterContext;
  typedef struct AVFilterLink    AVFilterLink;
  typedef struct AVFilterPad     AVFilterPad;
  typedef struct AVFilterFormats AVFilterFormats;

Doing pointer arithmetic on an opaque (incomplete) type doesn't work. We have
to use the proper FFI calls to obtain info on individual pads. The API has to
be tweaked a bit; hopefully it doesn't break user programs (if it does it
should only break bugged ones...).

Fixes #20.
2020-07-25 23:34:27 +08:00
Zhiming Wang
ec7fed0333
Bump to v4.3.2 2020-07-24 22:23:22 +08:00
Tim Hellhake
65be233a12
Add Raspberry Pi compatibility
Signed-off-by: Zhiming Wang <i@zhimingwang.org>
2020-07-24 22:18:58 +08:00
Zhiming Wang
d4c64458db
Fix ARM compatibility
Tested to successfully compile in an arm64v8/debian:buster container (running
on an x64 box through qemu-aarch64). Should work on armhf too, though haven't
tested yet.
2020-07-24 20:27:58 +08:00
Zhiming Wang
c7145dd9cb
Bump to v4.3.1 2020-07-23 10:11:42 +08:00
Zhiming Wang
48bca3e610
examples/avi-to-ppm: fix frame indexing 2020-07-23 10:07:07 +08:00
Zhiming Wang
ba2caf9d13
software::scaling::context::run: fix srcSliceH argument
Output height was erroneously used as the srcSliceH argument to
sws_scale, causing the output frame to be partially blank when scaling
down or outright erroring when scaling up. See documentation of sws_scale:

https://www.ffmpeg.org/doxygen/4.0/group__libsws.html#gae531c9754c9205d90ad6800015046d74

Fixes #18.
2020-07-23 10:01:19 +08:00
Zhiming Wang
3e9c83ec4e
examples/avi-to-ppm: allow more than one stream in the input file
Only decode packets in the best video stream.

See #17.
2020-07-22 20:45:50 +08:00
Zhiming Wang
5d74df996d
README: add link to wiki and set expectations 2020-07-21 23:35:19 +08:00
Zhiming Wang
3325f7ee31
Cargo.toml: drop dependencies.ffmpeg-sys-next.path
This is really inconvenient for people who don't need to modify
rust-ffmpeg-sys.

To develop the two repos together just put

  paths = ['../rust-ffmpeg-sys']

in .cargo/config.toml.
2020-07-21 18:09:19 +08:00
Zhiming Wang
48271cc587
Bump to v4.3.0 2020-06-17 01:56:47 +08:00
Zhiming Wang
f050471dfe
README: update compat table 2020-06-17 01:56:30 +08:00
Zhiming Wang
15c87a7837
Add FFmpeg 4.3 specific code 2020-06-17 01:51:38 +08:00
Zhiming Wang
65d91df487
Bump to v4.2.2 2020-06-11 23:21:25 +08:00
Zhiming Wang
e6c028ac42
README: clarify support situation for FFmpeg <4
Pretty sure only 3.4.x works, and I have no intention of fixing things further
back.
2020-06-11 23:20:21 +08:00
Zhiming Wang
036c0e5b42
Fix duplicate enum variant issues for FFmpeg 3.4 2020-06-11 23:18:47 +08:00
abhijeetbhagat
3df1a1c209 Add example to convert AVI frame to RGB24 frame 2020-06-10 00:01:33 +05:30
Zhiming Wang
5a63bbff5b
Bump to v4.2.1 2020-06-02 19:04:02 +08:00
Zhiming Wang
97a43cf34a
Drop resampling from default features
lavr has been deprecated since FFmpeg 4.0.

Closes #3.
2020-06-02 19:03:13 +08:00
Zhiming Wang
83150c968c
Bump to v4.2.0 2020-06-02 18:50:01 +08:00
Zhiming Wang
e7f778b471
Update README with more info on versioning 2020-06-02 18:49:37 +08:00