Unable to do low-level decoding of video on Android 4.2 without using media extractor

try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); FileInputStream fis = new FileInputStream(new File( “ur file path”)); byte[] buf = new byte[1024]; int n; while (-1 != (n = fis.read(buf))) { baos.write(buf, 0, n); } byte[] videoBytes = baos.toByteArray(); // use this videoBytes which is low level of original video } catch (Exception e) { e.printStackTrace(); … Read more

Maintaining aspect ratio with FFmpeg

-vf “scale=640:-1” works great until you will encounter error [libx264 @ 0x2f08120] height not divisible by 2 (640×853) So most generic approach is use filter expressions: scale=640:trunc(ow/a/2)*2 It takes output width (ow), divides it by aspect ratio (a), divides by 2, truncates digits after decimal point and multiplies by 2. It guarantees that resulting height … Read more

Vertically or horizontally stack (mosaic) several videos using ffmpeg? [closed]

Use the vstack (vertical), hstack (horizontal), or xstack (custom layout) filters. It is easier and faster than other methods. Combine/stack two videos or images Vertical Using the vstack filter. ffmpeg -i input0 -i input1 -filter_complex vstack=inputs=2 output Videos must have the same width. Horizontal Using the hstack filter. ffmpeg -i input0 -i input1 -filter_complex hstack=inputs=2 … Read more

Reducing video size with same format and reducing frame size

ffmpeg provides this functionality. All you need to do is run someting like ffmpeg -i <inputfilename> -s 640×480 -b 512k -vcodec mpeg1video -acodec copy <outputfilename> For newer versions of ffmpeg you need to change -b to -b:v: ffmpeg -i <inputfilename> -s 640×480 -b:v 512k -vcodec mpeg1video -acodec copy <outputfilename> to convert the input video file … Read more

Solid FFmpeg wrapper for C#/.NET

This is a wrapper of my own: https://github.com/AydinAdn/MediaToolkit MediaToolkit can: Convert video files into various other video formats. Perform video transcoding tasks. Options configurable: Bit rate, Frame rate, Resolution / size, Aspect ratio, Duration of video Perform audio transcoding tasks. Options configurable: Audio sample rate Convert video to physical formats using FILM, PAL or NTSC … Read more

How to train an artificial neural network to play Diablo 2 using visual input?

I can see that you are worried about how to train the ANN, but this project hides a complexity that you might not be aware of. Object/character recognition on computer games through image processing it’s a highly challenging task (not say crazy for FPS and RPG games). I don’t doubt of your skills and I’m … Read more

Rotating videos with FFmpeg

Rotate 90 clockwise: ffmpeg -i in.mov -vf “transpose=1” out.mov For the transpose parameter you can pass: 0 = 90CounterCLockwise and Vertical Flip (default) 1 = 90Clockwise 2 = 90CounterClockwise 3 = 90Clockwise and Vertical Flip Use -vf “transpose=2,transpose=2” for 180 degrees. Make sure you use a recent ffmpeg version from here (a static build will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)