<p>An encoder receives and works upon uncompressed frames and does not know or care about the encoding of the source stream.</p>

<p>To avoid any information loss, you have to set lossless mode. For x264, this is by done by adding <code>-qp 0</code> to your ffmpeg command. But for most purposes, strict mathematical losslessness is not required. See <a href="https://video.stackexchange.com/q/27656">What&#39;s the difference between &quot;visually lossless&quot; and real lossless and what does this mean for future encodes?</a></p>

CC BY-SA 4.0
2019-09-28T13:43:26.527Z
I am not referring to lossy encoding. Perhaps I should've specified mathematically lossless video. Intra and inter can both be lossless (although one could argue that inter isn't "pure"). Assuming lossless inter-frame, would reencoding as intra produce the same output as starting with intra?
HDL
CC BY-SA 4.0
2019-09-28T13:50:33.603Z
Yes, as long as the source stream's integrity is intact and the decoder is conformant, the source encoding does not matter.
Gyan
CC BY-SA 4.0
2019-09-28T14:54:17.960Z
Thank you, that's what I was curious about. My goal is to use inter lossless for live recording and reencode to intra for intermediate editing afterwards.
HDL
CC BY-SA 4.0
2019-09-28T11:13:40.973Z
2019-09-28T11:13:40.973Z
Gyan
<p>I'm aware of the differences between intra and inter, but I'm not the most savvy about reencoding them after the fact.  Is encoding with intra from an inter-coded video the same as if you originally used intra to begin with?  Or does it need to be kept as intra from the start to preserve complete images?  Maybe I didn't search well enough, but I'm surprised I couldn't find info on this anywhere.</p>

<video><ffmpeg><encoding><codec><transcoding>
Can you encode intra-frame videos from inter-frame without loss?
HDL
# Can you encode intra-frame videos from inter-frame without loss?

(Asked by: username_0 on 2019-09-28)

I'm aware of the differences between intra and inter, but I'm not the most savvy about reencoding them after the fact. Is encoding with intra from an inter-coded video the same as if you originally used intra to begin with? Or does it need to be kept as intra from the start to preserve complete images? Maybe I didn't search well enough, but I'm surprised I couldn't find info on this anywhere.

**Tags:** video, ffmpeg, encoding, codec, transcoding


---

## 1 answers

### Answer by username_1 on 2019-09-28. Score: 0 | Accepted answer

An encoder receives and works upon uncompressed frames and does not know or care about the encoding of the source stream.

To avoid any information loss, you have to set lossless mode. For x264, this is by done by adding `-qp 0` to your ffmpeg command. But for most purposes, strict mathematical losslessness is not required. See [What's the difference between "visually lossless" and real lossless and what does this mean for future encodes?](https://video.stackexchange.com/q/27656)

> **Comments:**
> **username_0**: I am not referring to lossy encoding. Perhaps I should've specified mathematically lossless video. Intra and inter can both be lossless (although one could argue that inter isn't "pure"). Assuming lossless inter-frame, would reencoding as intra produce the same output as starting with intra?  
> **username_1**: Yes, as long as the source stream's integrity is intact and the decoder is conformant, the source encoding does not matter.  
> **username_0**: Thank you, that's what I was curious about. My goal is to use inter lossless for live recording and reencode to intra for intermediate editing afterwards.  

---

