Hello,
I have a settop box type "Imperial HD 3k" for the reception of cable TV.
This device can record and play back TV transmissions.
The file system is FAT32. Long videos are therefore split into several 4GB files.
If I want to make the box replay external videos, I have to adapt those accordingly.
One peculiarity of the box is that these files have to contain a specific number of packets which gives them a size shortly below the 4GB limit.
Therefore I cannot use existing tools for the division, but have to program it myself.
When I do it the "simple" way, just cutting at the desired number of packets, the starting pictures of the next file are slightly destorted.
I believe that this is due to cutting in the middle of a picture frame.
My questions:
1. does the start of a frame correspond with the start of a packet?
2. if so, how is that packet marked?
3. are there other aspects to be considered when splitting TS-files?
Cheers,
kyriako41.
		
			+ Reply to Thread
			
		
		
		
			
	
	
				Results 1 to 7 of 7
			
		- 
	
- 
	unless you split on key frames normal mpeg-2/-4 based streams will show corruption and yes, you will also get corruptions if you cut in the middle of a frame.I believe that this is due to cutting in the middle of a picture frame.
 
 yes, a video frame can not start in the middle of a package, but can be spread over multiple packagesdoes the start of a frame correspond with the start of a packet?
 
 the packet isn't it's content is (depending on the content)if so, how is that packet marked?
 
 are you sure about that? this sound just weirdOne peculiarity of the box is that these files have to contain a specific number of packets
 
 there might be some special modifications to the standard transport stream (settop boxes tend you modify the standard containers to make them unique to the box)are there other aspects to be considered when splitting TS-files?
 
 Cu Selur
- 
	Hello Selur, 
 thank you for the hints.
 It is true that the requirement of a special number of packets(in a 4GB file) is strange.
 Originally I just devided a big file in about equal parts. But the video would stop at the end of the first file.
 Only with the right number of packets, the second part would start.
 
 Can you give me a hint on how the start of a frame may be marked inside the content of a packet?
 
 Cheers,
 kyriako41
- 
	for h.264 raw streams the NAL units have a hex start code of: 00 00 01 X Y 
 with:
 X = IDR Picture NAL Units (25, 45, 65)
 X = Non IDR Picture NAL Units (01, 21, 41, 61) ; 01 = b-frames, 41 = p-frames
 and remember frames are often splitted over multiple NAL Units.
 
 Since you didn't mention it: did you try to simply load your source into tsMuxeR, activate it's split function (setting it to 4GB), then save the new files and feed them to your device?
- 
	Hello Selur, 
 Thank you. Do you have any information about MPEG-2-streams?for h.264 raw streams the NAL units have a hex start code of: 00 00 01 X Y
 with:
 X = IDR Picture NAL Units (25, 45, 65)
 X = Non IDR Picture NAL Units (01, 21, 41, 61) ; 01 = b-frames, 41 = p-frames
 and remember frames are often splitted over multiple NAL Units.
 Even if I succeeded in splitting the file externally, this would not help much. Because there are other adaption to be done: I have to insert NULL-packets containing data needed by the box, like the number of PATs etc.Since you didn't mention it: did you try to simply load your source into tsMuxeR, activate it's split function (setting it to 4GB), then save the new files and feed them to your device?
 
 Cheers,
 kyriako41.
- 
	Never really needed to parse mpeg-2 streams, but looking at MPEG Headers Quick Reference, the picture header info should be the most interesting.Do you have any information about MPEG-2-streams?
- 
	Hello Selur, 
 Thank you for the information.
 I solved the cutting problem in a practical way:
 assuming that the video-PID is 0x25A, the header of a video packet looks like this:
 47 02 5A xx
 There exist, however, packets with the same PID, marked in the second byte:
 47 E2 5A xx
 As far as I know, these are the PCR(program clock reference) packets.
 Expecting that these packets are inserted only after a complete frame, I cut the file just in front of this packet.
 It works fine, although I could not test it thoroughly so far.
 
 To whom it may concern:
 you can download my converting tool here:
 http://home.arcor.de/guentermeinel/cx70/TS_Test.zip
 
 Cheers,
 kyriako41.
Similar Threads
- 
  MTS files merged by tsMuxeR can't be play correctlyBy SmilingSun in forum Camcorders (DV/HDV/AVCHD/HD)Replies: 2Last Post: 15th Apr 2013, 21:35
- 
  Split mkv file no playing correctlyBy mchild in forum Newbie / General discussionsReplies: 6Last Post: 28th Mar 2013, 10:02
- 
  .avi files that won't work correctly!By RolloSwe in forum MacReplies: 10Last Post: 24th Feb 2011, 11:45
- 
  .avi files that won't work correctly!By RolloSwe in forum Newbie / General discussionsReplies: 8Last Post: 17th Feb 2011, 17:41
- 
  How to join vob files -CORRECTLY!By mcfcguvnors in forum EditingReplies: 18Last Post: 17th Jul 2009, 09:38


 
		
		 View Profile
				View Profile
			 View Forum Posts
				View Forum Posts
			 Private Message
				Private Message
			 
 
			
			

 Quote
 Quote Visit Homepage
				Visit Homepage