[FFmpeg-user] Noticed TimeStamp Issue When Muxing Raw h.264 into MKV

luke wilson lukec.wilson86 at gmail.com
Wed Feb 29 22:56:12 CET 2012


Seems to work for mp4. Sorry if I'm wasting time here just trying to be
helpful

Here are the simple arguments I put it:

>ffmpeg -i BitRate7781.h264 -vcodec copy -y BitRateMKV.mkv
ffmpeg version N-36867-g5fc51c3 Copyright (c) 2000-2012 the FFmpeg
developers
  built on Jan 17 2012 12:52:59 with gcc 4.6.1
  configuration: --enable-libvo-aacenc --enable-libx264 --disable-ffplay
--disab
le-ffprobe --disable-ffserver --enable-gpl --enable-version3
--enable-memalign-h
ack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32-
--enable-cro
ss-compile --extra-ldflags=-L/usr/local/lib
--extra-cflags=-I/usr/local/include
  libavutil      51. 34.100 / 51. 34.100
  libavcodec     53. 55.105 / 53. 55.105
  libavformat    53. 29.100 / 53. 29.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 59.100 /  2. 59.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    51.  2.100 / 51.  2.100
[h264 @ 01659720] max_analyze_duration 5000000 reached at 5005000
[h264 @ 01659720] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from 'BitRate7781.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9],
23.9
8 fps, 23.98 tbr, 1200k tbn, 47.95 tbc
Output #0, matroska, to 'BitRateMKV.mkv':
  Metadata:
    encoder         : Lavf53.29.100
    Stream #0:0: Video: h264, yuv420p, 1920x1080 [SAR 1:1 DAR 16:9],
q=2-31, 23.
98 fps, 1k tbn, 1200k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[matroska @ 02D86340] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument

On Wed, Feb 29, 2012 at 4:48 PM, Andrey Utkin <
andrey.krieger.utkin at gmail.com> wrote:

> среда, 29 февраля 2012 г. пользователь luke wilson <
> lukec.wilson86 at gmail.com>
> писал:
> > To Whomever,
> >
> > I hope I'm in the right place with this. Anyway I noticed that you can
> not
> > mux a raw h.264 streams into MKV because of the lack of a TimeStamp.
> > Correct me if I'm wrong but I believe this error(see error below) is due
> to
> > raw h.264 streams not containing any specific timestamp information.
> >  If this is the case I believe I have a proof of concept for creating
> > timestamps
> >  data for a MKV mux.
> >
> > Proof Of Concept:
> > 1. Get FPS from (Annex E) VUI   FPS = time_scale / num_unit_in_tick * 2
> >    (I know this isn't perfect but it gets it close enough)
> > 2. Take stream within each given cluster in MKV and count frames
> >    (There are a few variations)
> > 3. Create a TimeStamp for Segments based on frame count against FPS
> >
> > I don't think this is a perfect science but if you use libx264 and ffmpeg
> to
> > encode the raw h264 file I think it should be close enough that playback
> > on directshow will not be the wiser (it works for me). I think you might
> > be doing something like this for mp4 muxing.
> >
> > Please let me know if I am misunderstanding something. If I'm not mis-
> > understanding something let me know if you would like me to build this
> out
> > for the community. FFMPEG has helped me out a lot so I would like to
> > give back to the community if possible.
> >
> > Error:
> > "[matroska @ 01386340] Can't write packet with unknown timestamp
> > av_interleaved_write_frame(): Invalid argument"
> >
> > -Luke
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
>
>
> Full uncut commandline and output are missing.
>
> --
> Andrey Utkin
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list