zhangzhilinx / qsv2flv Goto Github PK
View Code? Open in Web Editor NEWA tool developed in Rust to convert QSV to FLV(一个爱奇艺qsv转flv工具,不会生成多余的临时文件,使用Rust开发)
License: Mozilla Public License 2.0
A tool developed in Rust to convert QSV to FLV(一个爱奇艺qsv转flv工具,不会生成多余的临时文件,使用Rust开发)
License: Mozilla Public License 2.0
麻烦作者辛苦添加个编译可执行文件的README
在爱奇艺下载了爱情公寓和请回答1988的1080p视频进行转换,发现执行命令后长时间没反应
大佬您好,现在mac m1发现好像不支持耶,不知道是什么原因提示:failed to fill whole buffer
如果可以希望编绎出m1 mac版本的。也可能是我爱奇艺版本的问题,我的版本是11.12.5,下载后的程序藏得很深。而且文件名非原来视频名,并附带一个qsv.star文件。文件内容如下:
[{"sl":"214316805","vl":[{"ep":619,"sp":473},{"ep":913,"sp":705},{"ep":1661,"sp":959},{"ep":1876,"sp":1862},{"ep":2139,"sp":2073},{"ep":2285,"sp":2205},{"ep":2582,"sp":2351}]},{"sl":"200028905","vl":[{"ep":693,"sp":680},{"ep":959,"sp":928},{"ep":1955,"sp":1881}]}]
目标视频:飞虎队第一集
链接:https://www.iqiyi.com/v_19rroa7j4g.html
方式:通过爱奇艺客户端下载
结果:
Z:>x86_64-pc-windows-msvc-qsv2flv.exe 飞虎队第1集-超清720P.qsv 1.flv
[ERROR] Couldn't convert 飞虎队第1集-超清720P.qsv to 1.flv: failed to fill whole buffer
您好,请问如何得知qsv格式文件的详细结构信息呢?我目前只知道文件前10个字符是“QIYI VIDEO”。
Couldn't convert .\668374600_668374600.qsv to test2.flv: failed to fill whole buffer
试了一下flv格式转换怎么那么快, 30m 一秒钟完成 。。
您好作者,本菜通过这项目刚接触 rust,现在转换 山海情(原声版)第1集-蓝光1080P 遇到问题,一直停在 [STEP] Parse all tag blocks... 这一步。
用的爱奇艺 PC 端最新版 8.1.128,文件前十一位字符为 QIYI VIDEO
,版本 2。
拉代码加了一些 println,确定问题在下面函数里。执行不会退出,找不到 u32::from_be_bytes(buf) == len
满足的。用的 CPU 是 Little-Endian,把所有 from_be_bytes 函数换成了 from_le_bytes 也还是一样。
pub fn tag_blocks_from_qsv(qsv: &mut File) -> std::io::Result<FlvTagBlocks> {
......
println!("[INFO] 4");
let mut blocks = FlvTagBlocks::with_capacity(DEFAULT_CAP_BLOCKS);
seek_qsv_to_start(qsv)?;
println!("[INFO] 4.1");
skip_qsv_metadata(qsv)?;
println!("[INFO] 4.2");
......
}
#[inline]
pub fn skip_qsv_metadata(qsv: &mut File) -> std::io::Result<()> {
let mut pos = 0u64;
pos = qsv.seek(SeekFrom::Current(0x0D))?;
println!("[INFO] 4.1.1, pos: {}", pos);
let mut len = 0u32;
let mut buf = [0u8; 4]; // 共用的缓冲区
loop {
qsv.read_exact(&mut buf[0..1])?; // 读取1个字节
len += 1;
println!("[INFO] 4.1.2 pos: {}, buf: {}, len: {}", pos, u32::from_le_bytes(buf), len);
thread::sleep(time::Duration::from_millis(50));
if buf[0] == 0x09 {
qsv.read_exact(&mut buf)?;
println!("[INFO] 4.1.3 - pos: {}, buf: {}, len: {}", pos, u32::from_le_bytes(buf), len);
if u32::from_le_bytes(buf) == len {
println!("[INFO] 4.1.4");
break;
} else {
println!("[INFO] 4.1.5");
pos = qsv.seek(SeekFrom::Current(-4))?;
}
}
}
Ok(())
}
打印日志如下
[STEP] Validate qsv file...
[INFO] QSV format tag: QIYI VIDEO, ver: 2...
[STEP] Parse all tag blocks...
[INFO] 1
[INFO] 2
[INFO] 3
[INFO] 4
[INFO] TRUE size: 165604, offset: 395, meta len: 811428299
[INFO] 4.1
[INFO] 4.1.1, pos: 165999
[INFO] 4.1.2 pos: 165999, buf: 236, len: 1
[INFO] 4.1.2 pos: 165999, buf: 103, len: 2
[INFO] 4.1.2 pos: 165999, buf: 42, len: 3
[INFO] 4.1.2 pos: 165999, buf: 236, len: 4
[INFO] 4.1.2 pos: 165999, buf: 69, len: 5
[INFO] 4.1.2 pos: 165999, buf: 236, len: 6
[INFO] 4.1.2 pos: 165999, buf: 203, len: 7
[INFO] 4.1.2 pos: 165999, buf: 206, len: 8
[INFO] 4.1.2 pos: 165999, buf: 116, len: 9
[INFO] 4.1.2 pos: 165999, buf: 67, len: 10
[INFO] 4.1.2 pos: 165999, buf: 81, len: 11
[INFO] 4.1.2 pos: 165999, buf: 255, len: 12
[INFO] 4.1.2 pos: 165999, buf: 103, len: 13
[INFO] 4.1.2 pos: 165999, buf: 43, len: 14
[INFO] 4.1.2 pos: 165999, buf: 0, len: 15
[INFO] 4.1.2 pos: 165999, buf: 79, len: 16
[INFO] 4.1.2 pos: 165999, buf: 255, len: 17
[INFO] 4.1.2 pos: 165999, buf: 255, len: 18
[INFO] 4.1.2 pos: 165999, buf: 96, len: 19
[INFO] 4.1.2 pos: 165999, buf: 96, len: 20
[INFO] 4.1.2 pos: 165999, buf: 96, len: 21
[INFO] 4.1.2 pos: 165999, buf: 201, len: 22
[INFO] 4.1.2 pos: 165999, buf: 80, len: 23
[INFO] 4.1.2 pos: 165999, buf: 216, len: 24
[INFO] 4.1.2 pos: 165999, buf: 225, len: 25
[INFO] 4.1.2 pos: 165999, buf: 255, len: 26
[INFO] 4.1.2 pos: 165999, buf: 220, len: 27
[INFO] 4.1.2 pos: 165999, buf: 213, len: 28
[INFO] 4.1.2 pos: 165999, buf: 255, len: 29
[INFO] 4.1.2 pos: 165999, buf: 255, len: 30
[INFO] 4.1.2 pos: 165999, buf: 181, len: 31
[INFO] 4.1.2 pos: 165999, buf: 227, len: 32
[INFO] 4.1.2 pos: 165999, buf: 0, len: 33
[INFO] 4.1.2 pos: 165999, buf: 1, len: 34
[INFO] 4.1.2 pos: 165999, buf: 243, len: 35
[INFO] 4.1.2 pos: 165999, buf: 11, len: 36
[INFO] 4.1.2 pos: 165999, buf: 255, len: 37
[INFO] 4.1.2 pos: 165999, buf: 25, len: 38
[INFO] 4.1.2 pos: 165999, buf: 77, len: 39
[INFO] 4.1.2 pos: 165999, buf: 179, len: 40
[INFO] 4.1.2 pos: 165999, buf: 194, len: 41
[INFO] 4.1.2 pos: 165999, buf: 255, len: 42
[INFO] 4.1.2 pos: 165999, buf: 77, len: 43
[INFO] 4.1.2 pos: 165999, buf: 206, len: 44
[INFO] 4.1.2 pos: 165999, buf: 58, len: 45
[INFO] 4.1.2 pos: 165999, buf: 255, len: 46
[INFO] 4.1.2 pos: 165999, buf: 1, len: 47
[INFO] 4.1.2 pos: 165999, buf: 0, len: 48
[INFO] 4.1.2 pos: 165999, buf: 0, len: 49
[INFO] 4.1.2 pos: 165999, buf: 156, len: 50
[INFO] 4.1.2 pos: 165999, buf: 240, len: 51
[INFO] 4.1.2 pos: 165999, buf: 142, len: 52
[INFO] 4.1.2 pos: 165999, buf: 255, len: 53
[INFO] 4.1.2 pos: 165999, buf: 255, len: 54
[INFO] 4.1.2 pos: 165999, buf: 0, len: 55
[INFO] 4.1.2 pos: 165999, buf: 219, len: 56
[INFO] 4.1.2 pos: 165999, buf: 192, len: 57
[INFO] 4.1.2 pos: 165999, buf: 171, len: 58
[INFO] 4.1.2 pos: 165999, buf: 255, len: 59
[INFO] 4.1.2 pos: 165999, buf: 35, len: 60
[INFO] 4.1.2 pos: 165999, buf: 248, len: 61
[INFO] 4.1.2 pos: 165999, buf: 255, len: 62
[INFO] 4.1.2 pos: 165999, buf: 136, len: 63
[INFO] 4.1.2 pos: 165999, buf: 0, len: 64
[INFO] 4.1.2 pos: 165999, buf: 0, len: 65
[INFO] 4.1.2 pos: 165999, buf: 244, len: 66
[INFO] 4.1.2 pos: 165999, buf: 81, len: 67
[INFO] 4.1.2 pos: 165999, buf: 62, len: 68
[INFO] 4.1.2 pos: 165999, buf: 161, len: 69
[INFO] 4.1.2 pos: 165999, buf: 38, len: 70
[INFO] 4.1.2 pos: 165999, buf: 24, len: 71
[INFO] 4.1.2 pos: 165999, buf: 255, len: 72
[INFO] 4.1.2 pos: 165999, buf: 107, len: 73
[INFO] 4.1.2 pos: 165999, buf: 255, len: 74
[INFO] 4.1.2 pos: 165999, buf: 255, len: 75
[INFO] 4.1.2 pos: 165999, buf: 71, len: 76
[INFO] 4.1.2 pos: 165999, buf: 104, len: 77
[INFO] 4.1.2 pos: 165999, buf: 255, len: 78
[INFO] 4.1.2 pos: 165999, buf: 123, len: 79
[INFO] 4.1.2 pos: 165999, buf: 255, len: 80
[INFO] 4.1.2 pos: 165999, buf: 106, len: 81
[INFO] 4.1.2 pos: 165999, buf: 236, len: 82
[INFO] 4.1.2 pos: 165999, buf: 27, len: 83
[INFO] 4.1.2 pos: 165999, buf: 255, len: 84
[INFO] 4.1.2 pos: 165999, buf: 9, len: 85
[INFO] 4.1.3 - pos: 165999, buf: 588185450, len: 85
[INFO] 4.1.5
[INFO] 4.1.2 pos: 166084, buf: 588185450, len: 86
[INFO] 4.1.2 pos: 166084, buf: 588185599, len: 87
[INFO] 4.1.2 pos: 166084, buf: 588185358, len: 88
[INFO] 4.1.2 pos: 166084, buf: 588185379, len: 89
[INFO] 4.1.2 pos: 166084, buf: 588185556, len: 90
[INFO] 4.1.2 pos: 166084, buf: 588185599, len: 91
[INFO] 4.1.2 pos: 166084, buf: 588185369, len: 92
[INFO] 4.1.2 pos: 166084, buf: 588185599, len: 93
[INFO] 4.1.2 pos: 166084, buf: 588185408, len: 94
[INFO] 4.1.2 pos: 166084, buf: 588185599, len: 95
[INFO] 4.1.2 pos: 166084, buf: 588185508, len: 96
[INFO] 4.1.2 pos: 166084, buf: 588185387, len: 97
[INFO] 4.1.2 pos: 166084, buf: 588185463, len: 98
[INFO] 4.1.2 pos: 166084, buf: 588185479, len: 99
[INFO] 4.1.2 pos: 166084, buf: 588185537, len: 100
[INFO] 4.1.2 pos: 166084, buf: 588185495, len: 101
[INFO] 4.1.2 pos: 166084, buf: 588185373, len: 102
[INFO] 4.1.2 pos: 166084, buf: 588185599, len: 103
[INFO] 4.1.2 pos: 166084, buf: 588185537, len: 104
[INFO] 4.1.2 pos: 166084, buf: 588185424, len: 105
[INFO] 4.1.2 pos: 166084, buf: 588185374, len: 106
[INFO] 4.1.2 pos: 166084, buf: 588185599, len: 107
日志前面 1,2,3,4 是 tag_blocks_from_qsv 每一步 inline 函数后打印的。接下来就是一直循环 4.1.2,4.1.3,4.1.5 这三步,一直到 len 12000000 都没有退出,郁闷。然后又去看了 qsv 文件结构,也没明白 u32::from_be_bytes(buf) == len
在找什么。
另外开发机器用的 Windows 10,调试 rust 代码是在 WSL 虚拟出的 Ubuntu Linux 4.4.0-19041-Microsoft x86_64 GNU/Linux。
如果你有空看我的问题,并指点下排查方法,会很感谢。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.