我試圖在Windows Phone 8(具體而言,480x480)中以特定分辨率捕獲MP4視頻。我知道我不能使用預設以外的尺寸,而480x480不是預設。如何轉換捕獲的視頻(如640x480)並裁剪頂部和底部以使其達到480x480?歡迎任何免費或開源庫(在Windows Phone上運行)。請不要回答諸如「使用外部服務器」等答案,我需要一個設備上解決方案。在Windows Phone 8中以非標準尺寸錄製視頻(或轉換後)Windows Phone 8
8
A
回答
1
使用Windows.Phone.Media.Capture API和AudioVideoCaptureDevice.OpenAsync的AudioVideoCaptureDevice類
第二個參數 - 見this link - 是分辨率。你可以使用AudioVideoCaptureDevice.GetAvailableCaptureResolutions(傳感器)
編輯得到的決議:要設置自定義分辨率嘗試AudioVideoCaptureDevice.SetCaptureResolutionAsync
編輯2:你可以嘗試像下面轉換錄製的視頻的內容:(找不到在哪裏我得到了來自SOZ創作的代碼!)
StorageFolder isoStore = await ApplicationData.Current.LocalFolder.GetFolderAsync("Shared");
var file = await isoStore.CreateFileAsync("foos1.wmv", CreationCollisionOption.ReplaceExisting);
using (var s = await file.OpenAsync(FileAccessMode.ReadWrite))
{
Windows.Foundation.Size resolution = new Windows.Foundation.Size(640, 480);
avDevice = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Back,
AudioVideoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Back).Last());
VideoBrush videoRecorderBrush = new VideoBrush();
videoRecorderBrush.SetSource(avDevice);
viewfinderRectangle.Fill = videoRecorderBrush;
await avDevice.StartRecordingToStreamAsync(s);
Thread.Sleep(30000);
await avDevice.StopRecordingAsync();
}
new MediaPlayerLauncher()
{
Media = new Uri(file.Path, UriKind.Relative),
}.Show();
相關問題
- 1. Windows Phone 8平鋪尺寸?
- 2. Windows Phone 8視頻到MP3轉換器
- 3. 更改照片尺寸Windows Phone 8
- 4. Windows Phone 8視頻處理庫8
- 5. LongListSelector中的Windows Phone 7或Windows Phone 8
- 6. Windows 8中的Windows Phone 8
- 7. Windows Phone 8視口控制
- 8. Windows 8和Windows Phone 8
- 9. 在Windows Phone 8中將視頻文件轉換爲Base64String問題
- 10. 在Windows Phone 8中錄製音頻時的可視化
- 11. Windows phone 8 GeoLocator準確性
- 12. Windows Phone 8
- 13. Windows Phone的8
- 14. Windows Phone 8 ScrollViewer
- 15. MediaPlaybackControls Windows Phone 8
- 16. Windows Phone 8 TextBlock
- 17. Windows Phone 8 System.Reflection.TargetInvocationException
- 18. IsolatedStorage Windows phone 8
- 19. Popup Windows phone 8
- 20. Windows phone 8 XMLParseException
- 21. Windows Phone 8 LongListSelector
- 22. Windows Phone 8錄音揚聲器音頻
- 23. Windows Phone 8 C#播放Flash視頻
- 24. 在的Windows Phone 8
- 25. FontAwesome在Windows Phone 8
- 26. Windows Phone 8可視區域
- 27. Windows phone 8應用轉移
- 28. Windows Phone 8:後退按鈕
- 29. windows phone 8後臺代理
- 30. Windows Phone 8後退按鈕
'AudioVideoCaptureDevice.GetAvailableCaptureResolutions(傳感器)'不含有不期望的分辨率(比如我需要192x144) – CAMOBAP
見編輯,並期待在使用SetCaptureResolutionAsync –
我已經使用'GetAvailableCa ptureResolutions(CameraSensorLocation.Back).Last()',它返回640x480,但我需要'192x144' – CAMOBAP