VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. How to properly mux a Magix Vegas rendered raw AVC stream?

    I rendered an AVC stream from MAGIX Vegas with Magix AVC/AAC - > Blu-ray stream 25fps (plus AC3 stream separately) and I'd like to mux it into a mkv container properly.




    I encountered in the following issues:

    Trying to mux with ffmpeg:

    first try:
    Code:
    ffmpeg -i "InnistradS8_tesztrender.avc" -i "InnistradS8_tesztrender.ac3" -c copy inteszt.mkv
    ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
      built with gcc 10.2.1 (GCC) 20200726
      configuration: --disable-static --enable-shared --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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
      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
    [h264 @ 000001202dd24880] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, h264, from 'InnistradS8_tesztrender.avc':
      Duration: N/A, bitrate: N/A
        Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
    [ac3 @ 000001202e42a900] Estimating duration from bitrate, this may be inaccurate
    Input #1, ac3, from 'InnistradS8_tesztrender.ac3':
      Duration: 00:01:00.03, start: 0.000000, bitrate: 256 kb/s
        Stream #1:0: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
    Output #0, matroska, to 'inteszt.mkv':
      Metadata:
        encoder         : Lavf58.45.100
        Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1k tbn, 1200k tbc
        Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 256 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #1:0 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [matroska @ 000001202e2f00c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
    [matroska @ 000001202e2f00c0] Can't write packet with unknown timestamp
    av_interleaved_write_frame(): Invalid argument
    frame=    1 fps=0.0 q=-1.0 Lsize=       2kB time=00:00:00.00 bitrate=N/A speed=   0x
    video:237kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Conversion failed!
    after googling and trying with flags:
    Code:
    ffmpeg -fflags +genpts -i "InnistradS8_tesztrender.avc" -i "InnistradS8_tesztrender.ac3" -c copy inteszt.mkv
    ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
      built with gcc 10.2.1 (GCC) 20200726
      configuration: --disable-static --enable-shared --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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
      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
    [h264 @ 0000021f79165200] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, h264, from 'InnistradS8_tesztrender.avc':
      Duration: N/A, bitrate: N/A
        Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
    [ac3 @ 0000021f7986a900] Estimating duration from bitrate, this may be inaccurate
    Input #1, ac3, from 'InnistradS8_tesztrender.ac3':
      Duration: 00:01:00.03, start: 0.000000, bitrate: 256 kb/s
        Stream #1:0: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
    Output #0, matroska, to 'inteszt.mkv':
      Metadata:
        encoder         : Lavf58.45.100
        Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 1k tbn, 1200k tbc
        Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 256 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #1:0 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [matroska @ 0000021f7972e700] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
    [matroska @ 0000021f7972e700] Can't write packet with unknown timestamp
    av_interleaved_write_frame(): Invalid argument
    frame=    1 fps=0.0 q=-1.0 Lsize=       2kB time=00:00:00.00 bitrate=N/A speed=   0x
    video:237kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Conversion failed!

    Also tried mkvtoolnix. Playback is flawless, however it gives usable output BUT I find weird things in medainfo:
    Code:
    Format                         : Matroska
    Format version                 : Version 4
    File size                      : 146 MiB
    Duration                       : 1 min 0 s
    Overall bit rate mode          : Constant
    Overall bit rate               : 20.3 Mb/s
    Encoded date                   : UTC 2022-02-09 18:49:47
    Writing application            : mkvmerge v64.0.0 ('Willows') 64-bit
    Writing library                : libebml v1.4.2 + libmatroska v1.6.4
    
    Video
    ID                             : 1
    Format                         : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                 : High@L4.1
    Format settings                : CABAC / 4 Ref Frames
    Format settings, CABAC         : Yes
    Format settings, Reference fra : 4 frames
    Codec ID                       : V_MPEG4/ISO/AVC
    Duration                       : 1 min 0 s
    Bit rate mode                  : Constant
    Bit rate                       : 20.0 Mb/s
    Width                          : 1 920 pixels
    Height                         : 1 080 pixels
    Display aspect ratio           : 16:9
    Frame rate mode                : Variable
    Frame rate                     : 50.000 FPS
    Original frame rate            : 25.000 FPS
    Standard                       : PAL
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Interlaced
    Scan type, store method        : Separated fields
    Scan order                     : Top Field First
    Bits/(Pixel*Frame)             : 0.193
    Stream size                    : 144 MiB (99%)
    Default                        : Yes
    Forced                         : No
    Color range                    : Limited
    Color primaries                : BT.709
    Transfer characteristics       : BT.709
    Matrix coefficients            : BT.709
    
    Audio
    ID                             : 2
    Format                         : AC-3
    Format/Info                    : Audio Coding 3
    Commercial name                : Dolby Digital
    Codec ID                       : A_AC3
    Duration                       : 1 min 0 s
    Bit rate mode                  : Constant
    Bit rate                       : 256 kb/s
    Channel(s)                     : 2 channels
    Channel layout                 : L R
    Sampling rate                  : 48.0 kHz
    Frame rate                     : 31.250 FPS (1536 SPF)
    Compression mode               : Lossy
    Stream size                    : 1.83 MiB (1%)
    Service kind                   : Complete Main
    Default                        : Yes
    Forced                         : No
    Also MPC-HC detects is as an 50fps file. Also I tried to set the following flags in mvktoolnix header editor: "Field order: 1" and "Interlaced: 1".

    Also I muxed it Tsmuxer into m2ts which was recognized as a proper interlaced m2ts file, but remuxing it into mkv will give me the mediainfo as above.

    How I could produce a fully compatible interlaced mkv file from Vegas render?
    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    It may be OK, interlaced H.264/AVC usually shows something weird in the mediainfo related to the frame rate.
    It's to do with the way the interlacing is stored as separated fields.
    Quote Quote  
  3. Timestamps are unset in a packet for stream 0.
    For ffmpeg, use -bsf "setts=pts=DTS" to fix timestamps on elementary stream input

    something like this

    Code:
    ffmpeg -f h264 -r 25 -i input.avc -i input.ac3 -bsf "setts=pts=DTS" -c copy output.mkv
    Quote Quote  
  4. Originally Posted by poisondeathray View Post
    Timestamps are unset in a packet for stream 0.
    For ffmpeg, use -bsf "setts=pts=DTS" to fix timestamps on elementary stream input

    something like this

    Code:
    ffmpeg -f h264 -r 25 -i input.avc -i input.ac3 -bsf "setts=pts=DTS" -c copy output.mkv
    Code:
    ffmpeg -f h264 -r 25 -i "InnistradS8_tesztrender.avc" -i "InnistradS8_tesztrender.ac3" -bsf "setts=pts=DTS" -c copy inni.mkv
    ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
      built with gcc 10.2.1 (GCC) 20200726
      configuration: --disable-static --enable-shared --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-libsrt --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-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
      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
    [h264 @ 00000266bc2b5340] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, h264, from 'InnistradS8_tesztrender.avc':
      Duration: N/A, bitrate: N/A
        Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1200k tbn, 50 tbc
    [ac3 @ 00000266bca2b100] Estimating duration from bitrate, this may be inaccurate
    Input #1, ac3, from 'InnistradS8_tesztrender.ac3':
      Duration: 00:01:00.03, start: 0.000000, bitrate: 256 kb/s
        Stream #1:0: Audio: ac3, 48000 Hz, stereo, fltp, 256 kb/s
    Error parsing bitstream filter sequence 'setts=pts=DTS': Bitstream filter not found
    Quote Quote  
  5. ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
    built with gcc 10.2.1 (GCC) 20200726
    2020 is old binary. Use something more recent

    https://www.gyan.dev/ffmpeg/builds/

    https://github.com/BtbN/FFmpeg-Builds/releases
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!