Open eplipswich opened 6 years ago
I really don't know, 😞. FFmpeg is being stupid ðŸ˜
This is what the Cmd looks like now:
> ffmpeg -f concat -safe 0 -i "path\to\chunklist.txt" -i "path\to\mixdown.aud" -c copy -map 0:v:0 -map 1:a:0 -t 00:03:28 "path\to\output.vid" -y
I tested AVI w/ Ac3 and it worked, I know Mp4 is more selective in what audio you can use w/ it, but I pretty sure AAC is one of them
For the time being, try using vid. conteiners like MKV and AVI.
Even when I specified the correct audio codec w/ -c:a aac
it still failed w/ the same error
Adding -strict -2
WILL work, but I don't know what those experimental open up to exactly. Could lead to even more unexpected behavior 😟
Why not use -map 0:v -map 1:a
instead of -map 0:v:0 -map 1:a:0
? That could work (I used -map 0:v -map 1:a
before and it worked perfect) . Like maybe use the same code as without mixdown audio.
I’ll try to test it out again on my side as well just to confirm.
Yeah, I tested with -map 0:v -map 1:a
and it works perfect. The only other diff is that I put it in this order:
-map 0:v -map 1:a -c copy
and not the other way round like in your code.
Can you change it to that? Thanks :)
Nope, tested MP4 + AAC, same error
DEBUG|ConcatCmd: cmd:> ffmpeg -f concat -safe 0 -i "E:\Bibliotecas E\_projetos\Blender\Video\render\tests\chunks\chunklist.txt" -i "E:\Bibliotecas E\_projetos\Blender\Video\render\tests\test project2.aac" -map 0:v -map 1:a -c copy -t 00:03:28 "E:\Bibliotecas E\_projetos\Blender\Video\render\tests\test project2.mp4" -y
DEBUG|ConcatCmd: ffmpeg exit code: 1
besides, I'm pretty sure -map 0:v -map 1:a
is just shorthand for -map 0:v:0 -map 1:a:0
Can you post what your successful test looked like?
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --e
nable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libblur
ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enab
le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-li
bvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --en
able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enabl
e-libspeex --enable-libxvid --enable-libmfx --enable-cuda --enable-cuvid --enabl
e-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000000f9800] Auto-inserting h264_mp4toannexb bit
stream filter
Input #0, concat, from 'chunklist.txt':
Duration: N/A, start: 0.000000, bitrate: 2804 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1364x768,
2483 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 320 kb/s
Metadata:
handler_name : SoundHandler
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from 'test.wav':
Duration: 00:00:22.03, bitrate: 1411 kb/s
Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16
, 1411 kb/s
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf57.83.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1364x768,
q=2-31, 2483 kb/s, 30 fps, 30 tbr, 15360 tbn, 15360 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16
, 1411 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 440 fps=0.0 q=-1.0 Lsize= 8256kB time=00:00:22.01 bitrate=3072.4kbits
/s speed= 242x
video:4446kB audio:3795kB subtitle:0kB other streams:0kB global headers:0kB muxi
ng overhead: 0.178125%
This was using the code ffmpeg -f concat -safe 0 -i chunklist.txt -i test.wav -map 0:v -map 1:a -c copy output.mp4
I'll test out aac in a bit.
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --e
nable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libblur
ay --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-
libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enab
le-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-li
bvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --en
able-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-
libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enabl
e-libspeex --enable-libxvid --enable-libmfx --enable-cuda --enable-cuvid --enabl
e-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000459800] Auto-inserting h264_mp4toannexb bit
stream filter
Input #0, concat, from 'chunklist.txt':
Duration: N/A, start: 0.000000, bitrate: 2804 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1364x768,
2483 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 320 kb/s
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'test2.aac':
Metadata:
major_brand : M4A
minor_version : 512
compatible_brands: isomiso2
encoder : Lavf55.33.100
Duration: 00:00:22.07, start: 0.000000, bitrate: 197 kb/s
Stream #1:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 195 kb/s (default)
Metadata:
handler_name : SoundHandler
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf57.83.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1364x768,
q=2-31, 2483 kb/s, 30 fps, 30 tbr, 15360 tbn, 15360 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 195 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 440 fps=0.0 q=-1.0 Lsize= 4992kB time=00:00:22.05 bitrate=1853.9kbits
/s speed= 613x
video:4446kB audio:528kB subtitle:0kB other streams:0kB global headers:0kB muxin
g overhead: 0.371739%
This was with aac.
So, just to revisit this issue, I think this is the solution:
ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a copy -map 0:v:0 -map 1:a:0 output.mp4
From https://superuser.com/questions/277642/how-to-merge-audio-and-video-file-in-ffmpeg
The key probably lies in -c:v and -c:a.
This is the issue that I get from Joining Chunks with Mixdown Audio:
I believe the error in particular is this:
Input #1, flac, from 'E:\Videos\New folder\untitled.aac':
Why does it use flac when I clearly chose aac?? The flac issue applies to any other video that I join chunks with mixdown audio for some reason (regardless of which video and audio formats I choose).