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

Codec for Rendering in MXF format from kdenlive

Tags: None
(comma "," separated)
syedr
Registered Member
Posts
12
Karma
0
Need help for rendering in MXF format format ... I have used this parameters [ f=mxf mlt_profile=atsc_1080p_25 vcodec=mpeg2video pix_fmt=yuv422p vb=185M acodec=pcm_s24le ar=48000 ac=2 ] to render in mxf format . it gives output in mxf format but i need to match several things .

Here is the sample of a mxf video info :

General
Complete name : C:\Users\Avi\Desktop\COM_AMSL_Samsung_Galaxyj2_Campaing_30s.MXF
Format : MXF
Commercial name : XDCAM HD422
Format version : 1.3
Format profile : OP-1a
Format settings : Closed / Complete
File size : 189 MiB
Duration : 30 s 0 ms
Overall bit rate : 52.8 Mb/s
Encoded date : 2017-02-16 11:08:40.824
Writing application : Grass Valley K.K. EDIUS 7.0

Video
ID : 2
Format : MPEG Video
Commercial name : XDCAM HD422
Format version : Version 2
Format profile : 4:2:2@High
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=15
Format settings, picture st : Frame
Format settings, wrapping m : Frame
Codec ID : 0D01030102046001-0401020201040300
Duration : 30 s 0 ms
Bit rate : 50.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 FPS
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.965
Time code of first frame : 00:54:14:01
Time code source : Group of pictures header
GOP, Open/Closed : Open
GOP, Open/Closed of first f : Closed
Stream size : 179 MiB (95%)
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

Audio #1
ID : 3
Format : PCM
Format settings, Endianness : Little
Format settings, wrapping m : Frame (AES)
Codec ID : 0D01030102060300
Duration : 30 s 0 ms
Bit rate mode : Constant
Bit rate : 768 kb/s
Channel(s) : 1 channel
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 spf)
Bit depth : 16 bits
Stream size : 2.75 MiB (1%)

Audio #2
ID : 4
Format : PCM
Format settings, Endianness : Little
Format settings, wrapping m : Frame (AES)
Codec ID : 0D01030102060300
Duration : 30 s 0 ms
Bit rate mode : Constant
Bit rate : 768 kb/s
Channel(s) : 1 channel
Sampling rate : 48.0 kHz
Frame rate : 25.000 FPS (1920 spf)
Bit depth : 16 bits
Stream size : 2.75 MiB (1%)

Other #1
ID : 1-Material
Type : Time code
Format : MXF TC
Time code of first frame : 00:54:14:01
Time code settings : Material Package
Time code, striped : Yes

Other #2
ID : 1-Source
Type : Time code
Format : MXF TC
Time code of first frame : 00:54:14:01
Time code settings : Source Package
Time code, striped : Yes

Other #3
Type : Time code
Format : SMPTE TC
Muxing mode : SDTI




my renderring matches almost all the avobe but i nedd XDCAM HD422 info too . how can i render in MXF which matches with all the info given above .
Thanks in advance :)
Inapickle
Registered Member
Posts
157
Karma
3
Best I can suggest is doing a web search for ffmpeg command lines for encoding XDCAM HD422 and when you've found one (hopefully) that produces the desired results and MediaInfo profile, look at translating that into the corresponding MLT encode parameters, assuming of course that all of the parameters have an MLT equivalent. That's what I normally do when formulating custom render formats.

A couple of pointers just from a cursory search:

https://lists.ffmpeg.org/pipermail/ffmp ... 15953.html
http://ffmpeg.gusari.org/viewtopic.php?f=11&t=1495
https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=2066

Purely out of interest, why the need to render XDCAM HD422 specifically - is it a broadcast requirement or something ?
syedr
Registered Member
Posts
12
Karma
0
Thanks for your reply . yes i need XDCAM HD422 for broadcasting purpose . stratus do not import videos until video is XDCAM HD422

i am still trying to write a parameter by searching internet .
Inapickle
Registered Member
Posts
157
Karma
3
syedr wrote:Thanks for your reply . yes i need XDCAM HD422 for broadcasting purpose . stratus do not import videos until video is XDCAM HD422


So, if I understand correctly, you are looking to import your KDenLive render (back) into G.V. Stratus for further processing ? I don't have any experience with Grass Valley systems, but is HDCAM HD422 really the only 8-bit 422 format Stratus will import?

syedr wrote:i am still trying to write a parameter by searching internet .


Well, assuming you are familiar with ffmpeg, the command lines in those links I posted are a good place to start. Experimenting with a 1080/50i source, this variation for example produced an HDCAM HD422.mxf file that is consistent with the MediaInfo profile you posted:

Code: Select all
ffmpeg -i {Path}\Test_108050i.mov  -vcodec mpeg2video -pix_fmt yuv422p -non_linear_quant 1 -flags +ildct+ilme -top 1 -dc 10 -intra_vlc 1 -qmax 6 -lmin "1*QP2LAMBDA" -vtag xd5c -rc_max_vbv_use 1 -rc_min_vbv_use 1 -g 15 -bf 2 -b:v 50000k -minrate 50000k -maxrate 50000k -bufsize 8000K -acodec pcm_s16le -ar 48000 -ac 2 {Path}/Test_108050i_XDCAM_HD422.mxf 


Code: Select all
General
Complete name                            : X:\Test_108050i_XDCAM_HD422.mxf
Format                                   : MXF
Commercial name                          : XDCAM HD422
Format version                           : 1.2
Format profile                           : OP-1a
Format settings                          : Closed / Complete
File size                                : 228 MiB
Duration                                 : 37 s 0 ms
Overall bit rate                         : 51.8 Mb/s
Encoded date                             : 0-00-00 00:00:00.000
Writing application                      : FFmpeg OP1a Muxer 57.58.101

Video
ID                                       : 2
Format                                   : MPEG Video
Commercial name                          : XDCAM HD422
Format version                           : Version 2
Format profile                           : 4:2:2@High
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Default
Format settings, GOP                     : M=3, N=15
Format settings, picture structure       : Frame
Format settings, wrapping mode           : Frame
Codec ID                                 : 0D01030102046001-0401020201040300
Duration                                 : 37 s 0 ms
Bit rate mode                            : Constant
Bit rate                                 : 50.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.965
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Open
GOP, Open/Closed of first frame          : Closed
Stream size                              : 221 MiB (97%)

Audio
ID                                       : 3
Format                                   : PCM
Format settings, Endianness              : Little
Format settings, wrapping mode           : Frame (AES)
Codec ID                                 : 0D01030102060300
Duration                                 : 37 s 0 ms
Bit rate mode                            : Constant
Bit rate                                 : 1 536 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 spf)
Bit depth                                : 16 bits
Stream size                              : 6.77 MiB (3%)
Locked                                   : Yes

Other #1
ID                                       : 1-Material
Type                                     : Time code
Format                                   : MXF TC
Time code of first frame                 : 00:00:00:00
Time code settings                       : Material Package
Time code, striped                       : Yes

Other #2
ID                                       : 1-Source
Type                                     : Time code
Format                                   : MXF TC
Time code of first frame                 : 00:00:00:00
Time code settings                       : Source Package
Time code, striped                       : Yes

Other #3
Type                                     : Time code
Format                                   : SMPTE TC
Muxing mode                              : SDTI
Time code of first frame                 : 00:00:00:00



KDenLive imports the encode just fine, but whether Stratus would accept it is another matter and something you'd need to test. And then there's the question of translating the ffmpeg encode parameters into MLT format. Maybe others more experienced with MLT coding could help you with that. First though you need to see if you can create an XDCAM 422.mxf file with ffmpeg that Stratus will accept.

Best I can suggest.
Inapickle
Registered Member
Posts
157
Karma
3
Here you go - after all that, there is actually an MLT preset for XDCAM HD422.....just takes a bit of digging around ;)

https://github.com/mltframework/mlt/blo ... DCAM-HD422:

f=mxf
vcodec=mpeg2video
top_field_first=1
pix_fmt=yuv422p
minrate=50M
maxrate=50M
vb=50M
dc=10
flags2=+ivlc+non_linear_q
intra_vlc=1
non_linear_qant=1
lmin=1*QP2LAMBDA
rc_max_vbv_use=1
rc_min_vbv_use=1
qmin=1
qmax=12
bufsize=36408333
g=12
bf=2
vtag=xd5c

acodec=pcm_s16le

meta.preset.extension=mxf
meta.preset.note=Sony "workflow innovation"


The only difference is that GOP length there is g=12, whereas in the XDCAM HD422 profile you posted it is g=15, the maximum GOP size for PAL.
So does that work for you ?

Just a couple of points though. In your original post you stated:

syedr wrote: I have used this parameters [ f=mxf mlt_profile=atsc_1080p_25 vcodec=mpeg2video pix_fmt=yuv422p vb=185M acodec=pcm_s24le ar=48000 ac=2 ] to render in mxf format


And I see there that you chose mlt_profile=atsc_1080p_25. As I understand, the professional line of Sony XDCAM HD422 camcorders can record in both interlaced (1080/50i) and progressive (1080/25p) scanning modes. So I'm wondering - if your source content (for input into KDenLive) is also XDCAM HD422, is it 1080/50i or 1080/25p ? - because that MLT render profile for XDCAM HD422 assumes interlaced. If your source is 1080/50i and you set the project up as 1080/25p, it will get deinterlaced to 1080/25p and one of the original fields will be discarded in the process, so you will be losing information. In that case, if you do intend to render out to XDCAM HD422 with that MLT profile, you would be best setting the KDenLive project for 1080/50i i.e. Resolution: 'Full HD 1080', Framerate 25 and with the 'interlaced' option selected. If your source is 1080/25p however, then bear in mind that your XDCAM HD422 render will be flagged as being interlaced not progressive.

Second thing is that had you not specified vcodec=mpeg2video in that render profile you came-up with, it would encode DNxHD (185M) by default:

https://github.com/mltframework/mlt/blo ... p_25/DNxHD

And I just wonder - if you did render to DNxHD (with the mxf extension) whether it would be accepted for input by Stratus. Have you tried it ? If Stratus does accept DNxHD.mxf renders, I would suggest that it would be a far better (8-bit 422) transfer intermediate than lossy MPEG2. Sure the file sizes would be larger (more then 3 fold) but the IQ would be near lossless, which is what you really want for an exchange intermediate. Just a thought.
syedr
Registered Member
Posts
12
Karma
0
Thank you for your solution . I got success in XDCAM HD422 in mxf with that but still in stratus the file is not importing . it is going into fail files folder . i dnno why . One of my friend suggest me to change the scan type to interlaced from progressive . How can i do that ? any idea ??

thanks in advance
syedr
Registered Member
Posts
12
Karma
0
My source video in interlaced and i m setting HD 1080i 25fps in project settings but my rendered file shows scan type still progressive . can not find the solution
Inapickle
Registered Member
Posts
157
Karma
3
syedr wrote:Thank you for your solution .


Well it's the mlt preset for XDCAM HD422 that creates an mxf file consistent with the profile you posted, which is what you requested.

syedr wrote:I got success in XDCAM HD422 in mxf with that but still in stratus the file is not importing . it is going into fail files folder . i dnno why


These proprietary programs can be very twitchy when it comes to importing files encoded with ffmpeg/MLT. Whether it's something to do with the mxf wrapper itself or some nuance in the encoded video/audio streams, I have no idea. If it's any consolation DaVinci Resolve doesn't even recognize mxf files encoded with ffmpeg/MLT, let alone import them.

syedr wrote:One of my friend suggest me to change the scan type to interlaced from progressive . How can i do that ? any idea ??


Does he have a particular reason for suggesting that, or is it just a stab in the dark.

There is a little (Windows) utility called Restream that can modify certain flags in MPEG-2 'elementary streams' (m2v) without re-encoding.

http://www.videohelp.com/software/Restream

I used to use it when I was shooting HDV on a Canon HV30 in 30PsF (Progressive Segmented Frame) format (i.e. progressive content 'wrapped' as interlaced 60i ). With Restream it was possible to change the Picture Coding Extension flags from field based to frame-type progressive, which avoided problems that occurred with some editing software that treated the original m2t clips as though the content were interlaced. Whether it would work with de-muxed XDCAM H422 mxf files, I'm really not sure.

What's more, the MediaInfo profile that you included in your first post, which would appear to be an XDCAM HD422.mxf file produced with G.V. Edius 7.0 (Writing application : Grass Valley K.K. EDIUS 7.0) and not a native Sony clip, is reported as being interlaced, so I don't see why the KDenLive render being likewise interlaced would be the reason why it is rejected by G.V. Stratus.

syedr wrote:My source video in interlaced and i m setting HD 1080i 25fps in project settings but my rendered file shows scan type still progressive . can not find the solution


There's no way that the rendered XDCAM HD422 file could be reported by MediaInfo as anything other than interlaced - that's how it is encoded. So on what basis are you saying it is "scan type still progressive" ? Only thing I can think of is that the "content" is itself progressive and you are referring to how it appears on playback ?

If you'd like to get a sample of your source footage to me, I'll have a look at it and figure out what's going on there.... on the KDenLive side of things, that is. PM me if you are interested.

Edit:
One other stab in the dark:

Inapickle wrote:Here you go - after all that, there is actually an MLT preset for XDCAM HD422.....just takes a bit of digging around ;)

https://github.com/mltframework/mlt/blo ... DCAM-HD422:

f=mxf
vcodec=mpeg2video
top_field_first=1
pix_fmt=yuv422p
minrate=50M
maxrate=50M
vb=50M
dc=10
flags2=+ivlc+non_linear_q
intra_vlc=1
non_linear_qant=1
lmin=1*QP2LAMBDA
rc_max_vbv_use=1
rc_min_vbv_use=1
qmin=1
qmax=12
bufsize=36408333
g=12
bf=2
vtag=xd5c

acodec=pcm_s16le

meta.preset.extension=mxf
meta.preset.note=Sony "workflow innovation"


The only difference is that GOP length there is g=12, whereas in the XDCAM HD422 profile you posted it is g=15, the maximum GOP size for PAL.


Did you try rendering with the GOP size set to g=15 instead of g=12 ? Maybe Stratus is fussy about the GOP structure.

And another long-shot:

Inapickle wrote:If it's any consolation, DaVinci Resolve doesn't even recognize mxf files encoded with ffmpeg/MLT, let alone import them.


But, (having just tested it) Resolve happily imports ffmpeg and KDenLive rendered XDCAM HD422 files encoded with the .mov extension. So it's definitely the (ffmpeg) mxf format that's the issue with Resolve. Maybe worth seeing if Stratus accepts KDenLive XDCAM 422 renders with .mov extension then ? You've nothing to lose.

Last edited by Inapickle on Wed Mar 01, 2017 12:58 pm, edited 1 time in total.
Inapickle
Registered Member
Posts
157
Karma
3
Well, I was intending to roll my Windows 7 (64-bit) system back to an earlier back-up anyway, so I thought I'd test out the trial version of G.V Edius Pro 8.3 before I did. Edius Pro imported all the 1080/50i XDCAM HD422.mxf clips that I had created earlier using the KDenLive render profile (with the GOP size set to g=12 or g=15), as well as those encoded with the ffmpeg command line, without any issues. It also imported KDenLive HDCAM HD422 renders created with the .mov extension in place of .mxf.

So I don't see why you are having issues importing your XDCAM 422.mxf renders into G.V Stratus.

Edius Pro wouldn't however import 8-bit DNxHD (185M) renders in .mxf or .mov format, but it would import an AVC-Intra (100) mxf file transcoded with ffmpeg.

Again, if you want to send me a sample clip of your source footage, along with a KdenLive XDCAM HD422.mxf render of the same, I will be happy to test them out, but I'll only keep the Edius Pro trial running for a day.

BTW - you didn't say what version of KDenLive you are using and on what distro. I'm running 16.12.1 on Kubuntu 16.10 (AMD 64).
syedr
Registered Member
Posts
12
Karma
0
I am using kdenlive Version 15.12.3 on ubutu 16.04
how i can send sample video footage to you ??
Inapickle
Registered Member
Posts
157
Karma
3
I've sent you a PM with details. Check your In-Box.
syedr
Registered Member
Posts
12
Karma
0
i m trying to upload my src video in your given link but it failed again and again . good news is i have successfully rendered video in XDCAM HD422 mxf with interlaced and it successfully imported in stratus now . But now a new problem arise . that is, in our source video we used 2 wireless microphones, one for the presenter and one for the guest/speaker. Kdenlive only takes one track, the other track is completely invisible in kdenlive . how can we solve this issue ??
Inapickle
Registered Member
Posts
157
Karma
3
Don't know why you have a problem uploading to DataFileHost , it's always worked for me. I can't imagine the file size was more than the 512MB limit. Anyhow, I'm glad you managed to produce a XDCAM HD422 render that Stratus will import. With that, I'll remove the Edius Pro trial from my PC - I only kept it going to test your files.

As for the two track audio issue; audio is not really my forte and I was going to suggest that you post your query in the Audio forum section.......but I see you already have:

viewtopic.php?f=271&t=139130

You might want to provide there details of your source material, such as a MediaInfo profile, and also the version of KDenLive you are running. People are generally more inclined to respond when there is supportive information that helps to address the issue.

My two-cents - if you want to edit the audio tracks separately, you might have to demux your source to extract the audio track streams and import the 'missing' track separately into KDenLive:

viewtopic.php?f=271&t=112141&hilit=multiple+track+audio

Otherwise, look at merging/remuxing the tracks before importing (as a single file) into KDenLive, using ffmpeg CLI or a utility that can do that.
Inapickle
Registered Member
Posts
157
Karma
3
Inapickle wrote:
syedr wrote:My source video in interlaced and i m setting HD 1080i 25fps in project settings but my rendered file shows scan type still progressive . can not find the solution


There's no way that the rendered XDCAM HD422 file could be reported by MediaInfo as anything other than interlaced - that's how it is encoded. So on what basis are you saying it is "scan type still progressive" ? Only thing I can think of is that the "content" is itself progressive and you are referring to how it appears on playback ?

If you'd like to get a sample of your source footage to me, I'll have a look at it and figure out what's going on there.... on the KDenLive side of things, that is.


Just an after-thought if you are looking in. One reason I suggested sending me a sample is that I wondered if your source material is actually progressive content, flagged ('wrapped') as interlaced, which would be the case if recorded in 1080/25PF format (i.e. progressive segmented frames) which I believe some XDCAM camcorders do. That could also occur if the original recording was true progressive scan 1080 25p but was exported from another system as interlaced 1080 50i. What you should do in that case is set the KDenLive project for 1080 25p but BEFORE loading your imported footage on the timeline, go into Clip Properties > Force Properties and change the Scanning from Interlaced to Progressive. That should force KDenLive to interpret the clip as progressive (frame based) instead of interlaced (field based) and so avoid unnecessary deinterlacing (as described above). When you render out to XDCAM HD422 using that preset it will get flagged as interlaced again, like the source clip.
syedr
Registered Member
Posts
12
Karma
0
Thank you for your Help and support . your suggestions really helped me a lot .
i found there is no way for multi channel audio editing in kdenlive . i have to demux or use audacity for that . still searching for something helpfull .


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]