VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Hey guys. You might remember me posting a thread or two here and there about using my El Gato Capture HD to record things and having a heck of a time with it, as it natively stores AVC files inside .ts containers which have proven to be a real pain to work with. Right now I'm trying to record some live sports events for archival purposes. The El Gato capture software (which is the only software that seems to read the 1080i input off my WOW! cable box correctly) stores the video as a single video stream along with multiple audio streams in a .ts file. I want to stream copy the files to .mkv using the video stream and the only relevant audio stream. The El Gato software does convert the captures to MP4, but it takes SO LONG for that transcode to happen, and I'd rather not transcode them at all if possible.

    I've been trying to get better with ffmpeg lately. The command I'm using to try to make this happen is ffmpeg -i INPUT.ts -c:v copy -map 0:2 OUTPUT.mkv

    This results in a file with audio only.

    Code:
    C:\Users\Cursed Lemon\Videos\EGC_Library\My Great Game - My Great Capture - 2019
    -10-06 01-08-31>ffmpeg -i Recording_2019-10-06_01-08-31_0002.ts -c:v copy -map 0:2 test.mkv > test.txt
    ffmpeg version N-95216-ge6625ca41f Copyright (c) 2000-2019 the FFmpeg developers
      built with gcc 9.2.1 (GCC) 20190918
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --e
    nable-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 --ena
    ble-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enabl
    e-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d1
    1va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
      libavutil      56. 35.100 / 56. 35.100
      libavcodec     58. 59.101 / 58. 59.101
      libavformat    58. 33.100 / 58. 33.100
      libavdevice    58.  9.100 / 58.  9.100
      libavfilter     7. 61.100 /  7. 61.100
      libswscale      5.  6.100 /  5.  6.100
      libswresample   3.  6.100 /  3.  6.100
      libpostproc    55.  6.100 / 55.  6.100
    [mpegts @ 000000000051fe80] DTS 6834658 < 6839163 out of order
    [mpegts @ 000000000051fe80] Stream #1: not enough frames to estimate rate; consider increasing probesize
    [mpegts @ 000000000051fe80] start time for stream 1 is not set in estimate_timings_from_pts
    [mpegts @ 000000000051fe80] stream 1 : no TS found at start of file, duration not set
    [mpegts @ 000000000051fe80] Could not find codec parameters for stream 1 (Video: mpeg2video ([2][0][0][0] / 0x0002), none(tv)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mpegts, from 'Recording_2019-10-06_01-08-31_0002.ts':
      Duration: 00:00:18.23, start: 75.974011, bitrate: 34078 kb/s
      Program 2
        Stream #0:0[0x64]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr,
     90k tbn, 59.94 tbc
        Stream #0:1[0x66]: Video: mpeg2video ([2][0][0][0] / 0x0002), none(tv), 90k tbr, 90k tbn, 90k tbc
        Stream #0:2[0x67](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 234 kb/s
        Stream #0:3[0x69](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 224 kb/s
        Stream #0:4[0x3ec](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 217 kb/s
        Stream #0:5[0x3f0](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 224 kb/s
        Stream #0:6[0x3f7](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 217 kb/s
        Stream #0:7[0x65](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 234 kb/s
        Stream #0:8[0x3f3](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 217 kb/s
        Stream #0:9[0x3eb](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 217 kb/s
        Stream #0:10[0x3f5](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 217 kb/s
        Stream #0:11[0x3ed](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 217 kb/s
        Stream #0:12[0x3f1](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 217 kb/s
        Stream #0:13[0x4e7](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 217 kb/s
    File 'test.mkv' already exists. Overwrite? [y/N] y
    Stream mapping:
      Stream #0:2 -> #0:0 (aac (native) -> vorbis (libvorbis))
    Press [q] to stop, [?] for help
    Output #0, matroska, to 'test.mkv':
      Metadata:
        encoder         : Lavf58.33.100
        Stream #0:0(eng): Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 48000 Hz, stereo, fltp
        Metadata:
          encoder         : Lavc58.59.101 libvorbis
    size=     220kB time=00:00:18.21 bitrate=  99.0kbits/s speed=9.74x
    video:0kB audio:208kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 5.607529%
    
    C:\Users\Cursed Lemon\Videos\EGC_Library\My Great Game - My Great Capture - 2019-10-06 01-08-31>
    I've attached a MediaInfo dump of the input file in question, if that helps.

    Do I need to do something special to these TS files before I can just remux them into matroska files?
    Image Attached Files
    Quote Quote  
  2. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    I think I just solved my problem, mostly. So I just used TSDoctor to demux the .ts file, which gave me a raw .264 file and an .aac file.

    When I try to mux these files using FFMpeg, I am successful when muxing to MP4. However, when I try to mux to MKV, I get the following output:

    Code:
    C:\Users\Cursed Lemon\Desktop>ffmpeg -i Recording_2019-10-06_15-21-56_0011_PID_0064_.264 -i Recording_2019-10-06_15-21-56_0011_PID_0065_.aac -c copy t
    est.mkv
    ffmpeg version N-95216-ge6625ca41f Copyright (c) 2000-2019 the FFmpeg developers
      built with gcc 9.2.1 (GCC) 20190918
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --e
    nable-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 --ena
    ble-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enabl
    e-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d1
    1va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
      libavutil      56. 35.100 / 56. 35.100
      libavcodec     58. 59.101 / 58. 59.101
      libavformat    58. 33.100 / 58. 33.100
      libavdevice    58.  9.100 / 58.  9.100
      libavfilter     7. 61.100 /  7. 61.100
      libswscale      5.  6.100 /  5.  6.100
      libswresample   3.  6.100 /  3.  6.100
      libpostproc    55.  6.100 / 55.  6.100
    [h264 @ 00000000005a02c0] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, h264, from 'Recording_2019-10-06_15-21-56_0011_PID_0064_.264':
      Duration: N/A, bitrate: N/A
        Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1200k tbn, 59.94 tbc
    [aac @ 0000000002a700c0] Estimating duration from bitrate, this may be inaccurate
    Input #1, aac, from 'Recording_2019-10-06_15-21-56_0011_PID_0065_.aac':
      Duration: 00:00:23.20, bitrate: 197 kb/s
        Stream #1:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 198 kb/s
    File 'test.mkv' already exists. Overwrite? [y/N] y
    Output #0, matroska, to 'test.mkv':
      Metadata:
        encoder         : Lavf58.33.100
        Stream #0:0: Video: h264 (High) (H264 / 0x34363248), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 1k
     tbn, 1200k tbc
        Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp, 198 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
      Stream #1:0 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [matroska @ 0000000003191680] 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 @ 0000000003191680] 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=N/A
    video:89kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Conversion failed!
    I guess I'd prefer to mux to MKV but I don't mind MP4. If anyone has an inkling as to why this is occurring, I'm all ears.
    Quote Quote  
  3. Originally Posted by CursedLemon View Post
    The command I'm using to try to make this happen is ffmpeg -i INPUT.ts -c:v copy -map 0:2 OUTPUT.mkv

    This results in a file with audio only.
    You're telling it to remux only stream #2. "-c:v copy" is telling it to copy the video (rather than reencoded it) IF the video is included. But -map 2:0 is telling it to only include stream 2 (one of the audio streams) -- and it will be reencoded since you aren't specifying copy for the audio. The video is probably stream #0:

    Code:
    ffmpeg -i INPUT.ts -codec copy -map 0:0 -map 0:2 OUTPUT.mkv
    Quote Quote  
  4. Chicken McNewblet
    Join Date
    Sep 2009
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by CursedLemon View Post
    The command I'm using to try to make this happen is ffmpeg -i INPUT.ts -c:v copy -map 0:2 OUTPUT.mkv

    This results in a file with audio only.
    You're telling it to remux only stream #2. "-c:v copy" is telling it to copy the video (rather than reencoded it) IF the video is included. But -map 2:0 is telling it to only include stream 2 (one of the audio streams) -- and it will be reencoded since you aren't specifying copy for the audio. The video is probably stream #0:

    Code:
    ffmpeg -i INPUT.ts -codec copy -map 0:0 -map 0:2 OUTPUT.mkv
    This works to include the video. However, the video for some reason is ending up as a sub-30 FPS copy, and I receive a string of the following errors all throughout the copy process:

    Code:
    [matroska @ 000000000316c4c0] Invalid DTS: 64014 PTS: 63964 in output stream 0:0, replacing by guess
    When I try to remux to MP4, I receive this error instead:

    Code:
    [mp4 @ 000000000307c4c0] Non-monotonous DTS in output stream 0:0; previous: 15280767, current: 15280766; changing to 15280768. This may result in inco
    rrect timestamps in the output file.
    I suppose I'm good with the TSDoctor solution, I'm just curious as to why this is happening.
    Quote Quote  
  5. Member netmask56's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Search Comp PM
    If you have demuxed in TSDoctor then just pop the files into MKVToolNix. Doesn't re-encode same quality out same size. Takes minutes. You can actually wrap the TS file in a MKV container as well without demuxing. one step! However TSDoctor does cleanup any transmission errors so it's probably the best way to do it.
    SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 11 Professional, QNAP NAS TS851
    Quote Quote  



Similar Threads

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