我目前正在嘗試在上傳到在線云數(shù)據(jù)庫之前降低視頻和音頻的質(zhì)量。下面是我用來錄制視頻的代碼。recordVideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0);將 EXTRA_VIDEO_QUALITY 中的 0 更改為 1 將提高質(zhì)量,反之亦然,但如果是 30 秒或更長時間的視頻,文件仍然太大而無法下載。private void RecordVideoMode() { Intent recordVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE); // Ensure that there's a camera activity to handle the intent if (recordVideoIntent.resolveActivity(getPackageManager()) != null) { videoFile = createVideoFile(); // Continue only if the File was successfully created if (videoFile != null) { videoURI = FileProvider.getUriForFile(this, "com.example.android.fileprovider", videoFile); recordVideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0); recordVideoIntent.putExtra(MediaStore.EXTRA_OUTPUT, videoURI); startActivityForResult(recordVideoIntent, REQUEST_VIDEO_CAPTURE); } } }很感謝任何形式的幫助!
1 回答

一只甜甜圈
TA貢獻1836條經(jīng)驗 獲得超5個贊
您可以使用這兩種方法:
將其編碼為較低的比特率和/或較低的分辨率??纯催@里:
嘗試壓縮/壓縮它??纯催@里:
http://www.jondev.net/articles/Zipping_Files_with_Android_%28Programmatically%29
添加回答
舉報
0/150
提交
取消