Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 28-07-2016, 11:48
averanted averanted is offline
Registered User
 
Join Date: Jul 2016
Location: tunnel
Posts: 3
Thanks: 4
Thanked 1 Time in 1 Post
averanted is on a distinguished road
Need help with opus and freearc

Hello guys I have a problem.
I am trying to compress wav files with opusenc and arc.
Compression process works fine but when I try to decompress it, freearc keeps extracting the file again and again and never stops.
I used this command to compress my wav:
Code:
arc a -mopus out.bin file.wav
and to decompress it:
Code:
arc x out.bin
my arc.ini file
Quote:
[External compressorpus]
header = 0
packcmd = opusenc {option} --bitrate 320.000 --comp 10 --quiet --framesize 60 $$arcdatafile$$.tmp $$arcpackedfile$$.tmp
unpackcmd = opusdec $$arcpackedfile$$.tmp $$arcdatafile$$.tmp

[External compressor:flac]
header = 0
packcmd = flac {option} -f -8 -o$$arcpackedfile$$.tmp $$arcdatafile$$.tmp
unpackcmd = flac {option} -d -o$$arcdatafile$$.tmp $$arcpackedfile$$.tmp
Output from cmd:
Compression
Quote:
D:\Test\inno\Compressor v1.2.0\Include>arc a -mopus out.bin file.wav
FreeArc 0.67 (November 12 2011) updating archive: out.bin
Compressing 1 file, 40,355,660 bytes. Processed 0%
Compressing 40,355,660 bytes with opusenc --bitrate 320.000 --comp 10 --quiet -
-framesize 60 $$arcdatafile$$.tmp $$arcpackedfile$$.tmp
100%
Errorlevel=0
Compressed 1 file, 40,355,660 => 9,325,308 bytes. Ratio 23.1%
Compression time: cpu 0.62 secs, real 13.51 secs. Speed 2,988 kB/s
All OK
decompression:
Quote:
FreeArc 0.67 (November 12 2011) extracting archive: out.bin
Extracting 1 file, 40,355,660 bytes. Processed 0%
Unpacking 9,325,308 bytes with opusdec $$arcpackedfile$$.tmp $$arcdatafile$$.tmp

Decoding to 44100 Hz (2 channels)
Encoded with libopus 1.1
ENCODER=opusenc from opus-tools 0.1.9
ENCODER_OPTIONS=--bitrate 320.000 --comp 10 --quiet --framesize 60
Decoding complete.

Errorlevel=0

Unpacking 9,325,308 bytes with opusdec $$arcpackedfile$$.tmp $$arcdatafile$$.tmp

Decoding to 44100 Hz (2 channels)
Encoded with libopus 1.1
ENCODER=opusenc from opus-tools 0.1.9
ENCODER_OPTIONS=--bitrate 320.000 --comp 10 --quiet --framesize 60
Decoding complete.

Errorlevel=0

Unpacking 9,325,308 bytes with opusdec $$arcpackedfile$$.tmp $$arcdatafile$$.tmp

Decoding to 44100 Hz (2 channels)
Encoded with libopus 1.1
ENCODER=opusenc from opus-tools 0.1.9
ENCODER_OPTIONS=--bitrate 320.000 --comp 10 --quiet --framesize 60
[\] 00:00:36
Errorlevel=-1073741510

ERROR: can't close file (null)
I pressed Ctrl+C to stop it.

With flac and it worked fine.
Compression:
Quote:
D:\Test\inno\Compressor v1.2.0\Include>arc a -mflac out.bin file.wav
FreeArc 0.67 (November 12 2011) creating archive: out.bin
Compressing 1 file, 40,355,660 bytes. Processed 0%
Compressing 40,355,660 bytes with flac -f -8 -o$$arcpackedfile$$.tmp $$arcdataf
ile$$.tmp

flac 1.3.1, Copyright (C) 2000-2009 Josh Coalson, 2011-2014 Xiph.Org Foundatio
n
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.

100%$$arcdatafile$$.tmp: wrote 23359691 bytes, ratio=0.579

Errorlevel=0
Compressed 1 file, 40,355,660 => 23,359,691 bytes. Ratio 57.8%
Compression time: cpu 0.59 secs, real 6.34 secs. Speed 6,368 kB/s
All OK
decompression:
Quote:
D:\Test\inno\Compressor v1.2.0\Include>arc x out.bin
FreeArc 0.67 (November 12 2011) extracting archive: out.bin
Extracting 1 file, 40,355,660 bytes. Processed 0%
Unpacking 23,359,691 bytes with flac -d -o$$arcdatafile$$.tmp $$arcpackedfile$$
.tmp

flac 1.3.1, Copyright (C) 2000-2009 Josh Coalson, 2011-2014 Xiph.Org Foundatio
n
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.

$$arcpackedfile$$.tmp: done

Errorlevel=0
Extracted 1 file, 23,359,691 => 40,355,660 bytes. Ratio 57.8%
Extraction time: cpu 0.72 secs, real 2.03 secs. Speed 19,869 kB/s
All OK
I think I know why it works for flac but not for opus.
opus's output is lossy but arc is trying to get the original wav file which is not possible.

Is there a way to stop arc after first attempt.

Sorry if all this is stupid, but I just came to know about arc.ini is and what it does.
Reply With Quote
The Following User Says Thank You to averanted For This Useful Post:
1234567890123 (29-07-2016)
Sponsored Links
  #2  
Old 29-07-2016, 01:16
Razor12911's Avatar
Razor12911 Razor12911 is offline
Programmer
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,628
Thanks: 2,003
Thanked 10,315 Times in 2,197 Posts
Razor12911 is on a distinguished road
I don't know if you tried tta but it works on wav audio without much trouble. If that is not enough, you should check out msc.

example
arc.exe a -ep1 -r -ed -mtta data.arc "C:\myaudio\*"
Attached Images
File Type: png tta.PNG (49.3 KB, 139 views)
Reply With Quote
The Following 2 Users Say Thank You to Razor12911 For This Useful Post:
1234567890123 (29-07-2016), averanted (29-07-2016)
  #3  
Old 29-07-2016, 05:16
FitGirl FitGirl is offline
Registered User
 
Join Date: Dec 2014
Location: Riga
Posts: 189
Thanks: 16
Thanked 227 Times in 122 Posts
FitGirl is on a distinguished road
Quote:
Originally Posted by averanted View Post
I think I know why it works for flac but not for opus.
Because checksum of extracted content is different from original. You can't use FreeArc for lossy extraction.
Reply With Quote
The Following 2 Users Say Thank You to FitGirl For This Useful Post:
Amsal (29-07-2016), averanted (29-07-2016)
  #4  
Old 29-07-2016, 09:07
averanted averanted is offline
Registered User
 
Join Date: Jul 2016
Location: tunnel
Posts: 3
Thanks: 4
Thanked 1 Time in 1 Post
averanted is on a distinguished road
Thanks Razor12911 and FitGirl for the reply.
But what if want to make a lossy repack because msc is compressing it with lossless format.
I used to make lossy setups which installed with help of batch file but now I want to try inno setup for my installer. Is it possible to use ogg, opus, he-aac in repacks without having problem with checksum because they are definitely going to change?
Reply With Quote
  #5  
Old 29-07-2016, 10:39
Razor12911's Avatar
Razor12911 Razor12911 is offline
Programmer
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,628
Thanks: 2,003
Thanked 10,315 Times in 2,197 Posts
Razor12911 is on a distinguished road
Well then you're gonna have to do all that without Freearc, first encode the audio then include the final output in archive along with other non encoded files in any.

If the files you encoded need decoding for them to work with whatever application is using them then you simply unpack the archive like you unpack other archives.

This is what you should do. (Using ogg example)
Encode all files, keep file list of encoded audio then everything with Freearc.

Then in inno setup. Add this.

if FileExists(ExpandConstant('{app}\ogg.ini')) and (ISDoneError = False) then
begin
Wizardform.ProgressGauge.Max:=0;
i:=1;
repeat
if FileExists(AddBackSlash(ExpandConstant('{app}')) + GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini'))) then
Wizardform.ProgressGauge.Max:= Wizardform.ProgressGauge.Max + 1;
i:= i + 1;
until GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini')) = '';
WizardForm.ProgressGauge.Position:=0;
i:=1;
repeat
OggFile:=AddBackSlash(ExpandConstant('{app}')) + GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini'));
ProgressLabels(GetMessage(3,'',''),OggFile);
Exec(ExpandConstant('{tmp}\oggdec.exe'), '"' + OggFile + '"' + ' ' + '-w"' + OggFile + '_"', '',SW_HIDE, ewWaitUntilTerminated, MsgResult);
RenameFile(OggFile + '_',OggFile);
if FileExists(AddBackSlash(ExpandConstant('{app}')) + GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini'))) then
WizardForm.ProgressGauge.Position:= WizardForm.ProgressGauge.Position + 1;
i:= i + 1;
until (GetIniString('OggDecode','Ogg' + IntToStr(i),'',ExpandConstant('{app}\ogg.ini')) = '') or ISDoneError = True;
DeleteFile(ExpandConstant('{app}\ogg.ini'));
end;

Take note, this is just an example, you obviously have to do a bit of modification for it to work for your script.
Ogg.ini is the file in this case chosen to have list of files, unfortunately for this to work very well for you, it's either you write this ini configuration format or maybe learn a bit of delphi to be able to use TStringList to be able to use the non configuration approach. Done.

The configuation looks like this.

[OggDecode]
Ogg1=myogg1.ogg
Ogg2=game\encoded.ogg
....
Reply With Quote
The Following 2 Users Say Thank You to Razor12911 For This Useful Post:
averanted (29-07-2016), RamiroCruzo (29-07-2016)
  #6  
Old 29-07-2016, 10:53
averanted averanted is offline
Registered User
 
Join Date: Jul 2016
Location: tunnel
Posts: 3
Thanks: 4
Thanked 1 Time in 1 Post
averanted is on a distinguished road
Thanks razor12911 I really needed something like this
Reply With Quote
  #7  
Old 29-07-2016, 11:00
Razor12911's Avatar
Razor12911 Razor12911 is offline
Programmer
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,628
Thanks: 2,003
Thanked 10,315 Times in 2,197 Posts
Razor12911 is on a distinguished road
Just in case you are not good in pascal.
Attached Files
File Type: 7z example.7z (3.0 KB, 46 views)
Reply With Quote
The Following 4 Users Say Thank You to Razor12911 For This Useful Post:
averanted (29-07-2016), pakrat2k2 (30-07-2016), RamiroCruzo (29-07-2016), Simorq (29-07-2016)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -7. The time now is 18:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com