<p>The timecode_rate value is rounded and then applied, so <code>0.2857</code> gets rounded down to 0, which is considered invalid. That error message should be refined.</p>

<p>Since you seem to want timecode value to increase by 0.2857 after each 32 frames, you can supply a custom text value</p>

<pre><code>text='%{e\:0.2857*n/32}'
</code></pre>

<p>Remove the timecode and timecode_rate options.</p>

CC BY-SA 3.0
2017-11-01T05:58:42.900Z
2017-11-01T05:58:42.900Z
Gyan
<p>I got a frame rate under 1 and can't seem to get ffmpeg to stamp the time code</p>

<p>Doesn't work</p>

<pre><code>ffmpeg -start_number 0 -framerate 32 -y -i "f0_t%d_i0_ch1_c0_r0_z0_mqdic.jpg" -vframes 32 -vf "drawtext=fontfile=DejaVuSans.ttf:timecode='00\:00\:00\:00':timecode_rate=0.28571:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1,setpts=PTS" -pix_fmt yuv420p  -c:v libx264 "part9_dynamics_slower_sampling_z0.avi"
</code></pre>

<p>with an error</p>

<pre><code>[Parsed_drawtext_0 @ 00000283dbab5f00] Timecode frame rate must be specified
[AVFilterGraph @ 00000283dbab58c0] Error initializing filter 'drawtext' with args 'fontfile=DejaVuSans.ttf:timecode=00\:00\:00\:00:timecode_rate=0.28571:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!
</code></pre>

<p>Works as expected</p>

<pre><code>ffmpeg -start_number 0 -framerate 32 -y -i "f0_t%d_i0_ch1_c0_r0_z0_mqdic.jpg" -vframes 32 -vf "drawtext=fontfile=DejaVuSans.ttf:timecode='00\:00\:00\:00':timecode_rate=1:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1,setpts=PTS" -pix_fmt yuv420p  -c:v libx264 "part9_dynamics_slower_sampling_z0.avi"
</code></pre>

<p>In one case <code>timecode_rate=0.28571</code> and in the other <code>timecode_rate=1</code></p>

<p>So, how do I stamp in the correct, <code>0.28571</code> frame rate?</p>

<ffmpeg>
Fractional ffmpeg timecode in draw text
Mikhail
# Fractional ffmpeg timecode in draw text

(Asked by: username_0 on 2017-10-31)

I got a frame rate under 1 and can't seem to get ffmpeg to stamp the time code
Doesn't work
ffmpeg -start_number 0 -framerate 32 -y -i "f0_t%d_i0_ch1_c0_r0_z0_mqdic.jpg" -vframes 32 -vf "drawtext=fontfile=DejaVuSans.ttf:timecode='00\:00\:00\:00':timecode_rate=0.28571:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1,setpts=PTS" -pix_fmt yuv420p  -c:v libx264 "part9_dynamics_slower_sampling_z0.avi"

with an error
[Parsed_drawtext_0 @ 00000283dbab5f00] Timecode frame rate must be specified
[AVFilterGraph @ 00000283dbab58c0] Error initializing filter 'drawtext' with args 'fontfile=DejaVuSans.ttf:timecode=00\:00\:00\:00:timecode_rate=0.28571:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

Works as expected
ffmpeg -start_number 0 -framerate 32 -y -i "f0_t%d_i0_ch1_c0_r0_z0_mqdic.jpg" -vframes 32 -vf "drawtext=fontfile=DejaVuSans.ttf:timecode='00\:00\:00\:00':timecode_rate=1:fontcolor=red:fontsize=64: box=1: boxcolor=0x00000000@1,setpts=PTS" -pix_fmt yuv420p  -c:v libx264 "part9_dynamics_slower_sampling_z0.avi"

In one case timecode_rate=0.28571 and in the other timecode_rate=1
So, how do I stamp in the correct, 0.28571 frame rate?

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2017-11-01. Score: 2 | Accepted answer

The timecode_rate value is rounded and then applied, so 0.2857 gets rounded down to 0, which is considered invalid. That error message should be refined.
Since you seem to want timecode value to increase by 0.2857 after each 32 frames, you can supply a custom text value
text='%{e\:0.2857*n/32}'

Remove the timecode and timecode_rate options.


---

