There is a few things wrong with your implementation.
The first is createVideoThumbnail was changed from:
public static Bitmap createVideoThumbnail (String filePath, int kind)
to
public static Bitmap createVideoThumbnail (File file, Size size, CancellationSignal signal)
The second is the way you retrieve your path and trying to convert it to a Uri:
String path = getExternalFilesDir(Environment.DIRECTORY_MOVIES) .getAbsolutePath()+ "/" + new SimpleDateFormat("yyyyMM_dd-HHmmss").format(new Date()) + "_compress.mp4";
Uri fileUri = FileProvider.getUriForFile(this, getPackageName() + ".provider", new File(path));
You should instead make use of ContentValues and ContentResolver to create a Uri, then write to that Uri and insert it when done, like this:
ContentValues valuesvideos = new ContentValues();
valuesvideos.put(MediaStore.Images.Media.RELATIVE_PATH, "Movies/");
valuesvideos.put(MediaStore.Images.Media.TITLE, fileName);
valuesvideos.put(MediaStore.Images.Media.DISPLAY_NAME, fileName);
valuesvideos.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg");
valuesvideos.put(MediaStore.Images.Media.DATE_ADDED, System.currentTimeMillis() / 1000);
valuesvideos.put(MediaStore.Images.Media.DATE_TAKEN, System.currentTimeMillis());
valuesvideos.put(MediaStore.Images.Media.IS_PENDING, 1);
ContentResolver resolver = getContentResolver();
Uri collection = MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY);
Size mSize = new Size(96,96);
CancellationSignal ca = new CancellationSignal();
Bitmap bitmapThumbnail = getContentResolver().loadThumbnail(collection, mSize, ca);
Uri uriSavedThumb = resolver.insert(collection, valuesvideos);