I have a program that runs FFMPEG to stream video files to my TiVo.
Sometimes a video file will not transfer because no streams get selected to
copy. The metadata looks like it should work to me. I use the same command
for each file other than the input file name. Can someone explain how I can
get it to include the Audio and Video stream without hard coding the stream
numbers, which obviously can change between files?
Here's example output from a successful conversion and a failing conversion:
C:\Users\Wim>C:\WINDOWS\ffmpeg.exe -hide_banner -i Success.mkv -map 0:d?
-vcodec copy -bsf:v h264_mp4toannexb -b:v 30000k -maxrate 30000k -bufsize
8192k -acodec ac3 -b:a 448k -ar 48000 -f mpegts -y test.mpegts
Input #0, matroska,webm, from 'Success.mkv':
Metadata:
encoder : libebml v1.4.5 + libmatroska v1.7.1
creation_time : 2026-05-23T18:02:18.000000Z
Duration: 00:25:18.01, start: 0.000000, bitrate: 8446 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive),
1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 1k tbn, start 0.004000
(default)
Metadata:
BPS : 8250568
DURATION : 00:25:18.001000000
NUMBER_OF_FRAMES: 75900
NUMBER_OF_BYTES : 1565546401
_STATISTICS_WRITING_APP: mkvmerge v98.0 ('Chonks') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2026-05-23 18:02:18
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: eac3, 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
BPS : 191991
DURATION : 00:25:17.920000000
NUMBER_OF_FRAMES: 47433
NUMBER_OF_BYTES : 36428544
_STATISTICS_WRITING_APP: mkvmerge v98.0 ('Chonks') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2026-05-23 18:02:18
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (eac3 (native) -> ac3 (native))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'test.mpegts':
Metadata:
encoder : Lavf62.13.101
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive),
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 30000 kb/s, 50 fps, 50 tbr, 90k tbn
(default)
Metadata:
BPS : 8250568
DURATION : 00:25:18.001000000
NUMBER_OF_FRAMES: 75900
NUMBER_OF_BYTES : 1565546401
_STATISTICS_WRITING_APP: mkvmerge v98.0 ('Chonks') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2026-05-23 18:02:18
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 448 kb/s (default)
Metadata:
encoder : Lavc62.29.100 ac3
BPS : 191991
DURATION : 00:25:17.920000000
NUMBER_OF_FRAMES: 47433
NUMBER_OF_BYTES : 36428544
_STATISTICS_WRITING_APP: mkvmerge v98.0 ('Chonks') 64-bit
_STATISTICS_WRITING_DATE_UTC: 2026-05-23 18:02:18
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[af#0:1 @ 00000247be2ea9c0] Reconfiguring filter graph because audio
parameters changed to 48000 Hz, 5.1(side), fltp, downmix medatata changed
[vost#0:0/copy @ 00000247bced0a80] Invalid DTS: 50760 PTS: 47160, replacing
by guess
[vost#0:0/copy @ 00000247bced0a80] Non-monotonic DTS; previous: 48961,
current: 47160; changing to 48962. This may result in incorrect timestamps
in the output file.
[out#0/mpegts @ 00000247bcf5ea00] video:1528705KiB audio:83008KiB
subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead:
3.264436%
frame=75900 fps=1659 q=-1.0 Lsize= 1664326KiB time=00:25:17.98
bitrate=8981.7kbits/s speed=33.2x elapsed=0:00:45.74
C:\Users\Wim>C:\WINDOWS\ffmpeg.exe -hide_banner -i Failure.mp4 -map 0:d?
-vcodec copy -bsf:v h264_mp4toannexb -b:v 30000k -maxrate 30000k -bufsize
8192k -acodec ac3 -b:a 448k -ar 48000 -f mpegts -y test.mpegts
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Failure.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf62.12.100
Duration: 01:21:10.27, start: 0.000000, bitrate: 8256 kb/s
Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661),
yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 7995 kb/s,
50 fps, 50 tbr, 50k tbn, start 0.286000 (default)
Metadata:
handler_name : ?Apple Video Media Handler
encoder : H264/AVC
timecode : 00:00:00:00
Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 249 kb/s (default)
Metadata:
handler_name : ?Apple Sound Media Handler
Stream #0:2[0x3](eng): Data: none (tmcd / 0x64636D74)
Metadata:
handler_name : ?Apple Video Media Handler
timecode : 00:00:00:00
[out#0/mpegts @ 000001e4e8b315c0] Codec AVOption b:v (set bitrate (in
bits/s)) has not been used for any stream. The most likely reason is either
wrong type (e.g. a video option with no video streams) or that it is a
private option of some decoder which was not actually used for any stream.
[out#0/mpegts @ 000001e4e8b315c0] Codec AVOption b:a (set bitrate (in
bits/s)) has not been used for any stream. The most likely reason is either
wrong type (e.g. a video option with no video streams) or that it is a
private option of some decoder which was not actually used for any stream.
Stream mapping:
Stream #0:2 -> #0:0 (copy)
Output #0, mpegts, to 'test.mpegts':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf62.13.101
Stream #0:0(eng): Data: none (tmcd / 0x64636D74)
Metadata:
handler_name : ?Apple Video Media Handler
timecode : 00:00:00:00
Press [q] to stop, [?] for help
[mpegts @ 000001e4e8b316c0] Stream 0, codec none, is muxed as a private
data stream and may not be recognized upon reading.
[out#0/mpegts @ 000001e4e8b315c0] video:0KiB audio:0KiB subtitle:0KiB other
streams:0KiB global headers:0KiB muxing overhead: 18700.000000%
size= 1KiB time=01:21:10.00 bitrate= 0.0kbits/s speed=3.01e+05x
elapsed=0:00:00.01
C:\Users\Wim>ffmpeg -?
ffmpeg version 2026-03-15-git-6ba0b59d8b-full_build-www.gyan.dev Copyright
(c) 2000-2026 the FFmpeg developers
built with gcc 15.2.0 (Rev11, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-cairo
--enable-fontconfig --enable-iconv --enable-gnutls --enable-lcms2
--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-libdvdnav --enable-libdvdread --enable-sdl2
--enable-libaribb24 --enable-libaribcaption --enable-libdav1d
--enable-libdavs2 --enable-libopenjpeg --enable-libquirc --enable-libuavs3d
--enable-libxevd --enable-libzvbi --enable-liboapv --enable-libqrencode
--enable-librav1e --enable-libsvtav1 --enable-libvvenc --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve
--enable-libxvid --enable-libaom --enable-libjxl --enable-libsvtjpegxs
--enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r
--enable-libfreetype --enable-libfribidi --enable-libharfbuzz
--enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg
--enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2
--enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl
--enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc
--enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio
--enable-openal --enable-libgme --enable-libmodplug --enable-libopenmpt
--enable-libopencore-amrwb --enable-libmp3lame --enable-libshine
--enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc
--enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3
--enable-libopencore-amrnb --enable-libopus --enable-libspeex
--enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite
--enable-libmysofa --enable-librubberband --enable-libsoxr
--enable-chromaprint --enable-whisper
libavutil 60. 29.100 / 60. 29.100
libavcodec 62. 29.100 / 62. 29.100
libavformat 62. 13.101 / 62. 13.101
libavdevice 62. 4.100 / 62. 4.100
libavfilter 11. 15.101 / 11. 15.101
libswscale 9. 7.100 / 9. 7.100
libswresample 6. 4.100 / 6. 4.100
Universal media converter
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options]
outfile}...
_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]