Skip to content

Merging one video taken with the camera api with one obtained from an image using ffmpeg #476

@daniela-mateescu

Description

@daniela-mateescu

Hello,

I need to merge one video obtained using the camera api (without any additional processing) and a video obtain by converting an image to a video using ffmpegkit with the following parameters:

-loop 1 -i input_image.jpg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -c:v libx264 -profile:v baseline -preset medium -level 4.0 -tune film -bf 0 -refs 1 -x264-params \"no-cabac=1:keyint=25:ref=1\" -t 5 -pix_fmt yuv420p -vf \"scale=1280:720\"  -r 30 -y -c:a aac -b:a 192k -shortest output_video.mp4`

I am getting the error:

java.io.IOException: Cannot merge VisualSampleEntry[AvcConfigurationBox{avcDecoderConfigurationRecord=AvcDecoderConfigurationRecord{configurationVersion=1, avcProfileIndication=66, profileCompatibility=128, avcLevelIndication=40, lengthSizeMinusOne=3, hasExts=false, chromaFormat=-1, bitDepthLumaMinus8=-1, bitDepthChromaMinus8=-1, lengthSizeMinusOnePaddingBits=63, numberOfSequenceParameterSetsPaddingBits=7, chromaFormatPaddingBits=31, bitDepthLumaMinus8PaddingBits=31, bitDepthChromaMinus8PaddingBits=31}};com.coremedia.iso.boxes.UnknownBox@72859b] and VisualSampleEntry[AvcConfigurationBox{avcDecoderConfigurationRecord=AvcDecoderConfigurationRecord{configurationVersion=1, avcProfileIndication=66, profileCompatibility=192, avcLevelIndication=40, lengthSizeMinusOne=3, hasExts=false, chromaFormat=-1, bitDepthLumaMinus8=-1, bitDepthChromaMinus8=-1, lengthSizeMinusOnePaddingBits=63, numberOfSequenceParameterSetsPaddingBits=7, chromaFormatPaddingBits=31, bitDepthLumaMinus8PaddingBits=31, bitDepthChromaMinus8PaddingBits=31}};com.mp4parser.iso14496.part12.BitRateBox@65a4d38]
2024-09-20 19:26:26.754 12863-12863 System.err              com...ple.famiprogscenariosmakerapp  W  	at com.googlecode.mp4parser.authoring.tracks.AppendTrack.mergeStsds(AppendTrack.java:95)
2024-09-20 19:26:26.754 12863-12863 System.err              com...ple.famiprogscenariosmakerapp  W  	at com.googlecode.mp4parser.authoring.tracks.AppendTrack.<init>(AppendTrack.java:65)

So the two debugging indications looks like this
1.

VisualSampleEntry[AvcConfigurationBox{avcDecoderConfigurationRecord=AvcDecoderConfigurationRecord{configurationVersion=1,
 avcProfileIndication=66, profileCompatibility=128, avcLevelIndication=40, 
lengthSizeMinusOne=3, hasExts=false, chromaFormat=-1, bitDepthLumaMinus8=-1, 
bitDepthChromaMinus8=-1, lengthSizeMinusOnePaddingBits=63, 
numberOfSequenceParameterSetsPaddingBits=7, chromaFormatPaddingBits=31, 
bitDepthLumaMinus8PaddingBits=31, 
bitDepthChromaMinus8PaddingBits=31}};com.coremedia.iso.boxes.UnknownBox@77f1ce6]
VisualSampleEntry[AvcConfigurationBox{avcDecoderConfigurationRecord=AvcDecoderConfigurationRecord{configurationVersion=1, 
avcProfileIndication=66, profileCompatibility=192, avcLevelIndication=40, 
lengthSizeMinusOne=3, hasExts=false, chromaFormat=-1, bitDepthLumaMinus8=-1, 
bitDepthChromaMinus8=-1, lengthSizeMinusOnePaddingBits=63, 
numberOfSequenceParameterSetsPaddingBits=7, chromaFormatPaddingBits=31, 
bitDepthLumaMinus8PaddingBits=31, 
bitDepthChromaMinus8PaddingBits=31}};com.mp4parser.iso14496.part12.BitRateBox@bd19227]

As you can see in my ffmpegkit command I tried to customize it in order for the parameters to be the same. The only thing that is different is the profileCompatibility: 128 vs 192, that I couldn't change via ffmpegkit settings

Can you please help me with this problem that i am having?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions