I have got a 8GB .ts video file, unfortunately when I tried to copy it from my hard disk to my 16GB USB thumb drive, I got an error at 60% which seems to be a file checksum error (strangely, I found no error when I checked the disk, so it is not likely a bad sector, and I can view the video with MPC before and after that point, the video just stops when coming across that 60% point).

I tried using Project X to see if the file can be repaired, but as expected, there is an error once the software reads the file at 60%. So my thought is to split the file into 2 separate parts, Part 1 before the 60% mark and Part 2 starts after the 60%, simply using byte-by-byte read-write, hence skipping the problem part.

Part 1 works ok, and Part 2 doesn't because the header is missing. But is it possible to fix Part 2 and use some software to add the header back? People said Project X is powerful, but I don't know if it can solve my problem (and if so, how). Any guidance is welcomed. Thanks!

Edit: I used ffmpeg to check and get this error report: Full report on http://pastebin.com/yU6Y36Yw

[h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period [h264 @ 000000000042c480] SPS unavailable in decode_picture_timing [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period [h264 @ 000000000042c480] SPS unavailable in decode_picture_timing [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] no frame! [h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period [h264 @ 000000000042c480] SPS unavailable in decode_picture_timing [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period [h264 @ 000000000042c480] SPS unavailable in decode_picture_timing [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] no frame! [h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period [h264 @ 000000000042c480] SPS unavailable in decode_picture_timing [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period [h264 @ 000000000042c480] SPS unavailable in decode_picture_timing [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] no frame! [h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period [h264 @ 000000000042c480] SPS unavailable in decode_picture_timing [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] non-existing SPS 0 referenced in buffering period [h264 @ 000000000042c480] SPS unavailable in decode_picture_timing [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] non-existing PPS 0 referenced [h264 @ 000000000042c480] decode_slice_header error [h264 @ 000000000042c480] no frame! [mpegts @ 00000000004f8fe0] start time for stream 4 is not set in estimate_timin gs_from_pts [mpegts @ 00000000004f8fe0] start time for stream 5 is not set in estimate_timin gs_from_pts [mpegts @ 00000000004f8fe0] start time for stream 6 is not set in estimate_timin gs_from_pts [mpegts @ 00000000004f8fe0] PES packet size mismatch Last message repeated 3 times Input #0, mpegts, from 'L:\HBPVR\TVClip\20170127.ts': Duration: 01:47:03.36, start: 0.083867, bitrate: 10069 kb/s Program 137 Stream #0:0[0x30]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc

`Stream #0:1[0x40]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s`
`Stream #0:2[0x41]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s`
`Stream #0:3[0x42]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 384 kb/s`
`Stream #0:4[0x50](CHI): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)`
`Stream #0:5[0x51](ENG): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)`
`Stream #0:6[0x52](CHS): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)`

Output #0, mpegts, to 'L:\HBPVR\TVClip\20170127h.ts': Metadata: encoder : Lavf57.66.101 Stream #0:0: Video: mpeg2video (Main), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9] , q=2-31, 200 kb/s, 25 fps, 90k tbn, 25 tbc Metadata: encoder : Lavc57.77.100 mpeg2video Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s Metadata: encoder : Lavc57.77.100 mp2 Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native)) Stream #0:3 -> #0:1 (ac3 (native) -> mp2 (native)) Press [q] to stop, [?] for help [h264 @ 00000000022f9f20] co located POCs unavailable Last message repeated 1 times [h264 @ 00000000022fa8c0] mmco: unref short failure frame= 40 fps=0.0 q=31.0 size= 651kB time=00:00:01.96 bitrate=2720.2kbits/ frame= 93 fps= 92 q=31.0 size= 1198kB time=00:00:04.08 bitrate=2406.4kbits/ frame= 136 fps= 90 q=31.0 size= 1554kB time=00:00:05.80 bitrate=2195.1kbits/ frame= 185 fps= 92 q=31.0 size= 1991kB time=00:00:07.76 bitrate=2102.1kbits/ [mpegts @ 00000000004f8fe0] PES packet size mismatch [h264 @ 00000000022fad80] error while decoding MB 118 48, bytestream -72 [h264 @ 00000000022fad80] concealing 2331 DC, 2331 AC, 2331 MV errors in I frame [ac3 @ 00000000022f6f00] incomplete frame frame= 221 fps= 11 q=31.0 size= 2409kB time=00:00:09.20 bitrate=2145.2kbits/ L:\HBPVR\TVClip\20170127.ts: Permission denied Last message repeated 6 times frame= 227 fps= 11 q=31.0 Lsize= 2550kB time=00:00:09.48 bitrate=2203.5kbits /s dup=0 drop=1 speed=0.46x video:1917kB audio:408kB subtitle:0kB other streams:0kB global headers:0kB muxin g overhead: 9.644997%

  • Try with ffmpeg on the full file. First ffmpeg -i in.ts -c copy out.ts. Else, ffmpeg -err_detect ignore_err -i in.ts -c copy out.ts – Gyan Feb 12 '17 at 18:35
  • @Mulvya I tried both commands, and both returned the error: [mpegts at 000000000043a960] PES packet size mismatch frame=111064 fps=1000 q=-1.0 size= 4625636kB time=01:03:29.35 bitrate=9947.4kbit L:\HBPVR\TVClip\20170127.ts: Permission denied – GreenPenguin Feb 12 '17 at 18:47
  • Try ffmpeg -err_detect ignore_err -ss 3800 -t 120 -i in.ts out.ts -report and post the report file generated. – Gyan Feb 12 '17 at 19:00
  • Paste the full report into your Q as code. – Gyan Feb 12 '17 at 19:25
  • Full report, please. Use pastebin or similar if it's too big. – Gyan Feb 12 '17 at 20:00

I used the Windows version of the Linux command 'dd' to solve the above problem. Using the strategy stated in the question, I split the file into 2 parts, the first part up to 60%, the second part from 60% after the problem bytes until the end. The 2 resulting files can be read, without any need to add extra headers.

The previous attempt (I wrote a program to split the files into 2) failed, just because my compiler seems not supporting files larger than 2GB using fseek().

  • A lot of players have problems with file sizes over 2GB. Set file limits in your record program if this is s common problem. – DigiVision Media Feb 17 '17 at 2:42

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.