سؤال

I am compressing video using ffmpeg library. user can browse for any video and compress it. It is working fine for videos with video name don't have white spaces.But if video name have white spaces compression is not working.we try to double quote for video path but still it is not working. for eg. our video path is like this - /storage/sdcard1/Video/teri jhuki nazar.mp4

how to fix this issue?

هل كانت مفيدة؟

المحلول

In ffmpeg each commands are separately identified using white spaces. When you specify a path having white spaces, the path will splits according to white spaces and will be considered as different commands and hence the error arises.

Here you can see how each commands are differentiated.

I suggest you to make your own changes in command styling and differentiating.


Refer :

نصائح أخرى

Replace white space with "\ " like

String filePath = "/storage/sdcard1/Video/teri jhuki nazar.mp4";
        filePath = filePath.replace(" ", "\\ ");

OR

ffmpeg -i /storage/sdcard1/Video/teri%20jhuki%20nazar.mp4

use following sample code to avoid blank spaces in your video file.

String temp = URLDecoder.decode("Your file path");

String videopath = temp;

then send videopath to ffmpeg. It's goona work.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top