diff --git a/src/FlightMap/Widgets/VideoPageWidget.qml b/src/FlightMap/Widgets/VideoPageWidget.qml index 47bd8dc44761d5176035dfe49aab87e3a41efaee..f835e896c1ad7296b074c485cf42a5bf02874bc1 100644 --- a/src/FlightMap/Widgets/VideoPageWidget.qml +++ b/src/FlightMap/Widgets/VideoPageWidget.qml @@ -108,6 +108,15 @@ Item { indexModel: false Layout.alignment: Qt.AlignHCenter } + QGCLabel { + text: qsTr("File Name"); + visible: QGroundControl.videoManager.isGStreamer + } + TextField { + id: videoFileName + visible: QGroundControl.videoManager.isGStreamer + width: 100 + } //-- Video Recording QGCLabel { text: _recordingVideo ? qsTr("Stop Recording") : qsTr("Record Stream") @@ -155,7 +164,7 @@ Item { // reset blinking animation recordBtnBackground.opacity = 1 } else { - _videoReceiver.startRecording() + _videoReceiver.startRecording(videoFileName.text) } } } diff --git a/src/VideoStreaming/VideoReceiver.cc b/src/VideoStreaming/VideoReceiver.cc index c1ee096ec05d3620d34cab71df26fc62b6642fb6..2117ae5c485f8829a897497ae8001af04ab017c9 100644 --- a/src/VideoStreaming/VideoReceiver.cc +++ b/src/VideoStreaming/VideoReceiver.cc @@ -1010,17 +1010,14 @@ VideoReceiver::startRecording(const QString &videoFile) //-- Disk usage maintenance _cleanupOldVideos(); - if(videoFile.isEmpty()) { - QString savePath = qgcApp()->toolbox()->settingsManager()->appSettings()->videoSavePath(); - if(savePath.isEmpty()) { - qgcApp()->showMessage(tr("Unabled to record video. Video save path must be specified in Settings.")); - return; - } - _videoFile = savePath + "/" + QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss") + "." + kVideoExtensions[muxIdx]; - } else { - _videoFile = videoFile; + QString savePath = qgcApp()->toolbox()->settingsManager()->appSettings()->videoSavePath(); + if(savePath.isEmpty()) { + qgcApp()->showMessage(tr("Unabled to record video. Video save path must be specified in Settings.")); + return; } - + _videoFile = savePath + "/" + + (videoFile.isEmpty() ? QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss") : videoFile) + + "." + kVideoExtensions[muxIdx]; qDebug() << "New video file:" << _videoFile; emit videoFileChanged();