user22266: I'm new in programming, I have some movies and want to convert them to hevc format to reduce storage space but keep quality video, i tried with my code through ffmpeg:
**for %b in (*.mp4) DO ffmpeg -y -i "%b" -r 30 -g 50000 -q 22  -filter:v scale=650:-1 -c:v libx264 -c:a aac -b:a 320k -ar 96000 -f hevc -pix_fmt yuv420p -b:v 10500k -strict experimental -shortest -x264-params -lossless 1 -tag:v hvc1 -movflags +faststart -threads 4 "output\%%~nb.hevc
Raw in pastebin
(The directory I tested: secufiles!
)
I tried changing a lot of code but the result is still the same, the video only has images without sound, ffmpeg says me: "-qscale is ignored, -crf is recommended.", Please help me Or give me an idea for this code.
I am really grateful for any help from you.
Thank you very much.

user1760: There is so much wrong with your command that it would take too long to list every issue. It will be simplest to just provide a corrected command:
ffmpeg -i input -c:v libx265 -crf 28 -c:a aac -b:a 128k -filter:v "scale=650:-2,format=yuv420p" -tag:v hvc1 -movflags +faststart output.mp4


If the input audio is already AAC consider stream copying with -c:a copy instead of re-encoding.
Depending on the input format this may not be worth the time, energy, and effort. Results may not be satisfactory if you are re-encoding lossy content. The artifacts present in the input can complicate the compression and result in a higher than expected file size and/or lower than expected quality.

For more info see:

FFmpeg Wiki: H.265
FFmpeg Wiki: AAC


22266: <p>I'm new in programming, I have some movies and want to convert them to hevc format to reduce storage space but keep quality video, i tried with my code through ffmpeg:</p>

<p>**<code>for %b in (*.mp4) DO ffmpeg -y -i "%b" -r 30 -g 50000 -q 22  -filter:v scale=650:-1 -c:v libx264 -c:a aac -b:a 320k -ar 96000 -f hevc -pix_fmt yuv420p -b:v 10500k -strict experimental -shortest -x264-params -lossless 1 -tag:v hvc1 -movflags +faststart -threads 4 "output\%%~nb.hevc</code></p>

<p><a href="https://pastebin.com/raw/6HAurdFz&quot;https://pastebin.com/raw/6HAurdFz&quot;" rel="nofollow noreferrer">Raw in pastebin</a></p>

<p>(The directory I tested: <a href="https://secufiles.com/i54x/MyTest.rar&quot;https://secufiles.com/i54x/MyTest.rar&quot;" rel="nofollow noreferrer">secufiles</a>!
)</p>

<p>I tried changing a lot of code but the result is still the same, the video only has images without sound, ffmpeg says me: "-qscale is ignored, -crf is recommended.", Please help me Or give me an idea for this code.</p>

<p>I am really grateful for any help from you.</p>

<p>Thank you very much.</p>
 1760: <p>There is so much wrong with your command that it would take too long to list every issue. It will be simplest to just provide a corrected command:</p>

<pre><code>ffmpeg -i input -c:v libx265 -crf 28 -c:a aac -b:a 128k -filter:v "scale=650:-2,format=yuv420p" -tag:v hvc1 -movflags +faststart output.mp4
</code></pre>

<ul>
<li><p>If the input audio is already AAC consider stream copying with <code>-c:a copy</code> instead of re-encoding.</p></li>
<li><p>Depending on the input format this may not be worth the time, energy, and effort. Results may not be satisfactory if you are re-encoding lossy content. The artifacts present in the input can complicate the compression and result in a higher than expected file size and/or lower than expected quality.</p></li>
</ul>

<p>For more info see:</p>

<ul>
<li><a href="https://trac.ffmpeg.org/wiki/Encode/H.265" rel="nofollow noreferrer">FFmpeg Wiki: H.265</a></li>
<li><a href="https://trac.ffmpeg.org/wiki/Encode/AAC" rel="nofollow noreferrer">FFmpeg Wiki: AAC</a></li>
</ul>
