Use FFMPEG to convert MP4/AAC to MP3 without audio time getting shortened - audio

I've been struggling with extracting the audio from a couple of mp4 files I have. I have tried using all of the different answers posted previously on Stack Overflow, but each of them results in an mp3 file that's shorter than the original mp4.
If anyone has any insights as to what I'm doing wrong, that'd be greatly appreciated, or at the very least why it's not this simple to convert from mp4 to mp3.
I have tried copying the codec and using variable bitrate. The input video is 1:24:56, but the output audio is 1:24:46.
Command: ffmpeg -i sample.mp4 -c:v copy -q:a 0 sample.mp3
Output:
$ffmpeg -i sample.mp4 -c:v copy -q:a 0 sample.mp3
ffmpeg version 2023-01-09-git-13d04e30d7-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.1.0 (Rev2, 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-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 57. 43.100 / 57. 43.100
libavcodec 59. 56.100 / 59. 56.100
libavformat 59. 34.102 / 59. 34.102
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 53.100 / 8. 53.100
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
libpostproc 56. 7.100 / 56. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sample.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.83.100
Duration: 01:24:56.57, start: 0.000000, bitrate: 612 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 480 kb/s, 29.94 fps, 30 tbr, 90k tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:1 -> #0:0 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'sample.mp3':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
TSSE : Lavf59.34.102
Stream #0:0(und): Audio: mp3, 44100 Hz, stereo, fltp (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
encoder : Lavc59.56.100 libmp3lame
size= 88336kB time=01:24:56.54 bitrate= 142.0kbits/s speed= 172x
video:0kB audio:88336kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000394%

Related

FFmpeg 5: How to add cover art to m4a file

I've tried
ffmpeg -i input.m4a -i image.jpg -map 0 -map 1 -c copy -disposition:v:1 attached_pic output.m4a
from this answer FFmpeg, how to embed cover art (image) to .m4a
but that does not seem to work correctly, giving me output as below:
ffmpeg version 5.0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with Apple clang version 13.1.6 (clang-1316.0.21.2)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
libavutil 57. 17.100 / 57. 17.100
libavcodec 59. 18.100 / 59. 18.100
libavformat 59. 16.100 / 59. 16.100
libavdevice 59. 4.100 / 59. 4.100
libavfilter 8. 24.100 / 8. 24.100
libswscale 6. 4.100 / 6. 4.100
libswresample 4. 3.100 / 4. 3.100
libpostproc 56. 3.100 / 56. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/username/Desktop/output.m4a':
Metadata:
major_brand : M4A
minor_version : 512
compatible_brands: M4A isomiso2
encoder : Lavf59.16.100
Duration: 00:00:03.69, start: 0.000000, bitrate: 131 kb/s
Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Input #1, image2, from '/Users/username/Pictures/image.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 14753 kb/s
Stream #1:0: Video: mjpeg (Progressive), yuvj420p(pc, bt470bg/unknown/unknown), 947x960 [SAR 1:1 DAR 947:960], 25 fps, 25 tbr, 25 tbn
[ipod # 0x14df051e0] Could not find tag for codec mjpeg in stream #1, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:1 --
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Last message repeated 1 times

ffmpeg issue after adding background audio

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.

Even after converting the Audio from Mono to Stereo in ffmpeg the video still has No sound Unless

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%

Extract the time of the video with ffmpeg in Ubuntu

I am using Ubuntu 14.04.5 LTS 32 bit and ffmpeg to extract the time of a video.
In Windows 10 the command works:
/usr/bin/ffmpeg -i video.mp4 -vstats 2> & 1
In Linux ffmpeg returns the error in red:
At least one output file must be specified
The error complete is here:
ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened
--extra-cflags= --extra-cxxflags= --libdir=/usr/lib/i386-linux-gnu --shlibdir=/usr/lib/i386-linux-gnu --incdir=/
usr/include/i386-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample
--enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray
--enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus
--enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh
--enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883
--enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal
--enable-libopencv
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp41isom
creation_time : 2017-01-29 15:42:02
location : -21.6646-46.7394/
location-eng : -21.6646-46.7394/
Duration: 00:01:49.43, start: 0.000000, bitrate: 1171 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 640x360 [SAR 1:1 DAR 16:9], 992 kb/s,
15.01 fps, 15 tbr, 30k tbn, 60 tbc (default)
Metadata:
creation_time : 2017-01-29 15:42:02
handler_name : VideoHandler
encoder : AVC Coding
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 174 kb/s (default)
Metadata:
creation_time : 2017-01-29 15:42:02
handler_name : SoundHandler
At least one output file must be specified
How can I fix this problem?
Use
/usr/bin/ffmpeg -i video.mp4 -vstats -map 0:v -f null - 2>&1
Or you could just use ffprobe
ffprobe -show_entries format=duration -of compact=p=0:nk=1 video.mp4

Using ffmpeg to convert a MOV file from a Nikon 3200D camera into a intermediate (mpegts) format - audio issue

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?

Resources