<p>Use</p>

<pre><code>ffmpeg -i in.MOV -an -vcodec rawvideo -pix_fmt yuv420p rawbitstream.yuv

ffmpeg -s 640x480 -i rawbitstream.yuv -vf select="not(mod(n+1\,2))" -c:v rawvideo -vsync 0 -an even.yuv

ffmpeg -f rawvideo -s 640x480 -pix_fmt yuv420p -i even.yuv -c:v libx264 -preset ultrafast -profile:v high -qp 1 even.mp4
</code></pre>

CC BY-SA 3.0
2018-04-30T19:45:52.950Z
Thanks a lot. I would like also to understand what is -qp and how it works. Hard to find info about it.
R S
CC BY-SA 3.0
2018-05-01T07:17:42.990Z
Quantization parameter. It controls how the raw coefficients - the error residuals - are transformed. You need to wade into DSP for the details - see https://en.wikipedia.org/wiki/Quantization_(image_processing)
Gyan
CC BY-SA 3.0
2018-04-30T16:44:00.553Z
2018-04-30T16:44:00.553Z
Gyan
<p>I tried consequentially commands below. On output I'm getting video with a mess (even.mp4).</p>

<pre><code>ffmpeg -i in.MOV -an -vcodec rawvideo -pix_fmt yuv420p rawbitstream.yuv

ffmpeg -r 2 -s 640x480 -i rawbitstream.yuv -vf select="not(mod(n-1\,2))" -c:v rawvideo -r 1 -format rawvideo -pix_fmt yuv420p -an even.yuv

ffmpeg -f rawvideo -vcodec rawvideo -s 640x480 -r 25 -pix_fmt yuv420p -i even.yuv -c:v libx264 -preset ultrafast -qp 0 even.mp4
</code></pre>

<p><a href="https://i.sstatic.net/DMuje.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DMuje.jpg" alt="enter image description here"></a></p>

<p>Here is <a href="https://drive.google.com/open?id=1SQEPPZGB4ogf6cbczejbiyTdwK-1twfm" rel="nofollow noreferrer">full log</a>.
Video files are <a href="https://drive.google.com/open?id=1YfIwWo4FloOONNA8Fw05czAmWg3K__ei" rel="nofollow noreferrer">here</a>.</p>

CC BY-SA 3.0
2018-04-29T19:16:03.290Z
Share full log of commands
Gyan
CC BY-SA 3.0
2018-04-29T19:30:07.537Z
@Gyan see above.
R S
CC BY-SA 3.0
2018-04-29T19:42:11.560Z
How are you playing the output? Can you share the input?
Gyan
CC BY-SA 3.0
2018-04-29T21:37:12.983Z
@Gyan See the link above. Before I tried to play it with VLC (mess), but it worked in Parole Media Player.
R S
CC BY-SA 3.0
2018-04-30T05:17:45.500Z
So, the issue is with the profile. Do you need lossless?
Gyan
CC BY-SA 3.0
2018-04-30T09:25:40.680Z
@Gyan I would like do not lose quality of original video.
R S
CC BY-SA 3.0
2018-04-30T10:50:35.020Z
Lossless is unnecessary and most players can't play it.
Gyan
CC BY-SA 3.0
2018-04-30T12:45:18.307Z
@Gyan got it, could you provide answer with edited command(s) ?
R S
<ffmpeg><editing><conversion><raw>
ffmpeg. Converting through rawbitstream results to noise
R S
# ffmpeg. Converting through rawbitstream results to noise

(Asked by: username_0 on 2018-04-29)

I tried consequentially commands below. On output I'm getting video with a mess (even.mp4).
ffmpeg -i in.MOV -an -vcodec rawvideo -pix_fmt yuv420p rawbitstream.yuv

ffmpeg -r 2 -s 640x480 -i rawbitstream.yuv -vf select="not(mod(n-1\,2))" -c:v rawvideo -r 1 -format rawvideo -pix_fmt yuv420p -an even.yuv

ffmpeg -f rawvideo -vcodec rawvideo -s 640x480 -r 25 -pix_fmt yuv420p -i even.yuv -c:v libx264 -preset ultrafast -qp 0 even.mp4


Here is full log.
Video files are here.

**Tags:** ffmpeg, editing, conversion, raw

> **Comments:**
> **username_1**: Share full log of commands  
> **username_0**: @username_1 see above.  
> **username_1**: How are you playing the output? Can you share the input?  
> **username_0**: @username_1 See the link above. Before I tried to play it with VLC (mess), but it worked in Parole Media Player.  
> **username_1**: So, the issue is with the profile. Do you need lossless?  
> **username_0**: @username_1 I would like do not lose quality of original video.  
> **username_1**: Lossless is unnecessary and most players can't play it.  
> **username_0**: @username_1 got it, could you provide answer with edited command(s) ?  

---

## 1 answers

### Answer by username_1 on 2018-04-30. Score: 1 | Accepted answer

Use
ffmpeg -i in.MOV -an -vcodec rawvideo -pix_fmt yuv420p rawbitstream.yuv

ffmpeg -s 640x480 -i rawbitstream.yuv -vf select="not(mod(n+1\,2))" -c:v rawvideo -vsync 0 -an even.yuv

ffmpeg -f rawvideo -s 640x480 -pix_fmt yuv420p -i even.yuv -c:v libx264 -preset ultrafast -profile:v high -qp 1 even.mp4

> **Comments:**
> **username_0**: Thanks a lot. I would like also to understand what is -qp and how it works. Hard to find info about it.  
> **username_1**: Quantization parameter. It controls how the raw coefficients - the error residuals - are transformed. You need to wade into DSP for the details - see https://en.wikipedia.org/wiki/Quantization_(image_processing)  

---

