fn write_pgmyuv(pfx: &str, strno: usize, num: u64, frmref: NAFrameRef) {
let frm = frmref.borrow();
if let NABufferType::None = frm.get_buffer() { return; }
- let name = format!("assets/{}out{:02}_{:04}.pgm", pfx, strno, num);
+ let name = format!("assets/{}out{:02}_{:06}.pgm", pfx, strno, num);
let mut ofile = File::create(name).unwrap();
let buf = frm.get_buffer().get_vbuf().unwrap();
let (w, h) = buf.get_dimensions(0);
fn write_palppm(pfx: &str, strno: usize, num: u64, frmref: NAFrameRef) {
let frm = frmref.borrow();
- let name = format!("assets/{}out{:02}_{:04}.ppm", pfx, strno, num);
+ let name = format!("assets/{}out{:02}_{:06}.ppm", pfx, strno, num);
let mut ofile = File::create(name).unwrap();
let buf = frm.get_buffer().get_vbuf().unwrap();
let (w, h) = buf.get_dimensions(0);
let frm = dec.decode(&pkt).unwrap();
if pkt.get_stream().get_info().is_video() && video_pfx.is_some() && frm.borrow().get_frame_type() != FrameType::Skip {
let pfx = video_pfx.unwrap();
+ let pts = if let Some(fpts) = frm.borrow().get_pts() { fpts } else { pkt.get_pts().unwrap() };
if frm.borrow().get_buffer().get_vbuf().unwrap().get_info().get_format().is_paletted() {
- write_palppm(pfx, streamno, pkt.get_pts().unwrap(), frm);
+ write_palppm(pfx, streamno, pts, frm);
} else {
- write_pgmyuv(pfx, streamno, pkt.get_pts().unwrap(), frm);
+ write_pgmyuv(pfx, streamno, pts, frm);
}
}
}