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

extracting zone from clip fails with Sony camera MP4 files

Tags: None
(comma "," separated)
lmichaels
Registered Member
Posts
15
Karma
0
I am using the kdenlive 17.0.12.0d AppImage on Linux 64-bit.

I have a Sony camera that creates MP4 files with PCM audio. When I import clips into kdenlive, I can play them and add them to the timeline but extracting a zone from a clip fails with this message:

Code: Select all
ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (GCC) 20150212 (Red Hat 4.9.2-6) configuration: --prefix=/app/usr/ --extra-ldflags='-L/app/usr//lib -lstdc++ -lm -lrt -ldl' --extra-cflags=-I/app/usr//include --enable-shared --enable-avfilter --enable-gpl --enable-avresample --enable-libx265 --enable-libvpx --enable-libx264 --disable-doc libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/kdenlive/videos/mandingo ambassadors/mamady-feb27/originals/C0002.MP4': Metadata: major_brand : XAVC minor_version : 16785407 compatible_brands: XAVCmp42iso2 creation_time : 2015-01-28T03:07:40.000000Z Duration: 00:02:59.18, start: 0.000000, bitrate: 95795 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 3840x2160 [SAR 1:1 DAR 16:9], 94011 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default) Metadata: creation_time : 2015-01-28T03:07:40.000000Z handler_name : Video Media Handler encoder : AVC Coding Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s (default) Metadata: creation_time : 2015-01-28T03:07:40.000000Z handler_name : Sound Media Handler Stream #0:2(und): Data: none (rtmd / 0x646D7472), 245 kb/s (default) Metadata: creation_time : 2015-01-28T03:07:40.000000Z handler_name : Timed Metadata Media Handler timecode : 01:44:27:08


[mp4 @ 0xf0ac80] Could not find tag for codec pcm_s16be in stream #1, codec not currently supported in container

Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument

Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Last message repeated 1 times


I have read online and understand the problem is that Sony uses a non-standard audio encoding inside the MP4 container -- but how can I work with these clips in kdenlive? I need to be able to extract zones from clips inspite of Sony's choice of a non-standard audio encoding.
jpasturel
Registered Member
Posts
24
Karma
0
Perhaps extracting audio and exporting to mp3 or acc format with audacity. And aftewards import the audio track into kdenlive project.
humanbeing
Registered Member
Posts
48
Karma
0
OS
did you try to save into MKV instead of MP4?

do you really need to transcode that part? maybe all you need is a simple cutout from the original? what will your delivery container and codecs be? same as in the originals?
lmichaels
Registered Member
Posts
15
Karma
0
jpasturel wrote:Perhaps extracting audio and exporting to mp3 or acc format with audacity. And aftewards import the audio track into kdenlive project.


Thank you for this. Ideally I am looking for a solution within kdenlive.
lmichaels
Registered Member
Posts
15
Karma
0
humanbeing wrote:did you try to save into MKV instead of MP4?


Is this something I can configure in kdenlive? I have again checked the options under Settings => Configure kdenlive. I am adding the clips straight from the camera, so I am guessing (perhaps incorrectly) that when I tell it to extract a zone from a clip kdenlive will just try to create a new clip using the same format+encodings as the original imported clip had?

humanbeing wrote:do you really need to transcode that part? maybe all you need is a simple cutout from the original?


I need to be able to edit this footage and that includes extracting zones from individual clips that last for a long time. As long as there is a way for me to be able to do that while having a normal workflow within kdenlive?

humanbeing wrote:what will your delivery container and codecs be? same as in the originals?


No, but at this stage I am not even concerned about rendering options. I am still just trying to edit the footage onto the timeline and need to extract zones from the clips recorded by a Sony camera.

Any guidance would be greatly appreciated, I am sure other folks using Sony cameras have come across MP4 files containing PCM encoded audio and found a way to have kdenlive extract zones from clips?
humanbeing
Registered Member
Posts
48
Karma
0
OS
lmichaels wrote:Is this something I can configure in kdenlive? I have again checked the options under Settings => Configure kdenlive.

use profiles in the Rendering dialog for that. you can create a custom profile if none of the existing ones meets your needs.

lmichaels wrote:I am adding the clips straight from the camera, so I am guessing (perhaps incorrectly) that when I tell it to extract a zone from a clip kdenlive will just try to create a new clip using the same format+encodings as the original imported clip had?

how do you "tell it to extract a zone from a clip"?

lmichaels wrote:No, but at this stage I am not even concerned about rendering options.

well, you'd better be, because every transcoding is time-consuming and leads to losses in quality. if you want to make a video from parts of your footage, then place all that footage onto the timeline, cut it as you wish and do only one rendering [transcoding to your delivery format]. KDENLiVE is not a tool for extracting parts without transcoding [but, for instance, FFMPEG is].

it would help if you tell us more about your goal and steps you want to take to achieve it. and don't be afraid to say silly things because we all do.
lmichaels
Registered Member
Posts
15
Karma
0
In case any other users of Sony cameras that produce MP4 files containing PCM audio find themselves struggling with this, I have figured out how to solve this problem: the solution is simply to remux the video+audio produced by my camera into the .MKV format. No need to transcode the audio into an encoding that is widely accepted inside an MP4 container.

I do it in batch using ffmpeg from the command line, for each file simply:

Code: Select all
ffmpeg -i clip-from-my-camera.mp4 -c copy clip-from-my-camera.mkv


Then I add the .MKV clips to the kdenlive project and no issues at all.
humanbeing
Registered Member
Posts
48
Karma
0
OS
lmichaels wrote:remux the video+audio produced by my camera into the .MKV format. No need to transcode the audio into an encoding that is widely accepted inside an MP4 container ... Then I add the .MKV clips to the kdenlive project and no issues at all.

please mark the thread as solved if you think your problem's gone. however, judging from your own words:
lmichaels wrote:When I import clips into kdenlive, I can play them and add them to the timeline ...

no need to remux into MKV in order to work with them in KDENLiVE. the question is: what are you doing at the rendering step?
lmichaels
Registered Member
Posts
15
Karma
0
humanbeing wrote:however, judging from your own words:
lmichaels wrote:When I import clips into kdenlive, I can play them and add them to the timeline ...

no need to remux into MKV in order to work with them in KDENLiVE. the question is: what are you doing at the rendering step?


There is a need to remux into MKV in order to work with these clips in kdenlive: otherwise, as I described, you cannot use an important feature in kdenlive (extract zone from clip).

As I have written earlier, rendering really has nothing to do with the issue described here.

Thank you for your help. I have marked the thread as resolved because the ffmpeg command listed above easily does the remuxing that is required.
humanbeing
Registered Member
Posts
48
Karma
0
OS
okay, now i see. looks like it was me who kept saying silly things. i didn't know about that feature in KDENLiVE, and its intended purpose is extracting parts of a video without transcoding.

glad you've resolved it in the end.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]