brew install ffmpeg
pip install ffmpeg-normalize
ffmpeg-normalize input.mp4 -o output.mp4 -c:a aac -b:a 192k --progress
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.Color; | |
import android.graphics.SurfaceTexture; | |
import android.os.Build; | |
import android.util.Log; | |
import android.view.LayoutInflater; | |
import android.view.Surface; | |
import android.view.TextureView; |
@RunWith(RobolectricGradleTestRunner.class) | |
@Config(emulateSdk = 21, reportSdk = 21, constants = BuildConfig.class) | |
public class ServerClientTest extends GetAdResponseHandler { | |
private Transcript mTranscript; | |
public static final String LOG_TAG = "ServerClientTest"; | |
public static final String SERVER_URL = "/rich/"; | |
public static final String CONNECTION_NO_SETTINGS = "vastConnectionWithoutSettings.json"; |
private void clearSurface(SurfaceTexture texture) { | |
EGL10 egl = (EGL10) EGLContext.getEGL(); | |
EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); | |
egl.eglInitialize(display, null); | |
int[] attribList = { | |
EGL10.EGL_RED_SIZE, 8, | |
EGL10.EGL_GREEN_SIZE, 8, | |
EGL10.EGL_BLUE_SIZE, 8, | |
EGL10.EGL_ALPHA_SIZE, 8, |
/** | |
* Blur the given bitmap and convert it to BitmapDrawable | |
* @param context the application context to use getRessources | |
* @param bitmapOriginal the bitmap you want to blur | |
* @param radius the blur radius (amount of blur) | |
* @return blured BitmapDrawable | |
*/ | |
public static Bitmap blur(Context context, Bitmap bitmapOriginal, int radius){ | |
try { |
private void getLocation(Context context) { | |
Log.d(LOG_TAG, "getLocation"); | |
if (context.getPackageManager().checkPermission( | |
Manifest.permission.ACCESS_FINE_LOCATION, context.getPackageName()) == PackageManager.PERMISSION_GRANTED || | |
context.getPackageManager().checkPermission( | |
Manifest.permission.ACCESS_COARSE_LOCATION, context.getPackageName()) == PackageManager.PERMISSION_GRANTED) { |
private void changeFragment(Fragment frag, boolean saveInBackstack) { | |
String backStateName = ((Object) frag).getClass().getName(); | |
try { | |
FragmentManager manager = getSupportFragmentManager(); | |
boolean fragmentPopped = manager.popBackStackImmediate(backStateName, 0); | |
if (!fragmentPopped && manager.findFragmentByTag(backStateName) == null) { //fragment not in back stack, create it. | |
FragmentTransaction transaction = manager.beginTransaction(); |
/** | |
* Configure fresco using ONLY disk cache | |
*/ | |
public void configFresco() { | |
Supplier<File> diskSupplier = new Supplier<File>() { | |
public File get() { | |
return getApplicationContext().getCacheDir(); | |
} | |
}; |
@Override | |
public boolean onTouch(View v, MotionEvent event) { | |
switch (event.getAction() & MotionEvent.ACTION_MASK) { | |
case MotionEvent.ACTION_DOWN: | |
mStartNativeX = event.getX(); | |
mStartNativeY = event.getY(); | |
mIsNativeClick = true; |
/** | |
* Change the current displayed fragment by a new one. | |
* - if the fragment is in backstack, it will pop it | |
* - if the fragment is already displayed (trying to change the fragment with the same), it will not do anything | |
* | |
* @param frag the new fragment to display | |
* @param saveInBackstack if we want the fragment to be in backstack | |
* @param animate if we want a nice animation or not | |
*/ |