VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. Hi

    to save time and not having to re-encode it again with the procedure kindly suggested (and correct functioning) by poison using ffmpeg

    I supposed to be a cats play but it's very very difficult, almost impossible to add a initial timecode code into a virtualdub mjpeg .avi file...

    I have see in another case (ffmpeg, matrox digisuite .avi files ecc..) timecode code in "envelope" in the header of the .avi, I thought that somehow, using hex editor you could (in an automated way then) enter the timecode but now I have lost hope

    Click image for larger version

Name:	TIMECO22.JPG
Views:	339
Size:	182.5 KB
ID:	24809Click image for larger version

Name:	TIMECO1.JPG
Views:	379
Size:	201.8 KB
ID:	24810Click image for larger version

Name:	TIMECO2.JPG
Views:	322
Size:	226.9 KB
ID:	24811Click image for larger version

Name:	TIMECO11.JPG
Views:	249
Size:	225.8 KB
ID:	24812Click image for larger version

Name:	ISMP.JPG
Views:	228
Size:	76.3 KB
ID:	24813

    Is there a solution?
    Quote Quote  
  2. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Unless you want to know where to change any code bits easily then no.
    I think,therefore i am a hamster.
    Quote Quote  
  3. Originally Posted by johns0 View Post
    Unless you want to know where to change any code bits easily then no.
    also, yes: I would like to do a script that change only the tc data on the file but only if this involves less time than the procedure:

    ffmpeg -i c0020.mxf -f ffmetadata metadata.txt
    ffmpeg -y -i c0020.avi -i metadata.txt -map_metadata 1 -vcodec copy -an -vtag MJPG c0020a.avi



    However, I fear that the file must be rewritten all in any case and that the time required will look like the same procedure with ffmpeg.


    of course the best thing would be that virtualdub has a proper wraps timecode during the encoding process ... but it is not, unfortunately
    Quote Quote  
  4. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    It cannot be done easily because each 'chunk' of the AVI has a byte count (4 bytes) following the chunk name. To make it even worse, some chunks have a major chunk that encompasses several others and the byte count for it includes the sub chunks. Notice 'tdat' chunk including 'tc_0', 'tc_a', 'rn_0' and 'rn_a'. This is similar to MP4 file 'Atoms' structure.

    If the correct chunk (ISMP) was included and you just wanted to CHANGE the date/time then yes, it could be done, but if you are trying to add it, the whole file would need rewritten, at least the byte counts and that would be easier to have an existing program do that for you.
    Quote Quote  
  5. yes, because vitualdub don't include ISMP

    file .avi is however rewritten

    so the only solution maybe that suggested from poison

    ffmpeg -i c0020.mxf -f ffmetadata metadata.txt
    ffmpeg -y -i c0020.avi -i metadata.txt -map_metadata 1 -vcodec copy -an -vtag MJPG c0020a.avi
    Quote Quote  
  6. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    like everyone has said, you will have to rebuild the avi.

    but i'm still not sure what you are trying to do here.

    a) you want to insert a timecode inside the actual avi ?
    b) you want to inserf many timecodes throughout the whole avi ?
    c) you just want to have the timecode (length) reported inside the avi once ?
    Quote Quote  
  7. Adding info (as opposed to changing something that's already there -- like the fourcc) to an AVI file with a hex editor is impractical. The RIFF structure contains many nested size and offset pointers that need to be modified to account for the new sizes and positions of data. That's a non-trivial task and requires intimate knowledge of the RIFF structure.
    Quote Quote  
  8. Originally Posted by vhelp View Post
    like everyone has said, you will have to rebuild the avi.

    but i'm still not sure what you are trying to do here.

    a) you want to insert a timecode inside the actual avi ?
    b) you want to inserf many timecodes throughout the whole avi ?
    c) you just want to have the timecode (length) reported inside the avi once ?
    my .mxf source have timecode (initialTimecode), but I need to transcode in mjpeg using virtualdub--> but .avi encoded file have not timecode, and have not the space or a 00:00:00 timecode: it don't have nothing.

    So I would like to have a timecode into the .avi (generated by virtualdub) but considering that virtualdub does not include minimally a timecode structure inside the .avi file
    Quote Quote  
  9. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Why use Vdub, why not other apps which DO support timecode passthrough?

    Scott
    Quote Quote  
  10. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    well, there may be a few alternative ways to view timecodes for your videos.

    followup question...what could you possibly gain from having it embeded in the avi if all you need is to just see the timecode ? what are you trying to do with the timecode inside the avi ?

    actually, you can see the times inside virtual's timeline. consider that every frame has a time code, depending on the frame rate and µs per frame. for example: 29.970 is 33367µs, 25.00 is 40000µs, and so on. i wrote a utility to calculate and show timecodes based on Frame Number and Frame Rate, using a slidescale or entering the frame number because i thought it could be useful in something like subtitle text work and whatnot, but other than that, i could not find any other good use for it. it was educational to figure out how to do it.
    Quote Quote  
  11. To add ISMP or IDIT chunks you might be able to overwrite the JUNK chunk (it's just padding to align later chunks on 1K or 4K boundaries) that usually follows the STRL chunk. Rename the chunk ISMP, leave the length intact, write the date/time data in the body of the chunk. Since ISMP and IDIT are null terminated ascii strings it shouldn't matter that there's a lot of extra nulls following the date/time. I don't know what programs report that data so I can't test it.
    Last edited by jagabo; 27th Apr 2014 at 22:36.
    Quote Quote  
  12. Originally Posted by Cornucopia View Post
    Why use Vdub, why not other apps which DO support timecode passthrough?

    Scott
    FFMPEG have timecode, but I cannot use it because it generate wrong .avi mjpeg files... at least as regards what I should do.

    Mjpeg .avi files generated from ffmpeg are not open by virtualdub with it's internal .mjpeg decompressor, and are not openable by my nle (in sync speed razor). Only if I swith in speed razor the RGB24bit project mode, files are openable but results jerky playback... so files generated by ffmpeg, for me, can not be managed.

    Virtualdub generate .avi mjpeg files alwais ok
    Quote Quote  
  13. Originally Posted by jagabo View Post
    To add ISMP or IDIT chunks you might be able to overwrite the JUNK chunk (it's just padding to align later chunks on 1K or 4K boundaries) that usually follows the STRL chunk. Rename the chunk ISMP, leave the length intact, write the date/time data in the body of the chunk. Since ISMP and IDIT are null terminated ascii strings it shouldn't matter that there's a lot of extra nulls following the date/time. I don't know what programs report that data so I can't test it.
    Click image for larger version

Name:	TG4.JPG
Views:	182
Size:	215.3 KB
ID:	24844

    Click image for larger version

Name:	SRVDTC.JPG
Views:	241
Size:	208.9 KB
ID:	24845


    yes : it seems workName:  CT5.jpg
Views: 1212
Size:  4.9 KB
    at least in the abstract and in the files that I've changed, it works.
    It is about whether the procedure is automated in batch and if it takes longer than the procedure of rewriting with ffmpeg
    Quote Quote  
  14. Hi again, so now with this enhancement I can add timecode to a .avi file

    Click image for larger version

Name:	TC10.JPG
Views:	194
Size:	173.0 KB
ID:	24956

    can I found a dos program that can change hex values so this, in a .avi file?

    I'm looking for an application that can change the .avi header, possibly without rewrite the entire .avi file? and possibly I would like copy the timecode data from a file and put to the destination file
    Image Attached Thumbnails Click image for larger version

Name:	TC10.JPG
Views:	245
Size:	171.2 KB
ID:	24955  

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