So I have an issue to which I cannot find an answer. I have a video which is 7min 38sec long after concat. When I want to add background audio to this video it cuts off the last 7sec of the original video. I cannot find the reason.
If anyone could help me in any way, it would be amazing because I have been troubleshooting this past 3 days.
My FFmpeg version is ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers.
For concat I use this: FFmpeg -f concat -safe 0 -i txtfile.txt -c copy -ac 2 output.mp4
For adding background audio I use this: ffmpeg -i output.mp4 -i background.mp3 -c:v copy -filter_complex "[0:a]aformat=fltp:44100:stereo,apad[0a];[1]aformat=fltp:44100:stereo,volume=0.2[1a];[0a][1a]amerge[a]" -map 0:v -map "[a]" -ac 2 -shortest output_with_background.mp4
And the console output while doing its stuff is:
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200523
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0000024baee72440] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'C:\Users\shooey\Desktop\junky\Content\07-04-2021\videos.txt':
Duration: N/A, start: -0.023220, bitrate: 18916 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 18861 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, fltp, 54 kb/s
Metadata:
handler_name : SoundHandler
File 'C:\Users\shooey\Desktop\junky\Content\07-04-2021\output.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'C:\Users\shooey\Desktop\junky\Content\07-04-2021\output.mp4':
Metadata:
encoder : Lavf58.29.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 18861 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, fltp, 54 kb/s
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 # 0000024baee72440] Auto-inserting h264_mp4toannexb bitstream filter
Last message repeated 5 times
[mov,mp4,m4a,3gp,3g2,mj2 # 0000024baeeec180] Auto-inserting h264_mp4toannexb bitstream filter
[mov,mp4,m4a,3gp,3g2,mj2 # 0000024baee72440] Auto-inserting h264_mp4toannexb bitstream filter
Last message repeated 14 times
[mov,mp4,m4a,3gp,3g2,mj2 # 0000024baee72440] Auto-inserting h264_mp4toannexb bitstream filter
Last message repeated 20 times
[mov,mp4,m4a,3gp,3g2,mj2 # 0000024baee72440] Auto-inserting h264_mp4toannexb bitstream filter
Last message repeated 7 times
frame= 52 fps= 42 q=-1.0 Lsize= 7838kB time=00:07:38.82 bitrate= 139.9kbits/s speed= 374x
video:4802kB audio:2956kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.044608%
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9.3.1 (GCC) 20200523
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\shooey\Desktop\junky\Content\07-04-2021\output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:07:38.85, start: 0.000000, bitrate: 139 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 87 kb/s, 0.12 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 52 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mp3, from 'C:\Users\shooey\Desktop\junky\Content\assets\background.mp3':
Metadata:
major_brand : dash
Software : Lavf57.56.101
minor_version : 0
compatible_brands: iso6mp41
Duration: 00:20:03.02, start: 0.025057, bitrate: 167 kb/s
Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 167 kb/s
Metadata:
encoder : LAME3.100
File 'C:\Users\shooey\Desktop\junky\Content\07-04-2021\output_bckg.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:1 (aac) -> aformat
Stream #1:0 (mp3float) -> aformat
Stream #0:0 -> #0:0 (copy)
amerge -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[Parsed_amerge_4 # 0000017093965c80] No channel layout for input 1
[Parsed_amerge_4 # 0000017093965c80] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
Output #0, mp4, to 'C:\Users\shooey\Desktop\junky\Content\07-04-2021\output_bckg.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 87 kb/s, 0.12 fps, 30 tbr, 15360 tbn, 15360 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc58.54.100 aac
frame= 52 fps=5.5 q=-1.0 Lsize= 11993kB time=00:07:31.67 bitrate= 217.5kbits/s speed= 48x
video:4802kB audio:7111kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.670061%
[aac # 00000170935b4980] Qavg: 319.394
I think I found the answer by myself. I took the background.mp3 which I wanted to add and made it into a .aac audio file. After that I used the same command for adding audio but instead of -shortest I used -t 00:07:38 because it was the length of the video and I found that FFmpeg has a hard time recognizing the boundaries in videos.
Related
I Change the audio Mode in VLC from Stereo to Mono then the Audio will play Normal
I used ffmpeg to convert the audio to Stereo using this
ffmpeg -i bokan_test_1.mkv -map 0 -map -0:s? -c:v copy -c:a ac3 -ac 2 -b:a 640k "E:\Test\output.S01E05.mkv"
I even used Handbrake still No audio in VLC unless I change the audio mode to Mono
Edit:
full log when running the ffmpeg command above
E:\test audio>ffmpeg -i bokan_test_1.mkv -map 0 -map -0:s? -c:v copy -c:a ac3 -ac 2 -b:a 640k "E:\Test\output.S01E06.mkv"
ffmpeg version 4.3.1-2021-01-01-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Input #0, matroska,webm, from 'bokan_test_1.mkv':
Metadata:
encoder : libebml v1.3.0 + libmatroska v1.4.0
creation_time : 2015-07-27T22:38:36.000000Z
Duration: 00:20:01.02, start: 0.000000, bitrate: 3497 kb/s
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1440x1080, SAR 1:1 DAR 4:3, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
Stream #0:1(ara): Audio: aac (HE-AAC), 44100 Hz, stereo, fltp (default)
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac (native) -> ac3 (native))
Press [q] to stop, [?] for help
Output #0, matroska, to 'E:\Azmi\output.S01E06.mkv':
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 1440x1080 [SAR 1:1 DAR 4:3], q=2-31, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default)
Stream #0:1(ara): Audio: ac3 ([0] [0][0] / 0x2000), 44100 Hz, stereo, fltp, 640 kb/s (default)
Metadata:
encoder : Lavc58.91.100 ac3
frame=35994 fps=5263 q=-1.0 Lsize= 595496kB time=00:20:01.03 bitrate=4061.8kbits/s speed= 176x
video:501161kB audio:93829kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.085007%
I'm trying to generate audio waveform from an mp4 file as described here: https://github.com/bbc/audiowaveform.
My mp4 file looks like
<?xml version="1.0" encoding="UTF-8"?>
http://www.w3.org/2001/XMLSchema-instance'>
<format filename="/cache/1268.mp4" nb_streams="4" nb_programs="0" format_name="mov,mp4,m4a,3gp,3g2,mj2" format_long_name="QuickTime / MOV" start_time="0.000000" duration="40.112000" size="10610125" bit_rate="2116099" probe_score="100">
<tag key="major_brand" value="isom"/>
<tag key="minor_version" value="512"/>
<tag key="compatible_brands" value="isomiso2avc1mp41"/>
<tag key="encoder" value="Lavf58.20.100"/>
</format>
I wrote this command line:
/ffmpeg-4.1.1/ffmpeg -i /cache/1268.mp4 -map 0:1 -f wav - | /opt/audiowaveform/audiowaveform --input-format wav --pixels-per-second 25 -b 16
But it fails with the folliwing error:
Could not write header for output file #0 (incorrect codec parameters ?): Broken pipe
Error initializing output stream 0:0 --
Conversion failed!
Complete log is:
ffmpeg version 4.2.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Error: unrecognised option '--input-format'
See '/opt/audiowaveform/audiowaveform --help' for available options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/cache/1268.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Big Buck Bunny - test 8
encoder : Lavf57.72.101
comment : Matroska Validation File 8, secondary audio commentary track, misc subtitle tracks
Duration: 00:00:46.07, start: 0.000000, bitrate: 2111 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1024x576 [SAR 1:1 DAR 16:9], 1908 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 67 kb/s
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Could not write header for output file #0 (incorrect codec parameters ?): Broken pipe
Error initializing output stream 0:0 --
Conversion failed!
Can anyone help me?
Note: I read the answer here ffmpeg Could not write header for output file #0 but I need to preserve audio codec.
I am converting multiple mp4 video to ts and then stitching it together.
But this sometimes causes audio issues on my videos where the audio sounds like it was recorded with two mics at the same time causing loud sound.
I can only reproduce it sometimes and I am still not sure why it's doing that? Can anyone help?
Here is how I am converting to ts from mp4. I have noticed that the longer the video gets, the audio gets worse and its also off by a couple of seconds.
ffmpeg -i video1.mp4 -f lavfi -i anullsrc=channel_layout=mono:sample_rate=48000 -shortest -c copy -bsf:v h264_mp4toannexb -c:a aac video1.ts
ffmpeg -i video2.mp4 -f lavfi -i anullsrc=channel_layout=mono:sample_rate=48000 -shortest -c copy -bsf:v h264_mp4toannexb -c:a aac video2.ts
ffmpeg -i video3.mp4 -f lavfi -i anullsrc=channel_layout=mono:sample_rate=48000 -shortest -c copy -bsf:v h264_mp4toannexb -c:a aac video3.ts
and then I save these paths to a txt and call my stitching command like this
ffmpeg -f concat -safe 0 -i list.txt -c copy -bsf:a aac_adtstoasc finalvideo.mp4
Here is the complete output of the 4 videos
C:\Users\Alan\Desktop\videos>ffmpeg -i video1.mp4 -i video2.mp4 -i video3.mp4 -i video4.mp4
ffmpeg version N-90433-g5b31dd1c6b Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 12.100 / 56. 12.100
libavcodec 58. 15.100 / 58. 15.100
libavformat 58. 10.100 / 58. 10.100
libavdevice 58. 2.100 / 58. 2.100
libavfilter 7. 13.100 / 7. 13.100
libswscale 5. 0.102 / 5. 0.102
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video1.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.71.100
Duration: 00:00:10.80, start: 0.000000, bitrate: 1034 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 879 kb/s, 4.17 fps, 4.17 tbr, 12800 tbn, 8.33 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 165 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'video2.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.71.100
Duration: 00:00:01.62, start: 0.000000, bitrate: 3208 kb/s
Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 3203 kb/s, 16.67 fps, 16.67 tbr, 12800 tbn, 33.33 tbc (default)
Metadata:
handler_name : VideoHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'video3.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.71.100
Duration: 00:00:05.58, start: 0.000000, bitrate: 1954 kb/s
Stream #2:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1805 kb/s, 16.67 fps, 16.67 tbr, 12800 tbn, 33.33 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 166 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'video4.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.71.100
Duration: 00:00:03.90, start: 0.000000, bitrate: 1746 kb/s
Stream #3:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1744 kb/s, 16.67 fps, 16.67 tbr, 12800 tbn, 33.33 tbc (default)
Metadata:
handler_name : VideoHandler
So I am certainly no expert when it comes to either of these tools, but I have a web-based project that's executing commands on an Amazon Linux server to concatenate two video files that are uploaded.
Both files are converted to mp4s first using FFMPEG, and those play perfectly in a browser after conversion:
ffmpeg -i file1.mpg -c:v libx264 -crf 22 -c:a aac -strict -2 -movflags faststart file2.mp4
Then, I attempt to combine these two resulting mp4s into a single mp4. I tried using FFMPEG to do this but to no avail. Switching to try MP4Box got me much closer: the videos are concatenated together, but the audio stops playing at the end of the first clip, and the second clip is silent.
MP4Box -force-cat -keepsys -add file.mp4 -cat file2.mp4 out.mp4
I've tried varying versions of the above command with no better results. Any input is greatly appreciated.
EDIT: info on .mp4 files using
ffmpeg -i file1.mp4 -i file2.mp4
ffmpeg -i 1510189259715DogRunsintoGlassDoor_315a03a8e20acfc.mp4 -i
1510189273549NewhouseMoonMoonneverseenstairsbeforefunnydog_285a03a8e6aab25.mp4
ffmpeg version N-61041-g52a2138 Copyright (c) 2000-2014 the FFmpeg
developers
built on Mar 2 2014 05:45:04 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/64bit
--extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'1510189259715DogRunsintoGlassDoor_315a03a8e20acfc.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.33.100
Duration: 00:00:04.92, start: 0.023220, bitrate: 634 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
360x360 [SAR 1:1 DAR 1:1], 501 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
(default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono,
fltp, 132 kb/s (default)
Metadata:
handler_name : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from
'1510189273549NewhouseMoonMoonneverseenstairsbeforefunnydog_285a03a8e6aab25.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.33.100
Duration: 00:00:18.79, start: 0.023220, bitrate: 455 kb/s
Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
362x360 [SAR 1:1 DAR 181:180], 320 kb/s, 29.94 fps, 29.94 tbr, 11976
tbn, 59.88 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo,
fltp, 129 kb/s (default)
Metadata:
handler_name : SoundHandler
At least one output file must be specified
I am using a command found on SO to convert from MOV to the intermediate format. The reason for this middle step is to be able to concatenate a series of MOV files.
For some reason, when I run the following command:
ffmpeg -i source.mov -c copy -bsf:v h264_mp4toannexb -f mpegts dest.ts
I lose the audio.
I tried adding -bsf:s pcm_s16le but that did not change an iota.
Here is the output
ffmpeg version N-74313-g9c0407e Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 30.100 / 54. 30.100
libavcodec 56. 57.100 / 56. 57.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 32.100 / 5. 32.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'source.mov':
Metadata:
major_brand : qt
minor_version : 537331968
compatible_brands: qt niko
creation_time : 2015-12-29 20:27:21
Duration: 00:00:47.28, start: 0.000000, bitrate: 22117 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, smpte170m/bt709/bt470m), 1920x1080 [SAR 1:1 DAR 16:9], 20535 kb/s, 25 fps, 25 tbr, 25
k tbn, 50 tbc (default)
Metadata:
creation_time : 2015-12-29 20:27:21
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
Metadata:
creation_time : 2015-12-29 20:27:21
File 'dest.ts' already exists. Overwrite ? [y/N] y
Output #0, mpegts, to 'dest.ts':
Metadata:
major_brand : qt
minor_version : 537331968
compatible_brands: qt niko
encoder : Lavf56.40.101
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuvj420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 20535 kb/s, 25 fps, 25 tbr, 90k tbn, 25k tbc (default)
Metadata:
creation_time : 2015-12-29 20:27:21
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, 1536 kb/s (default)
Metadata:
creation_time : 2015-12-29 20:27:21
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1182 fps=1139 q=-1.0 Lsize= 137797kB time=00:00:47.28 bitrate=23875.6kbits/s
video:118525kB audio:8865kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.169999%
From the output, it does look like I copied both the video stream and the audio stream. So what seems to be the trouble?