You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pubfnopen_memory_file(data:Arc<Vec<u8>>) -> Result<AVFormatContextInput>{letmut current = 0;let io_context = AVIOContextCustom::alloc_context(AVMem::new(1048576),false,vec![],Some(Box::new(move |_, buf| {let right = data.len().min(current + buf.len());if right <= current {return ffi::AVERROR_EOF;}let read_len = right - current;
buf[0..read_len].copy_from_slice(&data[current..right]);
current = right;
read_len asi32})),None,None,);let input_format_context = matchAVFormatContextInput::from_io_context(
rsmpeg::avformat::AVIOContextContainer::Custom(io_context),){Ok(x) => x,Err(e) => {bail!("open file default:{}", e);}};Ok(input_format_context)}
The above code will have the following output for some files
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffff0000f40] stream 0, offset 0x30: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffff0000f40] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(tv, bt709), 720x1280, 11185 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
But if I use AVformatContextInput::open() to open a file that exists on disk it works fine.
The text was updated successfully, but these errors were encountered:
The above code will have the following output for some files
But if I use
AVformatContextInput::open()
to open a file that exists on disk it works fine.The text was updated successfully, but these errors were encountered: