Bug 438858 - Missing support for GoPro .LRV files
Summary: Missing support for GoPro .LRV files
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Rendering & Export (show other bugs)
Version: 21.04.2
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-18 11:00 UTC by Anders Lund
Modified: 2021-10-11 01:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
fritzibaby: Brainstorm+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Lund 2021-06-18 11:00:34 UTC
This is really a feature request. I own a GoPro, and it produces *.lrv files that I think can be used as proxies. There is support for vendor produced (external) proxies in the settings and project properties, but only Sony PXW files. I suggest looking into adding GoPro LRV files to the list. If needed I can provide sample files from my GoPro 5 black edition.
Comment 1 emohr 2021-06-20 13:40:17 UTC
Thanks for the suggestion. Yes a sample file would be helpful. Can you check/test if this *.lrv files run on Kdenlive or the VLC player? 

I set this issue to wishlist.
Comment 2 Anders Lund 2021-06-20 14:56:03 UTC
Hi,

Thanks a lot!

The LRV files plays in VLC and can be added to kdenlive projects and works 
there. According to kdenlive the set (.mp4 and .lrv) have the exact same 
length just as expected.

Sample files: https://alundnc.dynv6.net/index.php/s/soRPQpfnsz4e8zp


Below is a sample output from MediaInfo from the .LRV file:

I believe the 3 other streams are telemetry data, GPS and movement sensor. 
Those are available in the mp4 file as well, and if the qml mlt source ever 
becomes available those would be a fun use for that (like gauges and maps)

General
Complete name                            : /run/media/anders/disk/DCIM/
100GOPRO/GOPR0274.LRV
Format                                   : MPEG-4
Format profile                           : Base Media / Version 1
Codec ID                                 : mp41 (mp41)
File size                                : 3.97 MiB
Duration                                 : 12 s 373 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 2 692 kb/s
Encoded date                             : UTC 2021-06-20 16:51:44
Tagged date                              : UTC 2021-06-20 16:51:44
AMBA                                     : x
FileExtension_Invalid                    : braw mov mp4 m4v m4a m4b m4p m4r 
3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Format settings, GOP                     : M=1, N=8
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 12 s 360 ms
Bit rate mode                            : Variable
Bit rate                                 : 2 500 kb/s
Width                                    : 854 pixels
Original width                           : 864 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.244
Stream size                              : 3.70 MiB (93%)
Title                                    : GoPro AVC
Language                                 : English
Encoded date                             : UTC 2021-06-20 16:51:44
Tagged date                              : UTC 2021-06-20 16:51:44
Color range                              : Limited
colour_range_Original                    : Full
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 12 s 373 ms
Bit rate mode                            : Constant
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 194 KiB (5%)
Title                                    : GoPro AAC
Language                                 : English
Encoded date                             : UTC 2021-06-20 16:51:44
Tagged date                              : UTC 2021-06-20 16:51:44

Other #1
ID                                       : 3
Type                                     : Time code
Format                                   : QuickTime TC
Duration                                 : 12 s 360 ms
Bit rate mode                            : Constant
Frame rate                               : 25.000 FPS
Time code of first frame                 : 16:51:44:16
Time code, striped                       : Yes
Title                                    : GoPro TCD
Language                                 : English
Encoded date                             : UTC 2021-06-20 16:51:44
Tagged date                              : UTC 2021-06-20 16:51:44

Other #2
Type                                     : meta
Duration                                 : 11 s 440 ms
Bit rate mode                            : Variable

Other #3
Type                                     : meta
Bit rate mode                            : Variable
mdhd_Duration                            : 12360


---
søndag den 20. juni 2021 15.40.17 CEST skrev du:
> https://bugs.kde.org/show_bug.cgi?id=438858
> 
> emohr <fritzibaby@gmx.net> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
> CC|                            |fritzibaby@gmx.net Flags|                  
>          |Brainstorm+
>            Severity|normal                      |wishlist
> 
> --- Comment #1 from emohr <fritzibaby@gmx.net> ---
> Thanks for the suggestion. Yes a sample file would be helpful. Can you
> check/test if this *.lrv files run on Kdenlive or the VLC player?
> 
> I set this issue to wishlist.
Comment 3 emohr 2021-06-20 16:29:08 UTC
Thanks for the test file. The *.lrv files are h.264 files and can be played by Kdenlive. Let's see when we can implement.
Comment 4 Alex Wigen 2021-10-09 13:36:33 UTC
Hi there,

I've made a patch which enables using GoPro LRV proxy files in kdenlive. I haven't got a dev environment for kdenlive but the patch is simple enough that it should work.

I've tested proxies successfully using the update externalproxies.rc and symlinking the GX high-res clips to GL names versions in order to work around the missing prefix support.

i.e.:
for file in GX*MP4; do ln -s $file `echo $file | sed 's/GX/GL/'`; done

It would be great to get this into kdenlive as GoPro footage is very prevalent.


diff --git a/data/externalproxies.rc b/data/externalproxies.rc
index 41c617e0a..be733b975 100644
--- a/data/externalproxies.rc
+++ b/data/externalproxies.rc
@@ -8,4 +8,5 @@
 
 [proxy]
 Sony PXW=../Sub;;S03.MP4;../Clip;;.MXF
+GoPro LRV=./;GL;.LRV;./;GX;.MP4
 
diff --git a/src/bin/projectclip.cpp b/src/bin/projectclip.cpp
index ab6e2aedd..28a120b58 100644
--- a/src/bin/projectclip.cpp
+++ b/src/bin/projectclip.cpp
@@ -560,6 +560,10 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer)
                     QDir dir = info.absoluteDir();
                     dir.cd(externalParams.at(3));
                     QString fileName = info.fileName();
+                    if (fileName.startsWith(externalParams.at(1)) {
+                        filename.remove(0, externalParams.at(1).size());
+                        filename.prepend(externalParams.at(4));
+                    }
                     if (!externalParams.at(2).isEmpty()) {
                         fileName.chop(externalParams.at(2).size());
                     }
[alex@ole kdenlive]$ git cola
[alex@ole kdenlive]$ git show
commit e77b9248043f14206238d83a004f9f73f8150168 (HEAD -> master)
Author: Alexander Wigen <alex@wigen.net>
Date:   Sat Oct 9 23:22:51 2021 +1000

    Add prefix support for external proxies required for GoPro footage
    
    This also adds the GoPro LRV proxy format definition.

diff --git a/data/externalproxies.rc b/data/externalproxies.rc
index 41c617e0a..be733b975 100644
--- a/data/externalproxies.rc
+++ b/data/externalproxies.rc
@@ -8,4 +8,5 @@
 
 [proxy]
 Sony PXW=../Sub;;S03.MP4;../Clip;;.MXF
+GoPro LRV=./;GL;.LRV;./;GX;.MP4
 
diff --git a/src/bin/projectclip.cpp b/src/bin/projectclip.cpp
index ab6e2aedd..28a120b58 100644
--- a/src/bin/projectclip.cpp
+++ b/src/bin/projectclip.cpp
@@ -560,6 +560,10 @@ bool ProjectClip::setProducer(std::shared_ptr<Mlt::Producer> producer)
                     QDir dir = info.absoluteDir();
                     dir.cd(externalParams.at(3));
                     QString fileName = info.fileName();
+                    if (fileName.startsWith(externalParams.at(1)) {
+                        filename.remove(0, externalParams.at(1).size());
+                        filename.prepend(externalParams.at(4));
+                    }
                     if (!externalParams.at(2).isEmpty()) {
                         fileName.chop(externalParams.at(2).size());
                     }
Comment 5 Alex Wigen 2021-10-10 11:03:02 UTC
I've put this into a merge request:
https://invent.kde.org/multimedia/kdenlive/-/merge_requests/255
Comment 6 Alex Wigen 2021-10-11 00:36:58 UTC
This has been merged and GoPro LRV proxy support will be in the 21.12.0 release