AbedElazizShe / LightCompressor

A powerful and easy-to-use video compression library for android uses MediaCodec API.
Apache License 2.0
518 stars 117 forks source link

Not getting sound on compressed videos #43

Closed paragwadhwani closed 3 years ago

paragwadhwani commented 3 years ago

Not getting sound on compression Video Compression is very good and also compressed video quality is very nice but not getting sound on some video after compression .I have tried this on device with android 10 I think when i am recording video with camera and adding a sound (.AAC format) in it and then compressing it its not getting any sound.

AbedElazizShe commented 3 years ago

Thank you for opening this issue. Could you please confirm if the issue happens on multiple devices or just a specific one, please share the device model and I will look into this.

Thank you

paragwadhwani commented 3 years ago

Yes i have checked it on multiple devices having android 10 and 9 .

AbedElazizShe commented 3 years ago

Thank you for the quick reply. Sorry I have been really busy here, will work on this during the weekend. Could you please share one of the videos so I can debug? Just upload it to google drive and share the link here or to my gmail. Please ensure I have access to the video. Thank you very much :D

mortezakh1371 commented 3 years ago

I use 'com.github.AbedElazizShe:LightCompressor:0.7.6' for Compress Video and Everythings okey . but when I use 'com.github.AbedElazizShe:LightCompressor:0.7.6' and Trimmer ('com.github.tizisdeepan:videoeditor:1.0.8' or 'life.knowledge4:k4l-video-trimmer:1.1.3-SNAPSHOT') together the final video has no audio.

paragwadhwani commented 3 years ago

Thank you for the quick reply. Sorry I have been really busy here, will work on this during the weekend. Could you please share one of the videos so I can debug? Just upload it to google drive and share the link here or to my Gmail . Please ensure I have access to the video. Thank you very much :D

Sorry for the late reply https://drive.google.com/drive/folders/1dXtxD1F4E86uW9U9F4j7aW8P1EyzPLNh?usp=sharing Here is the drive link for the video(which I tried to compress) and also the compressed video (which has no sound) and also please check that I cannot stream this compressed video only the option is to download and then play that video. Please have a look at it

Thank you

AbedElazizShe commented 3 years ago

Thank you, please give me access to the video.

paragwadhwani commented 3 years ago

Thank you, please give me access to the video.

Done

AbedElazizShe commented 3 years ago

Thank you. The video has sound after compression on my testing devices. Could you let me know which devices are you using?

paragwadhwani commented 3 years ago

MI A2 with android 10 And I have also tried on different devices.

AbedElazizShe commented 3 years ago

Please try the latest version 0.7.7, and let me know if you still have the issue.

paragwadhwani commented 3 years ago

Please try the latest version 0.7.7, and let me know if you still have the issue.

Yes I have tried with new version (0.7.7) but now also there is same problem.

gavin-hero commented 3 years ago

I am having the same issue with a video recorded from a Pixel 5. When compressed the video no longer has any audio and is also now unplayable in QuickTime on a Mac

AbedElazizShe commented 3 years ago

Thank you for the details. I have tested on Pixel 2 XL, pixel 4a, and Pixel 4. They all have sound. Here is one of the outputs based on the videos @wsoftwares shared with me. Please let me know if you can't play it.

Please try to use the sample app and share the result. I can't find the issue as all my physical devices and random tests on devices on BrowserStack just worked fine. Any small detail could help figure this issue out.

chhatrasal09 commented 3 years ago

Hi this is the my compressed video. And this my original video. I was not able play this file in QuickTime on Mac. I compared the info of both file and found out that the compressed file Dows not have aac audio.

AbedElazizShe commented 3 years ago

Thank you for the details. Could you please try to play the videos using vlc on Mac? That would help narrow down the possible cause of the issue.

AbedElazizShe commented 3 years ago

I have tested the videos, you're right, only quicktime fails to play them, other players on my mac play the videos. Dealing with codecs is a very tricky task. The issue can be anything as the compressed videos from pixel 2 works with QuickTime while from pixel 5 won't. I don't think I will figure out the reason anytime soon.

dgeetesh commented 3 years ago

I am also facing this issue Can you please suggest any alternative, which possesses the same functionality.

Kabirov7 commented 2 years ago

Hi! I try to play compressed video in VLC player. I can see the video, but there is no sound. I got Codec not supported VLC could not decode the format "mp4a" (MPEG AAC Audio). When I am trying to convert file using ffmpeg on python or in the terminal to .mp4 I got this error:

`/Users/artur/Programming/WorkProjects/videoConverterPython/venv/bin/python /Users/artur/Programming/WorkProjects/videoConverterPython/main.py start ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers built with Apple clang version 13.0.0 (clang-1300.0.29.3) configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 [aac @ 0x7f9fd4813600] Audio object type 0 is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9fd300ee00] Failed to open codec in avformat_find_stream_info [aac @ 0x7f9fd4813600] Audio object type 0 is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video_38516.file': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 creation_time : 2021-11-28T02:11:41.000000Z Duration: 00:00:14.62, start: 0.000000, bitrate: 818 kb/s Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 512x384, 557 kb/s, 30.03 fps, 30 tbr, 90k tbn, 180k tbc (default) Metadata: creation_time : 2021-11-28T02:11:28.000000Z handler_name : VideoHandle vendor_id : [0][0][0][0] encoder : AVC Coding Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default) Metadata: creation_time : 2021-11-28T02:11:41.000000Z handler_name : VideoHandle vendor_id : [0][0][0][0] [aac @ 0x7f9fd282ec00] Audio object type 0 is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Error while opening decoder for input stream #0:1 : Function not implemented Traceback (most recent call last): File "/Users/artur/Programming/WorkProjects/videoConverterPython/main.py", line 40, in convert_to_mp4("video_38516.file") File "/Users/artur/Programming/WorkProjects/videoConverterPython/main.py", line 37, in convert_to_mp4 output.run(capture_stderr=False) File "/Users/artur/Programming/WorkProjects/videoConverterPython/venv/lib/python3.7/site-packages/ffmpeg/_run.py", line 325, in run raise Error('ffmpeg', out, err) ffmpeg._run.Error: ffmpeg error (see stderr output for detail)

Process finished with exit code 1`

vivekpanchal commented 2 years ago

I have used camera X API to record the video but after compressing the video I am not able to get any audio out of the file. is there any solution for this issue ???

ShikhaSince2000 commented 1 year ago

I am creating the storage cleaner kind of app that also compress the video. Compressed quality of videos are good but the video compressed doesn't have the audio in it and it is also not recognise as video but plays in video player. Please suggest me with possible solution or alternative. Thanks

ShikhaSince2000 commented 1 year ago

I am creating the storage cleaner kind of app that also compress the video. Compressed quality of videos are good but the video compressed doesn't have the audio in it and it is also not recognise as video but plays in video player. Please suggest me with possible solution or alternative. Thanks

I like to update regarding the issue.This library works perfectly with the android version above 11+, but problem remains with the android version for 10 and below.