Closed cybercop23 closed 1 month ago
IMO - calling out to ffmpeg for this is not an option. It's not likely to be installed on any of the machines or in the paths on Mac/Windows. Using the libav libraries directly to accomplish this would be OK since we already include all of that.
So long ffmped is installed on the Windows system, and in the file path, it will call it and run it. I didn't have it installed and just installed it and it ran. I couldn't test it on a Mac, but just opening a command prompt and typing the same string, produced the output. There may be an issue if/how Mac will allow an external app to be called. I tried doing it with the libs themselves.. that's why Ubuntu failed, cuz I left them in, eventhough I wasn't using them (they are removed now), but couldn't get it to work. There seems to be some compatability issues with the API between diff versions. It was either creating an empty file, with 5+ or 1Gb+ with the old. So gave up on that and just used the exec itself. Not a lot of folks would need/use this, but those that do, will have to install FFMPEG, just like Vamp, if they want to use it.
If we are going to do this we should not be relying on external tools. There is already code in xlights for editing audio files ... this should work the same way. We have been working for years to eliminate these sort of dependencies.
If we are going to do this we should not be relying on external tools. There is already code in xlights for editing audio files ... this should work the same way. We have been working for years to eliminate these sort of dependencies.
Scott mentioned something about you doing something to trim the audio (which is already a suggested enhancement) but I can't find it. Can you please point me in the right direction?
People should just use Audacity…Don’t need xLights to do everything
People should just use Audacity…Don’t need xLights to do everything
Yeah.. felt that way at first too, but then I tried to use it and sucked for something so simple. I think triming may be more of a request than adding...
It’s in the tools menu
On 8 Jun 2024, at 7:07 AM, AlexB @.***> wrote:
If we are going to do this we should not be relying on external tools. There is already code in xlights for editing audio files ... this should work the same way. We have been working for years to eliminate these sort of dependencies.
Scott mentioned something about you doing something to trim the audio (which is already a suggested enhancement) but I can't find it. Can you please point me in the right direction?
— Reply to this email directly, view it on GitHubhttps://github.com/xLightsSequencer/xLights/pull/4594#issuecomment-2155553207, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACOOXKDYJTHJIXAY6AWZYEDZGIOIPAVCNFSM6AAAAABI5XEP5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVGU2TGMRQG4. You are receiving this because you commented.Message ID: @.***>
Thanks. Yeah.. that's what I started digging into. Seems very close to what we are after.
@keithsw1111 hoping you can take a peek at this issue... Using your example xaudio from the comments in the code, I tried to do a simple test and I get an error on avformat_write_header, rc=-22. It creates a 0 byte file in the right directory but nothing is written to it. I tried to allocate_conext before and still the same issue. I'm thinking the sample code should run and be able to produce some output. Looking at that you have supported, I think we can use it to achieve the pre/post silence and I can just leave the new SequenceSettings in place and replace the systemcall with the AudioManager that has the "right" vector defined.
Okay... so I went back and tried to use the RPP file and I get the same thing. So whatever we have now is broken and not working. We either need to fix it (above my ability right now) or pull it out.
2024-06-13 13:03:28,731 19728 log_base [ERROR] Error writing file header
Here's my logs from using the MP3 from Google Play with the respective RPP file.
2024-06-13 13:03:22,370 19728 log_base [DEBUG] Prepare audio: C:\Users\Alex\Documents\Sandbox\The Greatest Show Google Play.RPP.
2024-06-13 13:03:22,370 19728 log_base [DEBUG] Target file: C:\Users\Alex\Documents\Sandbox\01 The Greatest Show google play edited.mp3
2024-06-13 13:03:22,370 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 1.000 Length: 5.500 Target Pos: 0.000 Fade In: 0.750 Fade Out: 0.500 Volume: 0.787
2024-06-13 13:03:22,370 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 13.800 Length: 3.000 Target Pos: 5.000 Fade In: 0.500 Fade Out: 0.500 Volume: 0.787
2024-06-13 13:03:22,370 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 28.786 Length: 6.291 Target Pos: 7.500 Fade In: 0.500 Fade Out: 0.543 Volume: 0.787
2024-06-13 13:03:22,370 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 47.006 Length: 9.135 Target Pos: 13.249 Fade In: 0.543 Fade Out: 0.283 Volume: 0.787
2024-06-13 13:03:22,370 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 55.857 Length: 3.400 Target Pos: 22.100 Fade In: 0.283 Fade Out: 0.217 Volume: 3.141
2024-06-13 13:03:22,370 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 59.040 Length: 3.183 Target Pos: 25.283 Fade In: 0.217 Fade Out: 0.358 Volume: 0.685
2024-06-13 13:03:22,371 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 61.865 Length: 3.625 Target Pos: 28.108 Fade In: 0.358 Fade Out: 0.117 Volume: 3.141
2024-06-13 13:03:22,371 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 65.374 Length: 2.953 Target Pos: 31.617 Fade In: 0.117 Fade Out: 0.200 Volume: 0.717
2024-06-13 13:03:22,371 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 68.127 Length: 3.550 Target Pos: 34.370 Fade In: 0.200 Fade Out: 0.130 Volume: 2.462
2024-06-13 13:03:22,371 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 71.547 Length: 2.830 Target Pos: 37.790 Fade In: 0.130 Fade Out: 0.010 Volume: 1.303
2024-06-13 13:03:22,371 19728 log_base [DEBUG] Source file: 01 - The Greatest Show google play.mp3 Source Pos: 74.377 Length: 227.151 Target Pos: 40.620 Fade In: 0.010 Fade Out: 0.010 Volume: 0.717
2024-06-13 13:03:27,177 19728 log_base [DEBUG] Constructing xLightsVamp
2024-06-13 13:03:27,177 19728 log_base [DEBUG] Audio Manager Constructor start
2024-06-13 13:03:27,177 19728 log_base [DEBUG] Audio Manager Constructor: Loading media file.
2024-06-13 13:03:27,256 19728 log_base [DEBUG] Getting track metrics.
2024-06-13 13:03:27,256 19728 log_base [INFO] av_frame_alloc okay
2024-06-13 13:03:27,541 19728 log_base [INFO] Track Size: 13324668, Time Base Den: 44100 => Length 302146ms
2024-06-13 13:03:27,551 19728 log_base [DEBUG] Preparing to load song data.
2024-06-13 13:03:27,551 3180 log_base [DEBUG] DoLoadAudioData: Doing load of song data.
2024-06-13 13:03:27,551 19728 log_base [DEBUG] Opening audio device. (null)
2024-06-13 13:03:27,562 19728 log_base [DEBUG] Result ''
2024-06-13 13:03:27,562 19728 log_base [DEBUG] Audio device opened
It might just be a Unicode issue on windows. Are you testing on MacOS or Windows?
It might just be a Unicode issue on windows. Are you testing on MacOS or Windows?
The above was on Windows and my original dev using FFMPEG was Windows too. I jusst tried Mac using TestFlight and same exact error.. so I'm thining FFMPEG upgrade may have done it, but that's point that nobody really uses that functionality
2024-06-13 13:32:32,000 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,000 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,001 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,001 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,002 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,002 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,003 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,003 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,003 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,004 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,004 8603012096 log_base [DEBUG] Processing sample from 01 - The Greatest Show google play.mp3. 2024-06-13 13:32:32,026 8603012096 log_base [DEBUG] Creating audio file /Volumes/documents/Alex/2024/Christmas/01 The Greatest Show google play edited.mp3. 2024-06-13 13:32:32,043 8603012096 log_base [ERROR] Error writing file header 2024-06-13 13:32:32,370 6375223296 log_base [INFO] DoPrepareFrameData: Audio frame data processing complete in 1479. Frames: 15108 2024-06-13 13:32:33,742 8603012096 log_base [DEBUG] AudioManager::~AudioManager 2024-06-13 13:32:33,742 8603012096 log_base [DEBUG] SDL Audio Stop on device 2. 2024-06-13 13:32:33,742 8603012096 log_base [DEBUG] SDL Audio Removed: id: 0 device: 2. 2024-06-13 13:32:33,755 8603012096 log_base [DEBUG] AudioManager::~AudioManager Done
Users need to have FFMPEG installed, if not, they will get prompted to install it.