File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 11Direct, unobscured and self contained FFmpeg (sys) bindings.
22
3+ ``` rust
4+ let input_path_cstr = std :: ffi :: CString :: new (" path/to/source.mp4" ). unwrap (" to c str" );
5+
6+ // Open an e.g. MP4 file
7+ avformat_open_input (
8+ & mut ifmt_ctx ,
9+ input_path_cstr . as_ptr (),
10+ std :: ptr :: null_mut (),
11+ std :: ptr :: null_mut (),
12+ );
13+ avformat_find_stream_info (ifmt_ctx , std :: ptr :: null_mut ());
14+
15+ // Print info about the loaded file
16+ av_dump_format (
17+ ifmt_ctx ,
18+ 0 ,
19+ input_path_cstr . as_ptr (),
20+ 0 ,
21+ );
22+ ```
23+
24+
325``` rust
426let ifmt_ctx : AVFormatContext = * ifmt_ctx ;
527
6- // Extract video/audio/etc. streams from an e.g. MP4 file
28+ // Extract video/audio/etc. streams from our mp4 file
729let streams : & [AVStream ] = std :: slice :: from_raw_parts (
830 * ifmt_ctx . streams,
931 ifmt_ctx . nb_streams as usize
You can’t perform that action at this time.
0 commit comments