This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kdenlive doesn't import .MXF (mpeg2) files correct anymore

Tags: None
(comma "," separated)
Rhizomatic Nomad
Registered Member
Posts
5
Karma
0
OS
Hello lovely geeks,

today I updated to kdenlive 15.08.1-1 on an arch system, but it didn't resolve my problem, so I now ask for help.
Since the update before I'm not anymore able to import clips correctly and/or render the project.

In the project setting I use HD 1080i with 25fps and the footage, recorded with a Canon XF100, is also HD 1080i. With these settings I was a long time able to use kdenlive in an awesome weay to edit and export my footage.
But now in the clip monitor is always the end of the clip missing - and when I render it this missing part is also lost in the rendered file.

Before the update to the recent version kdenlive even didn't play the sound correct when played in the project monitor ... it was on double speed or maybe faster.

Does anybody have an idea how to resolve these problems?

Thanks in advance and best wishes,
Rhizomatic Nomad
Rhizomatic Nomad
Registered Member
Posts
5
Karma
0
OS
Hello again,

nobody has any idea to solve the problem or an idea where i could ask instead?

Best wishes!
djay
Registered Member
Posts
63
Karma
0
User avatar
ttguy
Moderator
Posts
1152
Karma
6
OS
It is probably not a fault with kdenlive. To see where the problem is run these checks.

Can you play the file with ffplay ?
Code: Select all
 ffplay myvideo.MXF

Can you play the file with melt ?

Code: Select all
 melt myvideo.MXF
dapepingl
Registered Member
Posts
1
Karma
0
MXF is supported by an increasing number of professional NLE (non-linear editing) systems like Adobe After Effects, Adobe Premiere Pro, Apple Final Cut Pro X, Sony Vegas Pro and more. But as a general user, the most direct solution to solve the issues above is to convert MXF files to mainstream formats, such as convert MXF to MP4. I suppose, MP4 with H.264/AAC codec may be the most compatible format.
Rhizomatic Nomad
Registered Member
Posts
5
Karma
0
OS
ffplay plays the the files correctly as well as melt. Same as in VLC.

Surely I could convert every file before I use it in Kdenlive but that makes the process a lot longer ... and I opted for Kdenlive especially because it imported the files without the necessity of converting them before.

So I am greatly interested in a solution where I don't have to use an old(er) version of Kdenlive.
User avatar
ttguy
Moderator
Posts
1152
Karma
6
OS
User avatar
qubodup
Registered Member
Posts
142
Karma
0
In my experience, copying the video and audio streams to a new container helps:

Code: Select all
ffmpeg -i video.mts -c copy fix.mts


solved the issues - where the first clip of a sequence of clips would be imported with the length of an image file - with a Canon camcorder for me.

As a workaround you might want to try:

Code: Select all
ffmpeg -i video.mxf -c copy fix.mxf


Please let us know if this helps.
vpinon
KDE Developer
Posts
708
Karma
6
OS
I've seen somewhere that FFmpeg had a bug in MXF demuxer, fixed by some commits this week.
Either use a rolling distro (Arch, Debian-sid, ...) or use the build script updated by ttguy, or wait when I will have time I'm about to push binary builds with up-to-date FFmpeg :)
User avatar
ttguy
Moderator
Posts
1152
Karma
6
OS
Rhizomatic Nomad
Registered Member
Posts
5
Karma
0
OS
I copied the files with
Code: Select all
ffmpeg -i AA007401.MXF -c copy AA007401-copy.MXF
but that didn't change anything.

Before I updated my arch system, so it's an up-to-date system, the last ffmpeg update was on 27.11.2015, my current version is ffmpeg-1:2.8.3-1.
User avatar
qubodup
Registered Member
Posts
142
Karma
0
Hey,

FYI: Rhizomatic reported the issue at https://bugs.kde.org/show_bug.cgi?id=356162

I was able to find sample mxf files at http://hamburgpromedia.com/Testfiles/MX ... tfiles.php (you can enter a fake email address for download, it's not used).

And I noticed a bug with the file format. Not sure if it's related.

It's very strange and you won't notice it right away, but it appears that whenever you play back an mxf file, kdenlive (or melt or ffmpeg) "remembers" the time, at which it stopped playing back and the next time that file is played back, it continues playing back from that time.

Video: https://youtu.be/f9DiYrkftVk (it's different in mlt-git but still buggy, reported in https://sourceforge.net/p/mlt/bugs/235/ )

That bug can be avoided by converting to .mkv or .mov

Code: Select all
ffmpeg -i XDCAM_HD720p60.mxf -c copy x.mkv
[...]
[matroska @ 0x555f90c29c20] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
[...]

Notwithstanding this error, the converted file appears to be working.

Code: Select all
[...]
[mov @ 0x564ca6f91c20] Codec for stream 0 does not use global headers but container format requires global headers
[mov @ 0x564ca6f91c20] Codec for stream 1 does not use global headers but container format requires global headers
[...]
[mov @ 0x564ca6f91c20] pts has no value
[...]

Notwithstanding these warnings, the converted file appears to be working.

I was surprised that this is possible but perhaps it will help your case.

After converting the files, you could try replacing the filenames in a copy of your kdenlive project file to save time importing, moving, cutting clips.
Rhizomatic Nomad
Registered Member
Posts
5
Karma
0
OS
Thanks for that workaround qubodup, to convert the files with
Code: Select all
ffmpeg -i 1080i_25fps_footage.mxf -c copy x.mkv
helped me to cut and render them correctly, even if I don't understand exactly why.

I used ffmpeg 1:2.8.4-1 in arch, build on 20th of December, where the error/bug with the .mxf footage remains.
User avatar
nancyelder
Registered Member
Posts
1
Karma
0
OS
Keep cool ;) You could try this
No matter MPEG2 MPEG4 MP4 AVIMKV to MOV, you can convert freely.
Indeed, Download function is available.
All natural welcome
User avatar
farid
Registered Member
Posts
316
Karma
2
OS
nancyelder wrote:Keep cool ;) You could try this
No matter MPEG2 MPEG4 MP4 AVIMKV to MOV, you can convert freely.
Indeed, Download function is available.
All natural welcome


You don't need a closed source program to do this when you can easily do it directly in ffmpeg or with a GUI for it (winff, tragtor, etc...)




Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]