forge
Explore
Log in

Don't you dare go Hollow

edith_codecs

Clone
★ 0

0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits

offs.rs22 lines, 568 bytesHistoryRawDownload
1use ec_core::registry::Demuxer;
2use std::fs::File;
3use std::io::BufReader;
4fn main() {
5 let path = std::env::args().nth(1).unwrap();
6 let mut d = ec_mpegts::TsDemuxer::new(BufReader::new(File::open(path).unwrap())).unwrap();
7 let mut n = 0;
8 while let Ok(p) = d.next_packet() {
9 println!(
10 "{} off {} pts {:?} dur {:?} len {}",
11 p.stream,
12 d.last_packet_offset(),
13 p.pts,
14 p.duration,
15 p.data.len()
16 );
17 n += 1;
18 if n > 14 {
19 break;
20 }
21 }
22}