Comments (10)
Yes, it makes sense. We have custom commandline options available for the WebP anki add-on, so something similar could be added here as well.
from mpvacious.
Ah, you can't pass an array in script-ops
-- mp.read_config
is limited to strings, booleans, and numbers...
from mpvacious.
Yes, but I guess you can pass a string and split it later.
from mpvacious.
Yeah, that's what I'll probably do -- I was hoping to avoid splitting strings on spaces because then the next problem is how to deal with escaping of strings. I'll cook something up later this week (for the moment I've just hard-coded the filters I wanted to add to mpvacious).
from mpvacious.
So I have a patch for this now, but I've run into a problem -- mpv
applies the --start
and --end
flags after the filter has been applied, which means that if you have a filter like silenceremove
where the timestamps of the audio will shift after the filter is applied, the audio clip is misaligned. Because mpv appears (unsurprisingly) to only apply the filter to the rough area of the clip, this ends up only causing minor misalignments but it's a bit of a shame (it's more noticeable if the subtitle line contains a long pause -- but it's exactly in that case where you'd want to use silenceremove
).
To fix this we could add an (optional) custom post-processing stage where users could specify an mpv
command (or any arbitrary command) to run before we add the file to Anki. This would remove the need to add anything to the exist mpv command-line but it would mean double-encoding the audio. What do you think @tatsumoto-ren?
from mpvacious.
If speech contains a long pause, it makes more sense to create two cards and then join them if necessary. We have an add-on for that, it's called mergenotes
.
from mpvacious.
I'm not sure I agree -- for instance the opening line of Dr. Stone is 「その日世界中の人間は全て―」 but there's a ~1-2 second pause after その日 (but it is still one subtitle line). To use mergenotes
you'd need to manually split the line then re-merge them when silenceremove
would solve the problem entirely.
from mpvacious.
I think double encoding audio is absolutely fine, as long as the user knows what they're getting themselves into and is not enabled by default. This is annoying though, because it also slows down every other command line double encoding that doesn't affect timings; maybe an mpv patch is order...
from mpvacious.
@tatsumoto-ren 39d9c59 added silenceremove
to the default extraction settings but (unless mpv has changed their behaviour) this has the same issue as the one I mentioned above which might cause misaligned audio clips for a lot of users -- IMHO that option should be removed unless we want to add a two-pass method.
I still reckon it'd be useful to at least be able to specify loudnorm since videos can have wildly varying volumes and tie_volumes
has its own issues.
from mpvacious.
c5739bc implemented most of this -- though as mentioned above there is still a minor issue with silenceremove
. But I'm happy with closing this, and thanks for writing the patch for me (I was a bit busy with other things to get around to it).
from mpvacious.
Related Issues (20)
- Can't make cards while using Celluloid HOT 16
- Copying subtitles with diacritics unexpectedly strips spaces HOT 6
- [sound] audio tag doesn't get rendered in firefox if used with opus filetype HOT 2
- I'm trying to setup mpvacious with vocabsieve to learn English! HOT 2
- Hide subtitles but copy to clipboard HOT 1
- The Audio From mpvacious does not work when imported to anki on a specific scene. HOT 2
- Web view HOT 2
- MACOS Mulitple subs2srs errors (FFMPEG?) HOT 1
- Audio padding issue HOT 17
- subs2srs.lua module/file not found HOT 2
- ogg. file generated but no audio HOT 4
- Clipboard capture doesn't work HOT 14
- Can't make addon to work HOT 3
- Subtitle lines with only one double quote break when copying to clipboard on Windows HOT 4
- Failed to add card, loading external audio file to video HOT 1
- Problems with base64 encoding HOT 6
- Secondary subtitles problem: only accepts native language as primary HOT 3
- Add an option to create text-only cards HOT 3
- [Feature Request]audio_padding can set start time and end time independently HOT 4
- unexpected sentence trimming HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpvacious.