<Varro>
How can I generate 2-channel sine wave, but with inverted phase for the channels with each other?
<Varro>
So far, I have managed to generate two independent sine frequencies: `lavfi -i 'sine=f=500[0];sine=f=1000[1];[0][1]amerge=inputs=2, atrim=end=2;'`
<Varro>
But I cannot figure out how I can essentially make the output of one of them negative
<aaabbb>
Varro: i think there's a filter for phase shifting
<aaabbb>
stereotools=phasel i think
<aaabbb>
(for left channel)
<Varro>
ahh thanks i see aphaseshift
Guestmodinfo has quit [Quit: Client closed]
<aaabbb>
aeval=val(0)|-val(1) inverts phase of channel 2
<Varro>
Ahh yeah that worked thank you
<aaabbb>
while keeping the same phase of the first
<aaabbb>
Varro: the filter graph is like a regular filter chain, but you can have multiple simultaneous chains
<aaabbb>
what you wrote was a filtergraph
<Varro>
and the [0] etc. are nodes?
<aaabbb>
because 'sine=f=500[0]' and 'sine=f=1000[1]' both run simultaneously, outputting to [0] and [1] respectively, then '[0][1]amerge=input=2' takes both of those inputs and merges them into one
<aaabbb>
they are the labels you use (i don't know the terminology in graph mathematics)
<Varro>
ahh i understand this now better
<Varro>
thanks
<aaabbb>
i think they are the trunks or connections whatever you call it. the names are arbitrary
<aaabbb>
so you could have [0] replaced with [my500hzsinewave] if you wanted
<Varro>
looke like the `[x]` are arbitrary numbers i give, to assign any node. and ultimately they need to be merged or mixed
fossdd has quit [Ping timeout: 268 seconds]
<Varro>
oh even string is allowed, cool
<aaabbb>
here's a more complex example: 'amovie=input.wav,aresample=48000,showwaves=s=800x202:mode=line:n=1,split=5[a0][a1][a2][a3][a4]; [a0]scale=w=1280:h=ih:flags=bilinear[b0]; [a1]scale=w=1280:h=ih:flags=bicubic[b1]; [a2]scale=w=1280:h=ih:flags=neighbor[b2]; [a3]scale=w=1280:h=ih:flags=lanczos[b3]; [a4]scale=w=1280:h=ih:flags=spline[b4]; [b0][b1][b2][b3][b4]vstack=5,setsar=1[out0]'
<aaabbb>
what that does is take one audio input, resample it to 48khz, then turn the audio into video (showwaves), and then resize that video multiple times using multiple scaling algorithms, then stack the videos verticaly so they can be compared
<aaabbb>
the comma is for delimiting filters within one chain, it just means output of the last filter is input of the next one. semicolon means that it's separating entire chains, which may or may not be able to run in parallel (depending on the dependencies of later chains)
fossdd has joined #ffmpeg
<aaabbb>
in that specific example, amovie=input.wav will read the file and output the audio, aresample=48000 will resample it to 48khz, showwaves=s=800x202:mode=line:n=1 will take audio as input and give video (a 800 by 202 pixel wave) as output, split=5 will then split the video into 5 identical ones with the named tags...
<aaabbb>
then each subsequent chain up until the very last runs in parallel, taking its input video, scaling it (each with a different scaling algorithm), then outputting it, like [a3] is video of the waves of the audio at 800x202, it goes into one (single-filter) chain, an the output, [b3], is that same video, but rescaled to 1280 by 202 using the lanczos algorithm. finally vstack takes all the input videos,
<aaabbb>
stacks them, then outputs
<aaabbb>
filtergraphs can be very simple, or very simple but very long with tens or even hundreds of similar chains, or extremely complex. that's one of the powers of -lavfi
<aaabbb>
with a more practical example, it allowed me to encode one video using different parameters, then crop, upscale, and put side by side in slow motion for me to carefully compare to see which looked better :)
beaver has joined #ffmpeg
Haripesch has joined #ffmpeg
<Varro>
thanks it make a lot of sense now
<aaabbb>
no problem :)
TuxJobs has joined #ffmpeg
<TuxJobs>
Problem: When I use ffmpeg to convert "Goonies II, The [blablabla].nsf" to test.flac, it becomes only one .flac file, which apparently corresponds to not the full playlist of songs inside the .nfs, but only the first song. There is also an accompanying .m3u file. I remember how when I used Windows and foobar2000, I was able to drag and drop the .nsf file into foobar2000 and it would automatically show them as individual tracks, and then I just selected
<TuxJobs>
"convert to FLAC" in a context menu item. But now on Linux, there is no foobar2000 and Audacious doesn't understand what an .nsf file is, so I'm trying to use ffmpeg to do it. If you want to inspect/experiment, the file can be downloaded from: https://www.zophar.net/music/nintendo-nes-nsf/goonies-ii-the ("Download original music files (11 KB)")
Varro has quit [Quit: leaving]
<aaabbb>
i didn't even know ffmpeg supported nsf
<aaabbb>
maybe gstreamer can convert it to wav, then you can use ffmpeg to convert to flac
<TuxJobs>
gstreamer... I keep hearing about that but can't seem to memorize what it is.
<TuxJobs>
aaabbb: It seems to support it, but it's confused about the output format?
<aaabbb>
post the ffmpeg command you use (put it on bpa.st)
<aaabbb>
like the complete output
<TuxJobs>
"GStreamer is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing."
<aaabbb>
for i in {0..10}; do ffmpeg -y -i 'Goonies II, The [Goonies 2 - Fratelli Saigo no Chousen] (1987-03-18)(Konami).nsf' -track_index $i output-$i.flac; done
<aaabbb>
that for example will output the first 11 tracks
MisterMinister has quit [Ping timeout: 272 seconds]
<TuxJobs>
Very interesting. But it has to know the number of tracks in advance then?
<aaabbb>
no it will just attempt to seek to that track
<aaabbb>
"Number of tracks is exported as tracks metadata entry."
<aaabbb>
but basically if you don't do -track_index foo then it will assume -track_index 0 and only import the 1st (0th) track
YuGiOhJCJ has quit [Remote host closed the connection]
YuGiOhJCJ has joined #ffmpeg
lexano has joined #ffmpeg
rv1sr has joined #ffmpeg
<TuxJobs>
aaabbb: It appears as if it ignores the -track_index for me. I've fed it 1 and 2 now but all sound the same as 0/none (presumably the first song).
<aaabbb>
try putting -track_index before the -i then
<TuxJobs>
And each time, it appears to go through the entire file based on how long it takes to run.
Ox7C5 has joined #ffmpeg
<TuxJobs>
aaabbb: Unexpectedly, that DID work!
<TuxJobs>
Very evil. Why does the order of how you put the arguments matter for some programs?
<aaabbb>
TuxJobs: because it's an option that's applied to the input
<aaabbb>
ffmpeg is weird that way. i think the ffmpeg wiki has an explaination about it but it's super relevant to ffmpeg
<TuxJobs>
Well, thanks. Now I'll be able to write a script to do this, although I'm still unsure about how to grab the metadata such as the track titles, which may or may not exist inside the .nsf but appear to exist in the .m3u.
fossdd has quit [Ping timeout: 255 seconds]
dionisis has joined #ffmpeg
fossdd has joined #ffmpeg
<furq>
metadata seems to work fine with nsfe
<furq>
but looping seems to be broken
<furq>
so that's not ideal
junaid_ has joined #ffmpeg
lightsleeper has joined #ffmpeg
<furq>
or i guess rather than broken it's just not there
fossdd has quit [Ping timeout: 272 seconds]
fossdd has joined #ffmpeg
Sciencentistguy has quit [Quit: o/]
Sciencentistguy has joined #ffmpeg
jmcantrell has quit [Quit: WeeChat 4.2.1]
rv1sr has quit []
<TuxJobs>
What would be the proper way to extract the metadata such as "total number of tracks" and "what is the title of track #2" from the .nsf?
<furq>
i don't think there is one
<aaabbb>
TuxJobs: nsf is just an nes rom with non-spc audio bytecode stripped
<aaabbb>
because there's no need for the nes rom to have track titles, neither will nsf
<furq>
nsf usually ships with an m3u that contains the metadata
<furq>
but i don't think there's any good way to tie those together with ffmpeg
<TuxJobs>
aaabbb: What about the pastebin I posted which showed some sort of metadata?
<TuxJobs>
furq: Yes, it has a .m3u, but I haven't fed it to ffmpeg.
<furq>
but also the libgme wrapper doesn't seem to support looping which makes it basically useless
<furq>
but apparently nowadays the only way to get nsfe files is in a rar on mediafire
<TuxJobs>
I guess the track titles aren't super important...
<furq>
which is not really ideal
<TuxJobs>
Zophar could've saved me tons of work by simply providing FLACs instead of just "original music files" and MP3s.
<TuxJobs>
I may not hear an extreme difference between MP3s and FLACs of NES games, but it's psychologically important to me.
<furq>
there's also vgm but apparently libgme doesn't support a new enough vgm version
<TuxJobs>
I don't want them to be "compromised" in any way.
<furq>
you should probably just get an audio player that supports libgme
<furq>
you shouldn't ever be converting them unless you want to burn to a cd or something
<TuxJobs>
Audacious took forever to beat into some sort of usable state. It seems to be the only usable media player for music on Linux.
<TuxJobs>
furq: Or if I want to be able to play them?
<TuxJobs>
And if I ever want to use the songs in some kind of production, I would then have to find out how to convert them anyway.
<aaabbb>
what's the compression ratio for flac coming from nsf? i'd expect it should be pretty significant
<furq>
about a million to one
fossdd has quit [Ping timeout: 255 seconds]
<aaabbb>
furq: really? so the wav will be a million times larger than the flac from an nsf file?
<furq>
no i mean it'll be a million times larger than the nsf
<aaabbb>
oh. i meant the compression that flac achieves, usually it's around 50% but i imagine nsf type audio is way more compressible
<furq>
maybe, maybe not
<aaabbb>
it's mostly square waves, triangle waves with sweeping etc
<aaabbb>
i think it would have very good compression unless the audio makes extremely heavy use of the noise channel (which uses an lfsr)
<furq>
right
<furq>
a lot of nes soundtracks you'd actually want to listen to do that
<furq>
and then there's famicom games that use extra sound chips
<aaabbb>
but even then the lfsr sequence repeats very rapidly
<furq>
with that said all the flac i have of nes games is from a soundtrack cd so some kind of mastering has been done
<aaabbb>
ah
<furq>
testing some newer games now and getting ~450kbps flac
<furq>
it will vary a lot though
<aaabbb>
with what compression_level?
<furq>
10
<TuxJobs>
GAAAAH! I just noticed that the tracks are like 570 MB each! That is FAR beyond what the other FLACs-from-NFS files I already have (which were converted via foobar2000)...
<aaabbb>
TuxJobs: just convert to opus
<TuxJobs>
OPUS is lossy.
<furq>
how long are the files
<aaabbb>
yeah it's lossy but it doesn't matter for listening. keep the original nsf's for archival
<aaabbb>
just do 128kbps opus which is already overkill. if you wanna be mega overkill then do 160kbps
<TuxJobs>
The duration seems to be completely wrong... over 3 hours... but it's just the main song from the game... can't be more than a couple of minutes of actual runtime.
<TuxJobs>
aaabbb: It does matter for listening, though. Psychologically. It drives me crazy knowing that I'm listening to less-than-lossless audio files.
<furq>
like i said there's no looping support in the ffmpeg gme wrapper
<furq>
it'll just loop forever
<furq>
gme itself does support that
<aaabbb>
TuxJobs: it's lossless as far as your speaker and ears are concerned
Haripesch has quit [Ping timeout: 250 seconds]
fossdd has joined #ffmpeg
billchenchina- has joined #ffmpeg
junaid_ has quit [Ping timeout: 260 seconds]
junaid_ has joined #ffmpeg
fossdd has quit [Ping timeout: 256 seconds]
xx has joined #ffmpeg
fossdd has joined #ffmpeg
YuGiOhJCJ has quit [Remote host closed the connection]
YuGiOhJCJ has joined #ffmpeg
fossdd has quit [Ping timeout: 272 seconds]
YuGiOhJCJ has quit [Remote host closed the connection]
YuGiOhJCJ has joined #ffmpeg
koi has quit [Ping timeout: 268 seconds]
tips_ has joined #ffmpeg
elastic_dog has quit [Ping timeout: 268 seconds]
zenloading has quit [Ping timeout: 268 seconds]
YuGiOhJCJ has quit [Remote host closed the connection]
Hikaru has quit [Remote host closed the connection]
Ogobaga has quit [Quit: Konversation terminated!]
Ogobaga has joined #ffmpeg
YuGiOhJCJ has quit [Remote host closed the connection]
fossdd has joined #ffmpeg
YuGiOhJCJ has joined #ffmpeg
junaid_ has quit [Ping timeout: 252 seconds]
emmanuelux has quit [Read error: Connection reset by peer]
junaid_ has joined #ffmpeg
fossdd has quit [Ping timeout: 255 seconds]
Mohammad is now known as help
emmanuelux has joined #ffmpeg
BSaboia has joined #ffmpeg
<BSaboia>
Hello, I am streaming from a file to a RMTP source. Everything is good, except that the speed says 60x, where I want it to play at the normal speed that the video was recorded.
<TuxJobs>
For example, a single track from a different game (converted using foobar2000 while I was using Windows) is less than 10 MB in size and is three minutes long.
<TuxJobs>
I guess I have to just face that FFMPEG doesn't properly understand .nsf files.
solaraquarion has quit [Read error: Connection reset by peer]
fossdd has joined #ffmpeg
<TuxJobs>
It appears as if it did some sort of "best effort" attempt to extract/convert the data.
<furq>
like i said already, the ffmpeg libgme wrapper doesn't handle looping
<TuxJobs>
furq: What do you mean?
<furq>
it will just loop forever
<furq>
or apparently for about three and a half hours
<furq>
libgme itself can figure out when a track loops and from that most applications will loop twice and then fade out or something similar
<BSaboia>
furq: ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
<BSaboia>
`ffmpeg -re 1 -i /path/to/file.ts -map 0 -codec copy -f flv rtmp://server/key` gives me `Option re (read input at native frame rate) cannot be applied to output url 1 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to`
vampirefrog has quit [Remote host closed the connection]
vampirefrog has joined #ffmpeg
junaid_ has quit [Quit: Lost terminal]
<yrc>
Hello! A while back, I asked a few questions related to my project of ripping a full DVD into a single MKV. It turns out that ffmpeg is barely part of the picture…
<yrc>
Marth64 in particular gave interesting advice, so I thought he/she might be interested in knowing where I arrived at this point.
<yrc>
The resulting file is roughly laid out like what you would see in a non-linear video editor, but without any overlapping: Edition1, then Edition2, then Edition3, and so on.
Marth128 has joined #ffmpeg
Marth64 has quit [Killed (NickServ (GHOST command used by Marth128!~Marth64@188.215.95.177))]
Marth128 is now known as Marth64
<yrc>
Main issues are: 1/ Even though tracks from Edition1/2/3/… do not overlap, they are seen in VLC or any other player as is they were all in parallel, and thus the fact that each Edition has its own set of default tracks kind of confuses the player. 2/ Only the 1st Edition is actually playable.
<yrc>
It really looks to me like I will have no choice but to create one MKV file per streams layout… unless someone knows the little extra that I forgot ;-) So e.g. I’ll have 1 MKV for “1,V_MPEGH/ISO/HEVC,720x544|2,A_AC3,6x48000,eng+3,A_AC3,6x48000,fre|4,S_VOBSUB,eng+5,S_VOBSUB,fre+6,S_VOBSUB,fre+7,S_VOBSUB,fre”, 1 MKV for “1,V_MPEGH/ISO/HEVC,704x560|2,A_AC3,2x48000,eng|3,S_VOBSUB,eng+4,S_VOBSUB,fre”,
<yrc>
etc.
fossdd has quit [Ping timeout: 256 seconds]
<yrc>
Well, that’s all. Marth64, I see you were still Marth128 when I mentionned you a few lines above :-) You might be interested ^
<yrc>
Good night all
bencc1 has joined #ffmpeg
<Marth64>
yrc: sorry my connection is bad. I think my demuxer got merged to ffmpeg. that might help
<yrc>
Marth64: np :-) I’ll definitely see if it can help!
<bencc1>
I'm doing a screen capture. When adding -filter_complex the audio and video are out of sync:
<Marth64>
yrc: the demuxer can directly extract titles and chapters, angles etc. subtitle colors werent merged and i have a tiny bugfix but it should work good otherwise to get your individual segments
s55 has quit [Ping timeout: 264 seconds]
noobaroo has quit [Read error: Connection reset by peer]
fossdd has joined #ffmpeg
Narrat has quit [Quit: They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.]
Suchiman has joined #ffmpeg
fossdd has quit [Ping timeout: 264 seconds]
Ogobaga has joined #ffmpeg
realies has quit [Quit: ~]
Vonter has quit [Ping timeout: 256 seconds]
Vonter has joined #ffmpeg
bencc1 has quit [Quit: Leaving]
Marth64 has quit [Ping timeout: 264 seconds]
Marth64 has joined #ffmpeg
fossdd has joined #ffmpeg
noobaroo has joined #ffmpeg
<noobaroo>
[libfdk_aac @ 0x56a087d2abc0] Note, the VBR setting is unsupported and only works with some parameter combinations