mirror of
https://github.com/CDrummond/bliss-analyser.git
synced 2025-04-08 05:00:02 +03:00
Dont transcode CUE tracks to MP3, just copy in original format - *much*
faster
This commit is contained in:
parent
649ce31907
commit
4c40a0b41b
@ -180,8 +180,8 @@ CUE files
|
||||
If the anlyser encounters an audio file with a matching CUE file (e.g.
|
||||
`album.flac` and `album.cue` in same folder) then it will attempt to analyse the
|
||||
individual tracks contained within. To do this the analyser uses `ffmpeg` to
|
||||
create temporary 128k MP3 files of each track. (These temporary files are
|
||||
removed afterwards).
|
||||
create temporary files of each track, which are then analysed. (These temporary
|
||||
files are removed afterwards).
|
||||
|
||||
|
||||
Exclude folders
|
||||
|
@ -192,8 +192,9 @@ pub fn analyze_cue_streaming(tracks: Vec<cue::CueTrack>,) -> BlissResult<Receive
|
||||
|
||||
log::debug!("Extracting '{}'", track_path);
|
||||
if cue_track.duration<last_track_duration {
|
||||
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path).arg("-b:a").arg("128k")
|
||||
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path)
|
||||
.arg("-ss").arg(&cue_track.start.hhmmss()).arg("-t").arg(&cue_track.duration.hhmmss())
|
||||
.arg("-c").arg("copy")
|
||||
.arg(String::from(tmp_file.to_string_lossy()))
|
||||
.stderr(NullFile)
|
||||
.join() {
|
||||
@ -201,8 +202,9 @@ pub fn analyze_cue_streaming(tracks: Vec<cue::CueTrack>,) -> BlissResult<Receive
|
||||
Err(e) => { log::error!("Failed to call ffmpeg. {}", e); }
|
||||
}
|
||||
} else {
|
||||
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path).arg("-b:a").arg("128k")
|
||||
match Exec::cmd("ffmpeg").arg("-i").arg(&audio_path)
|
||||
.arg("-ss").arg(&cue_track.start.hhmmss())
|
||||
.arg("-c").arg("copy")
|
||||
.arg(String::from(tmp_file.to_string_lossy()))
|
||||
.stderr(NullFile)
|
||||
.join() {
|
||||
|
@ -49,7 +49,7 @@ pub fn parse(audio_path:&PathBuf, cue_path:&PathBuf) -> Vec<CueTrack> {
|
||||
Some((_, start)) => {
|
||||
let mut track_path = audio_path.clone();
|
||||
let ext = audio_path.extension().unwrap().to_string_lossy();
|
||||
track_path.set_extension(format!("{}{}{}.mp3", ext, MARKER, resp.len()+1));
|
||||
track_path.set_extension(format!("{}{}{}", ext, MARKER, resp.len()+1));
|
||||
let mut ctrack = CueTrack {
|
||||
audio_path: audio_path.clone(),
|
||||
track_path: track_path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user