Blog posts

FFmpeg binaries for Andriod

Binaries are located here

Advertisements

Library path issue while compiling some applications on Ubuntu

Problem:
If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following:

  - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

Solution:

export LD_RUN_PATH=/usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib/

 

Ffmpeg Commands for video processing

1. Crop specific portion of video using ffmpeg
ffmpeg -i input.mp4 -filter:v "crop=1080:560:0:650" -c:a copy out.avi
2. Extract individual frames from a video using ffmpeg
ffmpeg -i input.mp4 -vf fps=60 out%d.png
3. Cut specific portion of video using ffmpeg
ffmpeg -ss 24 -i input.mp4 -t 25 -c:a copy out.avi
4. Calculate PSNR/SSIM from input video and reference video using ffmpeg
ffmpeg -i input.mp4 -i rf.mp4 -strict -2 -filter_complex "psnr" "output.mp4"
5. Change the resolution of the video using ffmpeg
ffmpeg -i input.avi -vf scale=320:240 output.avi
6. Concatenate videos using ffmpeg
ffmpeg -i "concat:input1.avi|input2.avi|input3.avi" -c:a copy output.avi
7. Generate video with only black frames, using ffmpeg
ffmpeg -t 60 -s qcif -f rawvideo -pix_fmt rgb24 -r 25 -i /dev/zero dummy.mp4
8. Insert few black frames to an input video using ffmpeg
ffmpeg -i input.mp4 -f lavfi -i "color=c=black:s=1080x1920:r=25" -filter_complex "[0:v] setpts=PTS-STARTPTS [main]; [1:v] trim=end=10,setpts=PTS-STARTPTS [pre]; [pre][main] concat=n=2:v=1:a=0 [out]" -map "[out]" -vcodec mpeg2video -maxrate 30000k -b:v 30000k output.mp4
9. Split a video into multiple segments at key frames using ffmpeg
ffmpeg -i input.mp4 -f segment -vcodec copy -reset_timestamps 1 -map 0 output%d.mp4
10. Split a video into multiple segments of equal in length or approximately equal
ffmpeg -i input.mp4 -c copy -map 0 -segment_time 8 -f segment output%03d.mp4
11. Filter a video to get duplicate frames in a video using ffmpeg
ffmpeg -i input.mp4 -vf mpdecimate -loglevel debug -f null -
12. Generate a video by removing duplicate frames from input video using ffmpeg
ffmpeg -i input.mp4 -vf mpdecimate,setpts=N/FRAME_RATE/TB out.mp4

VLC build fail due to unsupport major.minor version 52

java.lang.UnsupportedClassVersionError: com/android/build/gradle/LibraryPlugin : Unsupported major.minor version 52.0 build.gradle

Solution:

Download latest jdk(8) and update your gradle.properties file with below line

org.gradle.java.home=/usr/lib/jvm/java-8-openjdk-amd64

Otherwise, it takes default jdk version throws exception due to version mismatch.