Oh, right, Staxrip doesn't like when we trim the video manually, I forgot. If I remember right, it won't even accept it properly even if you modify the cutting section.
The audio isn't processed by the same avisynth script as the video which is why that happens. That's what I do manually to make sure the audio always fits.
So... I'm pretty sure you'd have to do the reordering using the preview thing but as far as I can tell, that's not possible so it might not be possible to do it with staxrip. You'd have to ask on their forum or directly to the dev if it's possible to somehow change the order of video sections.
I tried messing with the project file and manually editing the cut in there since it won't save it to the project if you manually change it and it breaks the project so that's not an option.
From looking at the log file, it's cutting the audio with mkvmerge and a dummy temporary video file so even if we could edit it, I'm not sure it could handle reordering the audio
I tried making an avisynth script for the audio instead of using the ac3 file directly but avisynth complains if there's no video and you want to trim it and if you add a video then mkvmerge doesn't recognize it as audio anymore and will refuse to process it.
The only way I have left to make this work would be to encode the audio manually using the trims you use for the video and use that as a source for the audio
Why do I even bother writing stuff before I actually give up trying to find a solution.
The workaround for it I found messing with staxrip interface would be to manually create an avisynth script for the audio and add the same trims in there, load that as the audio source and use command line as the encoder so it uses ffmpeg to encode the audio using the avisynth script.
In the temporary folder staxrip creates when you load a source(located in the same folder as that source), find the avs file with the source name which should have something like the following inside(but a different plugin since you use a mkv instead of the vob stuff, same principle applies though):
Code:
AddAutoloadDir("C:\Progs\StaxRip-v2.13.0-x64\Apps\FrameServer\AviSynth\plugins")
LoadPlugin("C:\Progs\StaxRip-v2.13.0-x64\Apps\Support\DgMpgDec\DGDecode.dll")
MPEG2Source("K:\_2enc_\_ISO\GON-313\VTS_02_1_temp\VTS_02_1.d2v")
Copy that file and give a name related to audio that you'll recognize and open it with a text editor like good old notepad.
You'll keep the video stuff from the original file and add the audio stuff which should look something like this but with paths appropriate to your pc:
Code:
AddAutoloadDir("C:\Progs\StaxRip-v2.13.0-x64\Apps\FrameServer\AviSynth\plugins")
LoadPlugin("C:\Progs\StaxRip-v2.13.0-x64\Apps\Support\DgMpgDec\DGDecode.dll")
LoadPlugin("C:\Progs\StaxRip-v2.13.0-x64\Apps\Plugins\AVS\NicAudio\NicAudio.dll")
Vid = MPEG2Source("K:\_2enc_\_ISO\GON-313\VTS_02_1_temp\VTS_02_1.d2v")
Aud = NicAC3Source("K:\_2enc_\_ISO\GON-313\VTS_02_1_temp\VTS_02_1 ID0 2ch 448Kbps.ac3")
AudioDub(Vid,Aud)
Also add your trims after the AudioDub line.
Then in staxrip you load that file as the audio instead of the ac3 file and instead of "Copy/Mux" or whatever else you were using, pick "Command Line" or better yet, go to "Edit Profiles..." and clone the Command Line one to something new(rename to avs source or something like that) since we'll be editing it a bit.
Once selected, click edit on the right and set the settings to match the profile you were using previously(select that profile first and go in edit to see the details).
For example, if you wanted to encode the audio to opus, which is what I use now thanks to porni, you would copy the ffmpeg command at the bottom in that profile that says "ffmpeg -c:a libopus -b:a 250k -ac 2", go back to the source you created or the command line one if you didn't and change
Code:
"%app:ffmpeg%" -i %input% -b:a %bitrate%k -y -hide_banner %output%
to
Code:
"%app:ffmpeg%" -i %input% -c:a libopus -b:a %bitrate%k -ac 2 -y -hide_banner %output%
, put 250 in the bitrate box above instead of the default 640, change the output file type to opus and the Channels to 2 since it's almost certainly stereo(don't if it isn't), but not sure if it actually gets used or not.
Then click the down arrow next to the ok button and save the profile and you should be good to go.
A bitrate of 128(which is what I use) would be more appropriate for opus since 250 is way overkill(unless the ffmpeg version is somehow different than the official encoder but I'm pretty sure it uses the same library) and you could even go as low as 64 if you wanted to save some space.
Make sure to keep hijacking a section for your trims and not use the proper cutting section or that would mess things up.