Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to load wave form faster of large video file? #17

Closed
salmanAhmad143 opened this issue Apr 16, 2021 · 5 comments
Closed

Comments

@salmanAhmad143
Copy link

Hey @zhw2590582 ,

As per your suggestion i am using web-audio-api and creating PCM file to generate wave. But the problem is PCM file is also taking long time to display wave form. Till the complete PCM file not loaded in browser wave form showing a thin line.

Is there any other fastest way to generate wave form?

Like wfplayer should not wait to load the complete PCM file data and should start to draw wave?

Please suggest. Thanks

@zhw2590582
Copy link
Owner

I have updated readme.md, and I recommend using the method of loading mp3 instead of the method of loading pcm.

@salmanAhmad143
Copy link
Author

@zhw2590582 , So in that case if the the mp3 file size is big then it would not take time to load?
E.g Suppose if i am creating a MP3 file from a 1 GB MP4 file using ffmpeg then its file size will be high so in this case wfplayer will not took time in loading?

@zhw2590582
Copy link
Owner

I just tried it and converted a 1G mp4 video to mp3. The result was only 6M in size. For modern network bandwidth, loading this audio should be fast.

@salmanAhmad143
Copy link
Author

@zhw2590582 , Even i also tried it my side and the output mp3 file size of 1 GB mp4 video is 8.7 MB but this is when i use the same parameters that you have mentioned in your e.g command. Like channel 1 and sample rate 8000. I am not much aware about these two parameter.

  1. What will be the impact of this?
  2. Do i need to change these as per my mp4 video?

ffmpeg -i path/to/video.mp4 -ac 1 -ar 8000 path/to/audio.mp3

@zhw2590582
Copy link
Owner

This command is applicable to all mp4 files, all this command needs to do is to compress the mp3 as much as possible, basically no changes are needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants