FORUMS: list search recent posts

TimeCode conversion

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Frederico Cengarle
TimeCode conversion
on Apr 4, 2016 at 6:01:06 pm

Hi,

I need to convert some mov that are in 25 fps to 24 fps. Now the twist, is that I also need to convert the TC start of the file so it represent 25 fps (ex: TC start 25fps 11:24:49:11 becomes 11:53:21:12 when it's convert to 24 fps)

Now I have a vague idea on how to do that (probeTC start of the clip, convert SMPTE TC to frame number and regenerate 24 fps SMPTE TC based on the frame number) but I was wondering if someone knows how to do that in FFMPEG (or have a better solution)

Thanks
Fred


Return to posts index

Reuben Martin
Re: TimeCode conversion
on Apr 5, 2016 at 6:58:06 pm

The "timecode track" is simply a timestamp at the beginning of the file. Timecode is calculated from that point on. They only reason a timecode packet would show up anywhere besides the beginning of the file is if the timecode source was non-continuous.

If you simply specify the starttime for the timecode argument you should be fine.

-timecode hh:mm:ss:ff


Return to posts index

Frederico Cengarle
Re: TimeCode conversion
on Apr 6, 2016 at 7:04:28 pm

Thanks a lot for the follow up Reuben,

The TC is continuous indeed, but my question was more on how I can convert it

ex: My source file is in 25 fps (with a TC track at 25 fps). No I want to take this source file and make a 24 fps version of it. How can I read the TC start of my source and convert it so it as the right TC start in 24 fps?

Ususally, fore timecode conversion, I first take the SMPTE TC and convert it in frames. Then I take this frames result and apply it to the new TC rate.

ex: Source TC 25 fps is at 09:59:59:00 so this equal to 899975 frames. And 899975 frames equal 10:24:58:23 in 24 fps. So my result file should have a TC start of 10:24:58:23

Is there a way to do this manipulation (grab source TC start > convert it in frames > regenerate a new TC start for the result based on the frames number)?

Thanks again


Return to posts index


Reuben Martin
Re: TimeCode conversion
on Apr 12, 2016 at 10:50:46 pm

I think you are erroneously conflating two different aspects of framerate manipulation. "Changing the framerate" implies that the video lasts the same amount of time, but the frames are interpolated to increase or decrease the number of frames played within the same timeframe. "Changing the playrate" implies that no frame interpolation is taking place and you end up with the same total framecount, but you play them back at a slower or faster rate.

Regardless of which one you are doing, it really doesn't matter. If you specify the starting timecode for the timecode track that is all you need to do. There is no timecode conversion. It just sets the start time, and then whatever software is reading it just uses that as it's starting point and counts up from there depending on the frame rate and frame base that is being used.

A timecode "track" is not something that labels the timecode of every frame. It's just a single packet that says "here's the time to start with, count up from here". The only other time a timcode packet should show up is if the clock source that the recording device is jamming to suddenly jumps to a different time. Then a packets shows up in the timecode track that says "the time changed, start counting up from this new time". The only time there would be need for a timecode packets at a regular interval is in a live chunked format.

You're thinking of something similar to an LTC signal, and timecode in digital interchange formats does not work like that.


Return to posts index

Mark Burton
Re: TimeCode conversion
on Apr 25, 2016 at 9:42:53 am

Hi Frederico,

I understand what you want to do. For me I have been using Applescript to manipulate the timecode tracks for my FFmpeg encodes. Essentially its exactly as you said - you get the start timecode, convert it to frames, then convert it back to timecode using the framerate you need.

This will get you started:
http://macscripter.net/viewtopic.php?id=43530

Good luck.
Mark



Return to posts index

Mark Burton
Re: TimeCode conversion
on Apr 25, 2016 at 9:50:34 am

Use this to get the start TC value:

set start_tc to do shell script "/usr/local/bin/ffmpeg -i " & movie_name_quoted_posix & " 2>&1 | awk '$1 ~ /^timecode/ {print $NF;exit;}’ "



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]