Go Back    Forum > Digital Video > Video Project Help > Capture, Record, Transfer

Reply
 
LinkBack Thread Tools Search this Thread
  #1  
04-03-2025, 10:20 AM
fredvhs fredvhs is offline
Free Member
 
Join Date: Apr 2025
Posts: 5
Thanked 0 Times in 0 Posts
Hi - I'm digitizing vhs tapes with a Hauppauge Colossus capture card and Mediaportal on windows 7. They're captured as .ts files and the .ts files play well, with no sign of corruption.

But I'd like to convert them to .mkv, and ffmpeg (version 2023-08-28-git-b5273c619d-essentials_build-www.gyan.dev) fails at this. I use
Code:
ffmpeg.exe -i test.ts -c copy test.mkv
and get these errors repeated many times:
Code:
[mpegts @ 00000000003d6d40] Packet corrupt (stream = 0, dts = 46105).
[mpegts @ 00000000003d6d40] Packet corrupt (stream = 0, dts = 49107).
[h264 @ 00000000003fc580] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 00000000003fc580] decode_slice_header error
[h264 @ 00000000003fc580] no frame!
...etc...
[in#0/mpegts @ 00000000003d6b80] corrupt input packet in stream 0
[mpegts @ 00000000003d6d40] Packet corrupt (stream = 0, dts = 247305).
...etc...
The resulting mkv file is much smaller than the .ts, and displays solid black in mpc-hc.

Ffmpeg seems to be complaining about corruption, though again the .ts files play fine. Is there some way to use ffmpeg to convert these files to mkv? Or do I need to capture them differently somehow?

Thanks!
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
04-09-2025, 06:30 PM
mbassiouny mbassiouny is offline
Free Member
 
Join Date: Jul 2020
Posts: 286
Thanked 35 Times in 34 Posts
You do not specify what you want to do. Do you just want to change .ts to .mkv for fun? for playback issues? trying to compress the files for storage? re-encoding for (web) distribution?

"Ffmpeg won't convert VHS captured .ts to .mkv"

Is actually a weird way to ask your question. It's simply "Ffmpeg won't convert .ts to .mkv". FFmpeg does not care where that .TS came from. Your .ts being a vhs transfer does not make it special, it's just a .ts file and the question is a simple format transfer question that has nothing to do with analog and vhs capture.

> the .ts files play well, with no sign of corruption.
With no sign of corruption to your naked eye. How do you know for sure there is no corruption?

> The resulting mkv file is much smaller than the .ts,
I am not sure that makes sense... you're using "copy" so if your codec is compatible with the mkv container ffmpeg is supposed just "re-mux" the same video just in an mkv container with ~almost the same size.

Try using a more explicit command chose you codec, specify that the source is interlaced if it is, etc or use a gui encoder like https://sourceforge.net/projects/x26....8.7z/download if you're not familiar with FFmpeg CLI commands (or find an ffmpeg GUI)
Reply With Quote
  #3  
04-10-2025, 05:51 PM
traal traal is offline
Free Member
 
Join Date: Jan 2016
Posts: 439
Thanked 89 Times in 80 Posts
You might use MediaInfo to inspect the input and output files to see what's different other than the container itself.

It's possible that the output file is perfectly good but mpc-hc just doesn't know how to play it.

You could try converting the .ts to HuffYUV and see if you can open it in VirtualDub:

Code:
ffmpeg -i test.ts -acodec copy -vcodec huffyuv test.avi
But you should capture directly to HuffYUV because it's lossless and it will give you a greater ability to restore the video.
Reply With Quote
  #4  
04-14-2025, 09:54 AM
fredvhs fredvhs is offline
Free Member
 
Join Date: Apr 2025
Posts: 5
Thanked 0 Times in 0 Posts
Thanks for the replies. I want to transmux from .ts container to mkv, because with my players (Mediaportal and mpc-hc) mkv's navigate (skip, fforward, rewind) better than ts's. And they're slightly smaller.

The original .ts file is tff interlaced - here's the MediaInfo output (ignoring the audio stream):
Code:
General
ID                                       : 4 (0x4)
Complete name                            : short.ts
Format                                   : MPEG-TS
File size                                : 102 MiB
Duration                                 : 2 min 54 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 4 889 kb/s
Frame rate                               : 29.970 FPS

Video
ID                                       : 48 (0x30)
Menu ID                                  : 137 (0x89)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.2
Format settings                          : CABAC / 2 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 2 frames
Format settings, GOP                     : M=3, N=15
Codec ID                                 : 27
Duration                                 : 2 min 54 s
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 29.970 (30000/1001) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : MBAFF
Scan type, store method                  : Interleaved fields
Scan order                               : Top Field First
I want to do this losslessly, so the mkv has to be interlaced. When I try to losslessly convert to mkv with the command
Code:
ffmpeg -i test.ts -codec copy test.mkv
test.mkv is about 4% the filesize of test.ts, so clearly the video stream hasn't been copied. MediaInfo on test.mkv gives:
Code:
General
Unique ID                                : 324606370689798789122356525188404692766 (0xF434E9B6C40AEE5451D4E55EC71F471E)
Complete name                            : short2.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 3.87 MiB
Duration                                 : 2 min 54 s
Overall bit rate                         : 186 kb/s
Frame rate                               : 29.970 FPS
Writing application                      : Lavf61.7.100
Writing library                          : Lavf61.7.100
ErrorDetectionType                       : Per level 1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.2
Format settings                          : CABAC / 2 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 2 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan type, store method                  : Separated fields (2 fields per block)
Scan order                               : Top Field First
Default                                  : No
Forced                                   : No
I've tried to specify tff interlacing with the command:
Code:
ffmpeg -i test.ts -codec copy -flags +ilme+ildct -top 1 -x264opts tff=1 test.mkv
and that gives file test.mkv of the same size as the previous ffmpeg command and with the same MediaInfo output. In other words it doesn't work.

I've also transcoded with command:
Code:
ffmpeg -i test.ts -vf yadif test.mkv
The result test.mkv is progressive and plays fine. But again I'd like to do this losslessly.
Reply With Quote
  #5  
04-14-2025, 11:14 AM
mbassiouny mbassiouny is offline
Free Member
 
Join Date: Jul 2020
Posts: 286
Thanked 35 Times in 34 Posts
use mkvmergeGUI (mkvtoolnix).
Just drag and drop the .ts into the tool then "stat multiplexing"you will get an mkv output.

Try mpv for playback of the ts files, they usually seek fine.


Quote:
because with my players (Mediaportal and mpc-hc) mkv's navigate (skip, fforward, rewind) better than ts's.
I don't think this is always true.
MPC-HC can play ts and navigate perfectly if the ts is seekable from my experience...

Maybe just a mere format conversion will solve the problem for u, maybe not. IDK

Some videos are just not very seekable (and there are many possible reasons behind it) so this may force you to re-transcode.
Reply With Quote
  #6  
04-14-2025, 12:11 PM
fredvhs fredvhs is offline
Free Member
 
Join Date: Apr 2025
Posts: 5
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by mbassiouny View Post
use mkvmergeGUI (mkvtoolnix).
Just drag and drop the .ts into the tool then "stat multiplexing"you will get an mkv output.
Thanks again. Mkvmerge (GUI or CLI) gives a similar result to ffmpeg - .mkv file is around 4% the filesize of the .ts file and won't play.
Reply With Quote
  #7  
04-14-2025, 02:43 PM
vwestlife vwestlife is offline
Free Member
 
Join Date: May 2024
Location: New Jersey, USA
Posts: 192
Thanked 35 Times in 31 Posts
What happens when you transmux them into .MP4 files? That is generally the most universally compatible container for AVC (H.264) video.
Reply With Quote
  #8  
04-14-2025, 04:32 PM
fredvhs fredvhs is offline
Free Member
 
Join Date: Apr 2025
Posts: 5
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by vwestlife View Post
What happens when you transmux them into .MP4 files? That is generally the most universally compatible container for AVC (H.264) video.
I get exactly the same result with mp4 as when I try transmux to mkv: tiny filesize and no video on playback.
Reply With Quote
  #9  
04-14-2025, 04:47 PM
mbassiouny mbassiouny is offline
Free Member
 
Join Date: Jul 2020
Posts: 286
Thanked 35 Times in 34 Posts
probably your source is corrupted and every software that tries to remux it fails after a few frames.

care to share the file?
Reply With Quote
  #10  
04-16-2025, 02:03 PM
fredvhs fredvhs is offline
Free Member
 
Join Date: Apr 2025
Posts: 5
Thanked 0 Times in 0 Posts
Well ffprobe/ffmpeg does report numerous "Packet corrupt" messages as I mentioned above. Still it seems odd that a deinterlaced transcode succeeds, giving a playable mkv file without obvious corruption, using the command:
Code:
ffmpeg -i test.ts -vf yadif test.mkv
Anyway I see this forum doesn't allow .ts file attachments. So I've posted to my web server a sample ts file captured directly from vhs via the colossus capture card - you can download it from https://lcdm.ca/files/test.ts.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
What to convert captured VHS on DVD files to? 2ball Capture, Record, Transfer 10 02-05-2024 07:01 PM
Best way to restore and convert captured footage? Patrick_S Restore, Filter, Improve Quality 6 10-07-2023 10:57 AM
QTGMC deinterlacing using ffmpeg? dabhdude Restore, Filter, Improve Quality 0 03-22-2023 04:03 PM
Batch file ffmpeg to convert multiple files? michelhammamet Encode, Convert for discs 1 02-01-2021 02:25 PM
VHS software to split, remove noise, convert to H.264? Amanjm Encode, Convert for discs 1 01-30-2020 08:04 PM




 
All times are GMT -5. The time now is 05:31 AM