-
Notifications
You must be signed in to change notification settings - Fork 55
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
Some informations #2
Comments
Hi, currently this module only supports video files stored on SD card of mobile device. It can certainly work on huge video files. For online videos, this module can not work. |
@umair13adil : But think to download a video of (658mb) that lasts 2 hours and 30 minutes, I think it is very heavy, like what. Being that I am developing a player based on exoplayer, I would like to implement PreviewSeekBar on it: https://github.com/rubensousa/PreviewSeekBar which allows you to have a preview of the video. What would you recommend? |
If you wan to use FFMpeg to display preview like in YouTube, you can use thumbnails, using following command:
Give it a try. |
@umair13adil : Everything must run on an android app, without using anything else. |
will this work on online video
|
I have't tried it myself. But yes it's possible. Check this answer on Stackoverflow:
|
Hi , many thanks to you for this great work. Is there any way you can share with us regarding where to refer for how to use ffmpeg commands in Android ? It is hard to find any tutorials regarding it. If you have referred any link/document please share with us. Thank you once again. |
Hi, there is no single source of link/document for ffmpeg. You can use any ffmpeg command in Android using this library:
You can find some useful commands here: |
Thank you for such a quick reply. Can we use the VideoMerge that you have implemented for concat/append video formats apart from Mp4 ? and what should be the value of scale in {stringBuilder.append("[$i:v]setpts=PTS-STARTPTS,setsar=1,setdar=4/3,scale=640x480[v$i]; [$i:a]asetpts=PTS-STARTPTS[a$i];")} to keep the original scaling of the video ? and also setdar to be as same as video's aspect ? Sorry to ask such silly queries , we have been digging ffmpeg from past 2 weeks and we are new to the ffmpeg library. Is there any way to reduce merging time as well ? |
Yes, you can use it to merge videos of different format. Scale value is optional. If all your videos have some resolution , then simply don't add this filter, otherwise add it to specify single resolution for all videos. If you wan't to keep original aspect ratio, scaling then just remove these filters. You can reduce merge time by adding crf, preset and other options in your command, but they will reduce output video quality. Here are some commands that you can use: -crf: Quality. Range is logarithmic 0 (lossless) to 51 (worst quality). Default is 23. Subjective sane range is ~18-28 or so. Use the highest value that still gives you an acceptable quality. If you are re-encoding impractically large inputs to upload to YouTube or similar then try a value of 17 or 18 since these video services will re-encode anyway. -preset: Encoding speed. A slower preset provides better compression (quality per file size) but is slower. Use the slowest that you have patience for: ultrafast, superfast, veryfast, faster, fast, medium (the default), slow, slower, veryslow. -movflags +faststart: Allows video to playback before it is completely downloaded in the case of progressive download viewing. Useful if you are hosting the video, otherwise superfluous if uploading to a video service like YouTube. -vf scale=-2:720,format=yuv420p: A filtergraph using scale and format video filters. Scale to 720 pixels in height, and automatically choose width that will preserve aspect, and then make sure the pixel format is compatible with dumb players. -b:a 128k: Audio bitrate. If your ffmpeg is outdated then you'll need to add -strict experimental to use -c:a aac. |
Great! thanks . So my final filter after removing scaling and aspect ratio would be : [$i:v]setpts=PTS-STARTPTS; [$i:a]asetpts=PTS-STARTPTS[a$i]; ? as all my videos will be of same resolution and aspect ratio. |
yes, that's right. |
@umair13adil : Hi, it would be possible to use this module, on a video that is online (http), the video weighs 658 (mb)?
The text was updated successfully, but these errors were encountered: