【问题标题】:Windows Phone - Save a thumbnail preview into isolated storage of recorded videoWindows Phone - 将缩略图预览保存到录制视频的独立存储中
【发布时间】:2013-02-02 14:00:50
【问题描述】:

我有一个应用程序,我想让用户录制视频,然后将该视频与代表该视频的图像一起保存到独立存储中。我从这里的一些示例代码中找出了视频部分:

' Set recording state: start recording.
Private Sub StartVideoRecording()
Try
         ...
    App.ViewModel.IsDataLoaded = False

    ' Connect fileSink to captureSource.
    If captureSource.VideoCaptureDevice IsNot Nothing AndAlso captureSource.State = CaptureState.Started Then
        captureSource.Stop()

        ' Connect the input and output of fileSink.
        fileSink.CaptureSource = captureSource
        fileSink.IsolatedStorageFileName = isoVideoFileName
    End If

    ' Begin recording.
    If captureSource.VideoCaptureDevice IsNot Nothing AndAlso captureSource.State = CaptureState.Stopped Then
        captureSource.Start()
    End If

    ' Set the button states and the message.
    UpdateUI(ButtonState.Recording, "Recording...")


Catch e As Exception
    ' If recording fails, display an error.
    Me.Dispatcher.BeginInvoke(Sub() txtDebug.Text = "ERROR: " & e.Message.ToString())
End Try
End Sub

' Set the recording state: stop recording.
Private Sub StopVideoRecording()
Try
    ' Stop recording.
    If captureSource.VideoCaptureDevice IsNot Nothing AndAlso captureSource.State = CaptureState.Started Then
        captureSource.Stop()

        ' Disconnect fileSink.
        fileSink.CaptureSource = Nothing
        fileSink.IsolatedStorageFileName = Nothing

        ' Set the button states and the message.
        UpdateUI(ButtonState.NoChange, "Preparing viewfinder...")

        StartVideoPreview()
    End If
Catch e As Exception
    ' If stop fails, display an error.
    Me.Dispatcher.BeginInvoke(Sub() txtDebug.Text = "ERROR: " & e.Message.ToString())
End Try
End Sub

有没有办法自动从录制的视频中提取缩略图而不强制用户也拍照?

【问题讨论】:

    标签: windows-phone-8 windows-phone


    【解决方案1】:

    您会很高兴知道系统会生成一个自动缩略图。文件名将具有 .jpg 扩展名。您可以寻找一个独立存储浏览器来查看结果。

    【讨论】:

    • 我正在使用windows phone 电动工具浏览,我没有看到任何生成的jpg 文件...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-16
    • 2017-11-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多