Skip to content

Conversation

@andreydruz
Copy link

ffmpeg video recording files as ogg in order to deal with 25mb limit of OpenAI

https://community.openai.com/t/whisper-api-increase-file-limit-25-mb/566754

ffmpeg video recording files as ogg in order to deal with 25mb limit of OpenAI

https://community.openai.com/t/whisper-api-increase-file-limit-25-mb/566754

Signed-off-by: andreydruz <andreydruz@gmail.com>
Bug fix

 Undefined variable $tempFilePath at /var/www/html/custom_apps/integration_openai/lib/Service/OpenAiAPIService.php#629
@github-actions
Copy link

github-actions bot commented Apr 3, 2025

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Copy link
Contributor

@edward-ly edward-ly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for not getting back to you earlier, but thank you for your contribution to the app! We agree that converting to opus/ogg would be beneficial too, However, using the exec function and shell commands is a big security risk. Not to mention, it is unclear what exactly the ffmpeg command does without any supporting comments (which are also prone to errors if not maintained). Please refactor the command by using the php-ffmpeg package instead.

A few other things we'd also like you to add:

  1. In FFMpeg\FFMpeg::create(), do not automatically detect the ffmpeg binary path, and instead explicitly set the path from the PATH variable. If you want to, you can try to add a config setting that lets users define a custom path (with the PATH value being the default), but that is entirely optional.
  2. Also optional, but if you can: please add a report/notification back to the UI saying how much audio was passed down to the API. That'll easily let us verify whether the conversion actually works; other optimizations like chunking or silence detection can come later.

If you have any additional questions, we'd be happy to help or provide additional resources.

@DaphneMuller
Copy link

hello @andreydruz , do you think you would have the time and energy to follow up on the feedback that was provided earlier or shall we try to schedule some time to finish up the pull request? Let us know what you prefer :)

@andreydruz
Copy link
Author

andreydruz commented May 9, 2025

Hi @edward-ly and @DaphneMuller,

About "php-ffmpeg package",
I added the change, but I don't have dev env to check if it will work.
I'm done change on AIO server, and it is not working.

A TaskProcessing core:audio2text task with id 1925 failed with the following message: Class "OCA\OpenAi\Service\FFMpeg" not found

Missing composer install "php-ffmpeg/php-ffmpeg" but I don't know how to do it on AIO and don't want to make tests on production server.

About "few other things", currently we are successfully working without this.

@andreydruz andreydruz closed this May 9, 2025
@DaphneMuller
Copy link

hi! what's the reason you closed it? shall I reopen the issue so someone of my team can look at it upcoming week? thanks for your contribution!

@andreydruz
Copy link
Author

Hi @DaphneMuller,

The solution with shell command was tested on real servers for a number of weeks before I sent it.
Solution with PHP-FFmpeg package I can't test.
So I closed the MR.

We will continue to work with shell command on our server and once developer will have time to set up dev env, test it on dev server after it test it on prod server for a week or so - I will reopen MR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants