<p>As you note, just adding (integrating) each pair of adjacent frames to make one new frame decreases the frame rate.</p>

<p>But if all you want to do is integrate adjacent frames, consider duplicating the video into a separate timeline, shifted by exactly one frame. Integrating these two streams would give you a new video with the same frame rate, but shorter by one frame overall.</p>

<p>All the rest of the noted issues might surface, but at least the frame rate wouldn't change.</p>

CC BY-SA 4.0
2018-10-27T03:27:23.913Z
This is a clever idea, but have you tested it? I'd better interested if there's any unexpected results.
user3643
CC BY-SA 4.0
2018-10-27T13:38:51.337Z
@DigiVisionMedia - No, I haven't tested it. If I had the means to test it I would, as anyone could. As I said, any of the other issues mentioned might surface, and I'm sure that 'success' would be content-dependent. But it would accomplish the stated goal without changing the frame rate.
Jim Mack
CC BY-SA 4.0
2018-05-29T21:15:09.080Z
2018-05-29T21:15:09.080Z
Jim Mack
<p>With physics! All you have to do is record at 15 frames per second in the first place and use a shutter speed of 1/15th of a second (aka, a 360 degree shutter angle).  This effectively does the same thing as combining two 1/30th second, 30 fps frames with software, it just does it by letting light hit the sensor for twice as long in the first place.  No fancy math or computations necessary!</p>

CC BY-SA 3.0
2017-11-30T04:28:31.403Z
Please note the words *existing* video, in the title of the question. Which means that I cannot shoot anything. It comes as it is. Also, it is clear at several points in the question text that it is video recorded with a phone. No fancy options further than the frame rate and only after installing a separate app (that is also mentioned in the text of the question) called OpenCamera.
Mephisto
CC BY-SA 3.0
2017-12-01T15:07:16.310Z
It was unclear to me whether you were actually asking about a phone, or using it as an example. Specifically, the language, "some mobile phones" and "let's say you" sound  hypothetical.  In fact, I completely disagree that "it is clear in several points in the question text that it is video recorded with a phone" because of this vagueness.  Maybe list smartphone w/ tools?  I admit that I may have overlooked the word "existing" in the title, but since there is no further emphasis on the uniqueness, criticality, authenticity, or whatever of your footage, I assumed it could simply be re-shot.
Jason Conrad
CC BY-SA 3.0
2017-12-01T15:29:01.273Z
Furthermore, the only "fancy option" that I suggested you change *was* frame rate. If your camera (phone)/ software combination prohibits you from changing camera settings, you should mention that in the question and not assume that everyone knows what OpenCamera is, or force everyone to guess what model phone you have (because you haven't mentioned).  But if it truly is the case that you can't change these settings without installing a separate app, maybe it's time for a new phone anyway.
Jason Conrad
CC BY-SA 3.0
2017-11-30T03:20:08.507Z
2017-11-30T03:20:08.507Z
Jason Conrad
<p><em>My own, not fully satisfactory answer that might be helpful:</em></p>

<p>This very simple line does the trick:</p>

<blockquote>
  <p>ffmpeg -i input vf "tblend=addition,framestep=2" {encoding options} output</p>
</blockquote>

<p>E.g.</p>

<blockquote>
  <p>ffmpeg -i input.mp4 -vf "tblend=addition,framestep=2" -c:v libx264 -crf 16 -c:a copy output.mp4</p>
</blockquote>

<p>input.mp4 was variable frame rate &lt;=30, whereas output.mp4 is 15 fps. I could have specified a constant frame rate for the output file, e.g.</p>

<blockquote>
  <p>ffmpeg -i input.mp4 -vf "tblend=addition,framestep=2" -c:v libx264 -r 30 -crf 16 -c:a copy output.mp4</p>
</blockquote>

<p><strong>I will not accept my own answer, because the result of this process is an ugly superposition of the moving objects between consecutive frames</strong>, so that some kind of adaptive blurring is needed, hence I leave the question open for someone to give a better solution.</p>

CC BY-SA 3.0
2017-11-30T04:52:53.917Z
You asked for *adding the values stored in the corresponding pixels of each two frames* and that's what your method does. This will result in "ugly superposition". You may just want to use a filter to increase brightness.
Gyan
CC BY-SA 3.0
2017-11-30T05:47:52.000Z
Mulvya is the resident ffmpeg expert. -- Decreased Framerate allows the shutter to remain open longer gathering more light and astronomical image stacking relies on the extremely slow movement of the objects in question. --- With an existing video and motion each Frame has to be *good enough* there's nothing to add or stack. You can use curves to brighten only the dark portions, leaving the bright pixels alone. Does this answer work for you: https://video.stackexchange.com/a/13110/18314 ?
Rob
CC BY-SA 3.0
2017-11-30T07:52:53.737Z
@Mulvya Increasing brightness produces very ugly results because of discretization noise. There must be some solution including something similar to frame interpolation or some kind of directional adaptive filter or something.
Mephisto
CC BY-SA 3.0
2017-11-30T07:56:47.600Z
@Rob Mmm I think you are right. Probably the phone is not adding frames, but rather integrating more time in each frame (and shooting less frames per second too).
Mephisto
CC BY-SA 3.0
2017-12-02T09:34:45.193Z
You can try to improve tblend method by stabilization image. But don't expect to much, your "low signal across few images" getting distorted by compression (quantization and so on).
bukkojot
CC BY-SA 3.0
2017-11-29T23:16:25.757Z
2017-11-29T23:16:25.757Z
Mephisto
<p>Some mobile phones are able to compensate for low illumination conditions by integrating every two or more frames into one. The result is a video with variable frame rate, where each image has its particular timestamp. This kind of footage shows correctly illuminated subjects, but you notice the drop in frame rate because the movement is not fluid and also the images become noisier (because you are adding too the noise produced by the electronics). Anyway it seems a technological miracle for me, taking into account that the entrance pupil of such devices may not be larger than 1 mm in diameter.</p>

<p>But let's say you forced the phone to record at a fixed frame rate (e.g. 1280x720p30 with OpenCamera in Android). It should be possible to convert for instance 30p to 15p by <strong>adding</strong> the values stored in the corresponding pixels of each two frames into one. I know this process is possible because it is usual in other contexts, e.g. dealing with astronomical images.</p>

<p>My tools are ffmpeg and Blender. I would be thankful if someone can restrict the answer to these tools, though other solutions are also welcome because they might put me in the right track to look for suitable alternatives.</p>

<video><ffmpeg><editing><post-production><blender>
How to *integrate* every two frames of an existing video into one in order to compensate for low illumination?
Mephisto
# How to *integrate* every two frames of an existing video into one in order to compensate for low illumination?

(Asked by: username_0 on 2017-11-29)

Some mobile phones are able to compensate for low illumination conditions by integrating every two or more frames into one. The result is a video with variable frame rate, where each image has its particular timestamp. This kind of footage shows correctly illuminated subjects, but you notice the drop in frame rate because the movement is not fluid and also the images become noisier (because you are adding too the noise produced by the electronics). Anyway it seems a technological miracle for me, taking into account that the entrance pupil of such devices may not be larger than 1 mm in diameter.

But let's say you forced the phone to record at a fixed frame rate (e.g. 1280x720p30 with OpenCamera in Android). It should be possible to convert for instance 30p to 15p by **adding** the values stored in the corresponding pixels of each two frames into one. I know this process is possible because it is usual in other contexts, e.g. dealing with astronomical images.

My tools are ffmpeg and Blender. I would be thankful if someone can restrict the answer to these tools, though other solutions are also welcome because they might put me in the right track to look for suitable alternatives.

**Tags:** video, ffmpeg, editing, post-production, blender


---

## 3 answers

### Answer by username_1 on 2018-05-29. Score: 1

As you note, just adding (integrating) each pair of adjacent frames to make one new frame decreases the frame rate.

But if all you want to do is integrate adjacent frames, consider duplicating the video into a separate timeline, shifted by exactly one frame. Integrating these two streams would give you a new video with the same frame rate, but shorter by one frame overall.

All the rest of the noted issues might surface, but at least the frame rate wouldn't change.

> **Comments:**
> **username_2**: This is a clever idea, but have you tested it? I'd better interested if there's any unexpected results.  
> **username_1**: @DigiVisionMedia - No, I haven't tested it. If I had the means to test it I would, as anyone could. As I said, any of the other issues mentioned might surface, and I'm sure that 'success' would be content-dependent. But it would accomplish the stated goal without changing the frame rate.  

---

### Answer by username_3 on 2017-11-30. Score: 0

With physics! All you have to do is record at 15 frames per second in the first place and use a shutter speed of 1/15th of a second (aka, a 360 degree shutter angle). This effectively does the same thing as combining two 1/30th second, 30 fps frames with software, it just does it by letting light hit the sensor for twice as long in the first place. No fancy math or computations necessary!

> **Comments:**
> **username_0**: Please note the words *existing* video, in the title of the question. Which means that I cannot shoot anything. It comes as it is. Also, it is clear at several points in the question text that it is video recorded with a phone. No fancy options further than the frame rate and only after installing a separate app (that is also mentioned in the text of the question) called OpenCamera.  
> **username_3**: It was unclear to me whether you were actually asking about a phone, or using it as an example. Specifically, the language, "some mobile phones" and "let's say you" sound  hypothetical.  In fact, I completely disagree that "it is clear in several points in the question text that it is video recorded with a phone" because of this vagueness.  Maybe list smartphone w/ tools?  I admit that I may have overlooked the word "existing" in the title, but since there is no further emphasis on the uniqueness, criticality, authenticity, or whatever of your footage, I assumed it could simply be re-shot.  
> **username_3**: Furthermore, the only "fancy option" that I suggested you change *was* frame rate. If your camera (phone)/ software combination prohibits you from changing camera settings, you should mention that in the question and not assume that everyone knows what OpenCamera is, or force everyone to guess what model phone you have (because you haven't mentioned).  But if it truly is the case that you can't change these settings without installing a separate app, maybe it's time for a new phone anyway.  

---

### Answer by username_0 on 2017-11-29. Score: 0

*My own, not fully satisfactory answer that might be helpful:*

This very simple line does the trick:

> ffmpeg -i input vf "tblend=addition,framestep=2" {encoding options} output

E.g.

> ffmpeg -i input.mp4 -vf "tblend=addition,framestep=2" -c:v libx264 -crf 16 -c:a copy output.mp4

input.mp4 was variable frame rate <=30, whereas output.mp4 is 15 fps. I could have specified a constant frame rate for the output file, e.g.

> ffmpeg -i input.mp4 -vf "tblend=addition,framestep=2" -c:v libx264 -r 30 -crf 16 -c:a copy output.mp4

**I will not accept my own answer, because the result of this process is an ugly superposition of the moving objects between consecutive frames**, so that some kind of adaptive blurring is needed, hence I leave the question open for someone to give a better solution.

> **Comments:**
> **username_4**: You asked for *adding the values stored in the corresponding pixels of each two frames* and that's what your method does. This will result in "ugly superposition". You may just want to use a filter to increase brightness.  
> **username_5**: Mulvya is the resident ffmpeg expert. -- Decreased Framerate allows the shutter to remain open longer gathering more light and astronomical image stacking relies on the extremely slow movement of the objects in question. --- With an existing video and motion each Frame has to be *good enough* there's nothing to add or stack. You can use curves to brighten only the dark portions, leaving the bright pixels alone. Does this answer work for you: https://video.stackexchange.com/a/13110/18314 ?  
> **username_0**: @Mulvya Increasing brightness produces very ugly results because of discretization noise. There must be some solution including something similar to frame interpolation or some kind of directional adaptive filter or something.  
> **username_0**: @username_5 Mmm I think you are right. Probably the phone is not adding frames, but rather integrating more time in each frame (and shooting less frames per second too).  
> **username_6**: You can try to improve tblend method by stabilization image. But don't expect to much, your "low signal across few images" getting distorted by compression (quantization and so on).  

---

