Opened 6 years ago

Closed 6 years ago

#4699 closed defect (duplicate)

Cannot Muxe Into MKV

Reported by: MysteryX Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
How to reproduce:

% ffmpeg -i "Job1_Video.264" -i "Job1_Source.mp4" -acodec copy -vcodec copy -map 0:v -map 1:a "Job1_Final.mkv"
ffmpeg version N-73361-g03b2b40
built with gcc 4.9.2 (GCC)

FFMPEG fails to merge a H264 stream and an audio into a MKV container. Running the same command with MP4 at the end works, but running it to muxe into MKV fail.

This is a problem because x264.exe only provides outputs in raw H264 format, and it is impossible to muxe it into MKV. I have a previous version of x264.exe that did somehow have MP4 support, and FFMPEG is able to muxe the MP4 and original audio together into MKV. It just fails when the input is raw H264.

It doesn't matter which input file I use, it always fails.

Here's the full console output.

ffmpeg.exe  -i "Job1_Video.264" -i "Job1_Source.mp4" -acodec copy -v
codec copy -map 0:v -map 1:a "Job1_Final.mkv"
ffmpeg version N-73361-g03b2b40 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --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 --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
 --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 46.100 / 56. 46.100
  libavformat    56. 40.100 / 56. 40.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 19.100 /  5. 19.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, h264, from 'Job1_Video.264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p, 320x240, 29.97 fps, 29.97 tbr, 120
0k tbn, 59.94 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'Job1_Source.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.10.100
  Duration: 00:02:59.28, start: 0.000000, bitrate: 1338 kb/s
    Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x480,
1078 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
      handler_name    : VideoHandler
    Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt
p, 253 kb/s (default)
      handler_name    : SoundHandler
File 'Job1_Final.mkv' already exists. Overwrite ? [y/N] y
[matroska @ 054ca080] Codec for stream 0 does not use global headers but contain
er format requires global headers
[matroska @ 054ca080] Codec for stream 1 does not use global headers but contain
er format requires global headers
Output #0, matroska, to 'Job1_Final.mkv':
    encoder         : Lavf56.40.100
    Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 320x240, q=2-31, 29.9
7 fps, 29.97 tbr, 1k tbn, 1200k tbc
    Stream #0:1(und): Audio: aac ([255][0][0][0] / 0x00FF), 44100 Hz, stereo, 25
3 kb/s (default)
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska @ 054ca080] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
[matroska @ 054ca080] Can't write packet with unknown timestamp
frame=    3 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.02 bitrate= 249.4kbits
video:16kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing ov
erhead: unknown
Conversion failed!

Change History (1)

comment:1 by Carl Eugen Hoyos, 6 years ago

Resolution: duplicate
Status: newclosed

Duplicate of ticket #1598.

Note: See TracTickets for help on using tickets.