Tourenathan-G5organisation / SiliCompressor

A powerful, flexible and easy to use Video and Image compression library for Android.
Apache License 2.0
1.38k stars 292 forks source link

compress video .mp4 not working when upload on server #36

Open kamalbunkar opened 7 years ago

kamalbunkar commented 7 years ago

I get successful compress video size 3MB from android. after upload, the video file to server this video is not playing. On my Cpanel file manager file size is 3 MB which is correct. If I open file location from browser URL, it shows blank browser play where total video time is correct on the player. But on click play button there is nothing. if I download the file from player download button than file size is 35KB only. if I download this video file from Cpanel using the download button on file manager then the file of size 3MB. On the same directory, there is other .mp4 file playing correctly. Here is file - http://blueappsoftware.in/VIDEO_20171003_113511.mp4 on cpanel file manager - file size is 3.98MB type is video/x-generic

Tourenathan-G5organisation commented 7 years ago

Hello @kamalbunkar , thanks for using this library and sending us your feedback. Please, let be us be sure that the library is not the reason while the compressed file is not playing on the server. Check the resulting compressed file on the device if its playing correctly and if the quality is OK. If that is the case, the problem may be due to your way of uploading your file to the server. Please check and let me know

kamalbunkar commented 7 years ago

hello, please look at these two scenarios, 1) (working correctly )capture video(.mp4) from Android and send ( multi-part form data) it to the server without compress- file is working fine from cPanel file manager and from URL.

2) (not working) capture video(.mp4) from android and compress it using silicompressor 2.0 using compile 'com.iceteck.silicompressorr:silicompressor:2.0' , the video is playing on the device, playing on VLC player in desktop. Now I am sending video using same multi-part form data. the file is showing correct on Cpanel file manager 4MB size, but not working from URL( 44kb file size on browser player).

Note for my case version 2.1 not working at below line. I have read your solution for this issue on other thread. I am passing both the parameter as URI string. filePath = SiliCompressor.with(mContext).compressVideo(String.valueOf(Uri.parse(paths[0])), paths[1]);

pritesh25 commented 6 years ago

can anyone explain me ? why compressed video file hosted on live webserver not play in VideoView

champrocks3190 commented 6 years ago

bcoz its downloading the whole video for playing , its not fetching chunks from video file , but its as a single frame getting download and then playing it .

champrocks3190 commented 6 years ago

check out these pics

champrocks3190 commented 6 years ago

with compressed image youtube video

pritesh25 commented 6 years ago

How you made your video buffer from server?? What player you used for that??

champrocks3190 commented 6 years ago

https://github.com/afollestad/easy-video-player

pritesh25 commented 6 years ago

Ok, i got you. Can u explain me why compressed video not play from the live server? Because uncompressed video play well from live server

champrocks3190 commented 6 years ago

Download youtube video and upload where ever the Existed video is having problem and play youtube video it will play like youtube . very flawless .. the problem is with video not with server

pritesh25 commented 6 years ago

Then how I can reduce my video size before uploading to the life server because it getting too much size if I record video from the device and I just want to compress it in order to reduce the size of video file before uploading to the web server

champrocks3190 commented 6 years ago

may be the encoding and decoding causes the video format to getting change in real I'm not talking about .MP4 or any extension but the each frame is getting processed when we compress so , something is causing it to buffer / not sure tried with firebase FFMPEG works but its taking too long to compress sometime the Compressed video file is greater size of than original

champrocks3190 commented 6 years ago

what are u developing what is the concept how video is getting uploaded by whom , which purpose ? and how long ?

pritesh25 commented 6 years ago

Is it happen always? I mean compressed have always more size than original? "

champrocks3190 commented 6 years ago

not all time

pritesh25 commented 6 years ago

I am developing applications which upload videos amd images,,, to upload the videos are also added the two options first to browse the video and second is record and then upload the video in both the cases I need to compress the video because the original file have much more size and to upload it I just want to compress it because the original file is too much heavy size and it will take a lots of time to upload so I just want to reduce the uploading time

pritesh25 commented 6 years ago

Ok, do you y have link of firebase ffmpef

juicelover commented 5 years ago

After compressing,it works in 8.0 but it don't work in 5.1 and 4.2.2,always.(low version) The player I used is VideoView.

I solve the problem by using YCVideoPlayer. You must choose the playerType which is ConstantKeys.IjkPlayerType.TYPE_IJK. If you choose the playerType which is ConstantKeys.IjkPlayerType.TYPE_NATIVE,the problem will be here.

s-komaragiri commented 3 years ago

Is there a solution for this yet? or can you guys suggest the best alternative to compress a video that works with firebase storage?