VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Member
    Join Date
    Aug 2013
    Location
    Germany
    Search Comp PM
    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.
    Quote Quote  
  2. I believe that this is due to cutting in the middle of a picture frame.
    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.

    does the start of a frame correspond with the start of a packet?
    yes, a video frame can not start in the middle of a package, but can be spread over multiple packages

    if so, how is that packet marked?
    the packet isn't it's content is (depending on the content)

    One peculiarity of the box is that these files have to contain a specific number of packets
    are you sure about that? this sound just weird

    are there other aspects to be considered when splitting TS-files?
    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)

    Cu Selur
    Quote Quote  
  3. Member
    Join Date
    Aug 2013
    Location
    Germany
    Search Comp PM
    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
    Quote Quote  
  4. 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?
    Quote Quote  
  5. Member
    Join Date
    Aug 2013
    Location
    Germany
    Search Comp PM
    Hello Selur,
    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.
    Thank you. Do you have any information about MPEG-2-streams?
    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?
    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.

    Cheers,
    kyriako41.
    Quote Quote  
  6. Do you have any information about MPEG-2-streams?
    Never really needed to parse mpeg-2 streams, but looking at MPEG Headers Quick Reference, the picture header info should be the most interesting.
    Quote Quote  
  7. Member
    Join Date
    Aug 2013
    Location
    Germany
    Search Comp PM
    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.
    Quote Quote  



Similar Threads

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