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

How to: Rendering videos with 6 (5.1) Audio channels

Tags: None
(comma "," separated)
timescape
Registered Member
Posts
10
Karma
0
Hi,
I am newbie. Please bare with Me if this question has been answered before (I have not been able to find it). :)

Kubuntu 16.04
Kdenlive: 17.04.3
KDE Frameworks 5.18.0
Qt 5.5.1 (bygget imod 5.5.1)
vinduessystemet xcb

MLT: 6.5.0
FFmpeg libraries

Got a new video cam. The file format is *.MTS. Import is OK.
Clip exemple Data from Kdenlive:
00003.MTS:
Aspekt pixel : 1.000
Audio bitrate: 384 kb/s
color space: ITU-R 709
Framerate: 50
frame size: 1920x1080
sound ch: 6
sound codec: ATSC A/52A (AC-3)
Sound freq. : 48000
Pixel-format: yuv420p
Scanner: Progressiv
Video-codec: H264 / AVC / MPEG-4 AVC / MPEG-4 part 10.

I want to take all my MTS clips and render them to one file.

How do i render to MP4 or MKV container. With 5.1 audio. ?
(or setup/edit a profile).

I have rendered with all the standard profiles i could find. They all ended up with only 2ch audio.
(lossless profiles made a BIG file. also only Stereo sound. So those profiles i not an option :) ).
I have looked through the MLT doc. as referenced i Kdenlive. But I could not find the parameters used

Thanks in advance
Br.

Note.
I have also posted this question in the KDE forum - Kdenlive section..
But I not got any response :(
Please notify Me if I should ask this quistion i another forum :)
Thanks :)
kalimerox
Registered Member
Posts
180
Karma
0
hi there,

without being really able to help you, here some hints, that might help..

for having surround in one file you need to encode in ac3 for example (I did this, but only outside of kdenlive, in audacity for example this is possible... )


do you see all the mono tracks when you open your file in kdenlive and put it on the timeline? or is it just one or two tracks?
timescape
Registered Member
Posts
10
Karma
0
kalimerox wrote:hi there,

without being really able to help you, here some hints, that might help..

for having surround in one file you need to encode in ac3 for example (I did this, but only outside of kdenlive, in audacity for example this is possible... )


do you see all the mono tracks when you open your file in kdenlive and put it on the timeline? or is it just one or two tracks?




Thanks for your reply :)

I have experimented with many af rendering profiles given by Kdenlive.. ac3 should be the right format to use for 5.1..
But they all come out in 2ch when rendering..
I have tried to create my own rendering profile by copy an existing and change the parameters.. Kdenlive reference to MLT doc. But I af been unable to find the parmeters used in the mlt doc..
So I am a little lost :)

I do not see any sound files.. The ac3 5.1 sound is already included in the orig. video .. :)

The orig. clips (.MTS) is basically very fine and OK i size, but i would like to edit them and make the into one long movie..

Thanks
br.
kalimerox
Registered Member
Posts
180
Karma
0
too bad i cant help you further.
there had been some trouble with previous versions of kdenlive for audio (it gets rendered down to 16bits, some clicks get introduced, etc.. ) so be careful with it ;)

does it work to just export to ac3 and maintain the original 5.1. audio? or does the sound get altered already and mixed down to 2ch?
timescape
Registered Member
Posts
10
Karma
0
kalimerox wrote:too bad i cant help you further.
there had been some trouble with previous versions of kdenlive for audio (it gets rendered down to 16bits, some clicks get introduced, etc.. ) so be careful with it ;)

does it work to just export to ac3 and maintain the original 5.1. audio? or does the sound get altered already and mixed down to 2ch?



Hi Kalimerox,
Thanks for your help.
I can extract the sound in command line and edit it in other programs. no problem.
But I really hoped that I could use the grate kdenlive to edit my video clips and render them into one video. :)


For Me it looks like Kdenlive is unable to pass anything more than 2 ch sound.. :( ?
Hope I am wrong. Can anybody help Me understand ???


This terminal command line will make a perfect result with a52 (ac3) 3F2R/LFE. (2 videos with 5.1 audio in one mkv).
ffmpeg -i "concat:00000.MTS|00001.MTS" -c:a copy -c:v libx264 outFile2.mkv

kdenlive reference to the "mlt" parameters, but it make no sense as i looks to be FFmpeg commands.
however I can not figure out the syntax of the rendering profiles. Can someone help ?

making a new profile with those parameters in kdenlive:
-c:a copy -c:v libx264
also only render to 2ch audio.. (no errors given, and video OK ).

Hope someone can help clarifying this issue .

Thanks
br.
User avatar
Stetsbequem
Registered Member
Posts
137
Karma
-2
OS
> How to: Rendering videos with 6 (5.1) Audio channels
ac=6
Video and audio separately. Audio format Flac or Wave. Then assemble with ffmpeg, mkvtoolnix …
Code: Select all
f=flac acodec=flac ar=48000 ac=6 sample_fmt=s16le vn=1 video_off=1


The Social Credit System is a credit rating and blacklist being developed by the the ruling Chinese Communist Party. The goal is total control of the population by awarding points for desirable behavior, or withdrawing them for negative behavior.
timescape
Registered Member
Posts
10
Karma
0
Stetsbequem wrote:> How to: Rendering videos with 6 (5.1) Audio channels
ac=6
Video and audio separately. Audio format Flac or Wave. Then assemble with ffmpeg, mkvtoolnix …
Code: Select all
f=flac acodec=flac ar=48000 ac=6 sample_fmt=s16le vn=1 video_off=1


Hi Stetsbequem,

thanks a lot for your reply. !
I figured it out with your help :)
flac codec did not work for Me. My player (can play flac fine), complained about som some specified/header.

Still working on figuring out what flags that is supported in kdenlive rendering profiles. (Have to use "=", but some flags seems to be ignored by kdenlive) Can't fint doc on that...
Also new profiles can be grayed out when kdenlive is launched. Have to open profile and press OK, then they are active again :)

Still working on flags for a good quality video. But to help others I list my currently working profiles here:

OK quality into MKV:
properties=x264-medium f=mkw vcodec=libx264 pix_fmt=yuv420p acodec=ac3 ar=48000 ac=6 crf=17

OK quality into mp4:
properties=x264-medium f=mp4 vcodec=libx264 pix_fmt=yuv420p acodec=ac3 ar=48000 ac=6

Again.
Thanks a lot :)
br.
Kevaaq
Registered Member
Posts
21
Karma
0
Have you tried adding channels=6

properties=x264-medium f=mp4 vcodec=libx264 pix_fmt=yuv420p acodec=ac3 ar=48000 channels=6
timescape
Registered Member
Posts
10
Karma
0
Kevaaq wrote:Have you tried adding channels=6

properties=x264-medium f=mp4 vcodec=libx264 pix_fmt=yuv420p acodec=ac3 ar=48000 channels=6


Hi Kevaaq,
thanks for your reply.

Flag ac=6 works fine for sound :)
solved :)

I am currently working on finding a good container and setting for video quality that will not make "lag" on the TV picture on quick moving objects. :)
Always the trade of, file size, rendering time and quality :)

All the best
br.
kde-nick
Registered Member
Posts
1
Karma
0
This post is a little older, but in the meantime we have another Kdenlive version (20.12.2) in which is doesn't work anymore.

Well, actually it does work, it just doesn't want to. ;)

So, if you try to export, let's say an 6-channel AC3 sound, you can specify all parameters as mentioned above. But the result will be a 2-channel audio. There seems to be a bug in Kdenlive which turns 6-channels back to 2-channels maybe just right after it reads it from the script.

But there is a workaround: Generate the script and write it to disc. Pretty much on top you will find a section starting with "consumer". The very first entry is channels which has changed to "2". Just turn it back back to "6" and save the file. Then maybe restart Kdenlive and run the script. You will see: you will have the 6 channels in the audio stream.

This is how the "consumer secction" looks in my script:

Code: Select all
<consumer channels="6" target="/home/user/audio.ac3" ar="48000" threads="0" real_time="-4" mlt_service="avformat" ab="448k" acodec="ac3" in="0" out="161904"/>


I am not quite sure what threads="0" means. On my laptop, all 8 processors are running on high load when starting the script.

out="161904 defines the last frame of the video. So, if you replace it by 300 or so, then you will get a short part of the video to check out if it works.

Enjoy...


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar