2

我正在制作一个视频录制应用程序。视频被录制并存储在隔离存储中,但我想让用户将他的视频从手机上传输出来……也许将视频传输到手机的“音乐+视频”部分或通过其他方式。

隔离存储视频代码:

// File details for storing the recording.        
    private IsolatedStorageFileStream isoVideoFile;


private void StartVideoRecording()
    {
        try
        {
        videos = null;
        isoVideoFileName = string.Format(dateTime.Day.ToString() + dateTime.Month.ToString() + dateTime.Year.ToString() + "_" + dateTime.Hour.ToString() + dateTime.Minute.ToString() + dateTime.Second.ToString()+".mp4");

            //SAVE TO LOCAL MEMORY............

        videos.Add(isoVideoFileName.ToString());
        IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
        if (settings.Contains("Storage"))
        {
            List<string> vids = new List<string>();
            List<string> vids1 = new List<string>();
            vids.AddRange(IsolatedStorageSettings.ApplicationSettings["Storage"] as List<string>);
            videos.AddRange(vids);
            settings["Storage"] = videos;
            settings.Save();
        }
        else
        {
            settings["Storage"] = videos;
            settings.Save();
        }
        //.......................................

            if (captureSource.VideoCaptureDevice != null
                && captureSource.State == CaptureState.Started)
            {
                captureSource.Stop();


                fileSink.CaptureSource = captureSource;
                fileSink.IsolatedStorageFileName = isoVideoFileName;
            }

            // Begin recording.
            if (captureSource.VideoCaptureDevice != null
                && captureSource.State == CaptureState.Stopped)
            {
                captureSource.Start();
            }


            disp.Text = "DashCam - Recording...";
            status = "recording";

        }


        catch (Exception e)
        {
            //this.Dispatcher.BeginInvoke(delegate()
            //{
            //    MessageBox.Show(e.ToString());
            //    
            //});
        }
    }

更新 1

在解决这个问题时,我发现文档中提供的 ID_CAP_MEDIALIB_VIDEO 使我们能够将视频传输到相机胶卷。但是清单丢失了,那么还有其他方法可以使这成为可能吗?

4

1 回答 1

1

看这个话题:http: //developer.nokia.com/Community/Discussion/showthread.php/239630-Can-i-save-video-to-CameraRoll

还有关于音乐+视频中心的信息:http: //msdn.microsoft.com/en-us/library/windowsphone/develop/ff769558%28v=vs.105%29.aspx

于 2013-12-13T23:09:49.510 回答