i would like to crop and scale a recorded video without the use of ffmpeg, is there any way?
I would avoid to use ffmpeg to not have compatibility problems.
Thanks guys
Ummm... try to use gstreamer instead of ffmpeg. BTW, what is wrong with ffmpeg?
For example, this is gstreamer conveyor
gst-launch v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=15/1 ! aspectratiocrop aspect-ratio=16/9 ! \ ffmpegcolorspace ! xvimagesink
It takes video from the webcam, changes aspect, then shows output to user.
Related
I am using ffmpeg to scale down and compress videos to be used in Android app.
The original files are played with no problem and have no metadata issues. When I re-encode them however, the Android player is able to play them, but displays wrong durations. My app is in production and it is using official player implementations, so I wonder if there is a way to fix the corruption using ffmpeg or adding some metadata to the generated files. Hopefully that's possible, but if not - any other possible fixes will be highly appreciated :)
My ffmpeg command is complex, including scaling and encoding but I can confirm this issue is reproducible on my end with the simplest ffmpeg -i video.mp4 -c:v libx264 videogen.mp4 command.
I'm leaving links to the two files if that's helpful for reference.
video.mp4
videogen.mp4
Any ideas what could be causing this and how to fix it?
Player issues showcase:
video.mp4 (original)
videogen.mp4 (re-encoded)
After some testing I found out that the player was playing fine files with the following metadata:
major_brand=mp42
encoder=Lavf58.24.101
So I used ffmpeg -movflags use_metadata_tags to set the working metadata :)
I am trying to convert video file in slow motion or fast forward motion, just like snapchat. Tried mediacodec but didn't worked.
Can anyone tell me if there is any 3rd party library or something to accomplish my task.
Any help is highly appreciated.
You can use ffmpeg library for this
To double the speed of the video, you can use
ffmpeg -i input.mkv -filter:v "setpts=0.5*PTS" output.mkv
To slow down your video, you can use this comand
ffmpeg -i input.mkv -filter:v "setpts=2.0*PTS" output.mkv
For more details look into this link https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
I am working on FFMPEG Video Conversion, I want a face replacement by my image in a video. For this subject I searched for something which I am describing below. Please let me know if I am wrong, and suggest a more proper procedure for the task.
1) I can extract all images from a video frame by frame.
2) Then we detect face from each image.
3) Morph an image onto the face.
4) Then again make a video with these images through FFMPEG.
Am I right? If yes then what about audio in this process? And if wrong then where am I mistaken?
ffmpeg can help with the video/audio handling part ,for the the face replacement you need a specific image processing tool : openCV http://opencv.org/ crosses my mind but you can do further search.Good luck.
How to get video orientation using ffmpeg? I am using ffmpeg on android.
It seems ffmpeg not taking care automatically, in android lower versions I could not find api, so trying using ffmpeg. In android there is metadataretriver but it's api level is 17.
Please suggest way for this.
Are you looking for the syntax of the transpose filter? For instance, to rotate the input by 90 degrees counter-clockwise:
ffmpeg -i input -vf "transpose=1" output
If not, could you detail your request a little bit more?
I've a requirement where I need to transcode small video clips shot from Native camera app to lower bitrate/resolution Mp4 which is shreable via email etc.
What is the best way to transcode/convert the video on device itself. FFMPEG or any other library?
p.s. I know this is an overkill for the device but client leaves me with no option. He doesn't care about battery or time it takes. I'm targeting this for quad-cores, where CPU is not a problem.
Your best bet would be to use something like ffmpeg which has been ported to Android (see this SO post: ffmpeg for a android (using tutorial: "ffmpeg and Android.mk") and the ffmpeg port for android which is here: http://bambuser.com/opensource). You'll have to use JNI etc, but that will save you the hassle of dealing with the byte stream yourself.
Haven't tried it on Android myself, so YMMV:
Is there a Java API for mp4 files?
http://code.google.com/p/mp4parser/
If you're recording on-device, why not set the expected format from your code? It appears the api lets you set video size, framerate etc. in the MediaRecorder class.