View Full Version : ffmpeg command line for lessless encoding
stax76
19th June 2017, 13:14
Is there something that can be improved in this command line? I have to admit I'm clueless about lossless encoding so I just shamelessly took the command line that megui is generating. -hide_banner and -y is from me, -sn and -an is clear but the rest? Might there be better codecs?
D:\Projekte\VS\VB\StaxRip\bin\Apps\ffmpeg\ffmpeg.exe -y -i D:\Temp\StaxRip\anamorphic_temp\anamorphic.avs -c:v ffvhuff -threads 0 -sn -an -context 1 -vstrict -2 -pred 2 -hide_banner -y D:\Temp\StaxRip\anamorphic_temp\anamorphic_lossless.avi
Input #0, avisynth, from 'D:\Temp\StaxRip\anamorphic_temp\anamorphic.avs':
Duration: 00:00:39.40, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576, nan fps, 50 tbr, 50 tbn, 50 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> ffvhuff (native))
Press [q] to stop, [?] for help
[ffvhuff @ 0000000002616ac0] Forcing thread count to 1 for huffyuv encoding with first pass or context 1
Output #0, avi, to 'D:\Temp\StaxRip\anamorphic_temp\anamorphic_lossless.avi':
Metadata:
ISFT : Lavf57.71.100
Stream #0:0: Video: ffvhuff (FFVH / 0x48564646), yuv420p, 720x576, q=2-31, 200 kb/s, 50 fps, 50 tbn, 50 tbc
Metadata:
encoder : Lavc57.89.100 ffvhuff
video:301592kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.017185%
LoRd_MuldeR
19th June 2017, 14:49
What do you mean with "better"?
I think "ffv1" will probably achieve significant better compression than "ffvhuff", but it's also a lot slower. And, of course, there is libx264 in "lossless" mode.
(Lagarith would be another option, but last time I checked FFmpeg only had a decoder for it)
stax76
19th June 2017, 15:03
I don't plan to make it configurable so it should be suitable for average users, it's for a feature to pre-render slow scripts into lossless AVI like what megui does.
juhok
19th June 2017, 15:42
There's encoder and decoder for utvideo also.
Atak_Snajpera
19th June 2017, 16:05
Yeah. I would use UTVideo. Fast , good compression ratio and easy to edit in NLE.
Groucho2004
19th June 2017, 16:13
+1 for UTVideo
stax76
19th June 2017, 16:17
I don't see utvideo with ffmpeg -formats
poisondeathray
19th June 2017, 16:20
I don't see utvideo with ffmpeg -formats
ffmpeg -codecs
stax76
19th June 2017, 16:32
ffvhuff is slower but compresses better:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Pre-render into lossless AVI using ffmpeg 3.3.1 x64
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
D:\Projekte\VS\VB\StaxRip\bin\Apps\ffmpeg\ffmpeg.exe -i D:\Temp\StaxRip\test_temp\test_new.avs -c:v ffvhuff -threads 0 -sn -an -context 1 -vstrict -2 -pred 2 -hide_banner -y D:\Temp\StaxRip\test_temp\test_new_lossless.avi
Input #0, avisynth, from 'D:\Temp\StaxRip\test_temp\test_new.avs':
Duration: 00:04:09.52, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> ffvhuff (native))
Press [q] to stop, [?] for help
[ffvhuff @ 0000000002636c00] Forcing thread count to 1 for huffyuv encoding with first pass or context 1
Output #0, avi, to 'D:\Temp\StaxRip\test_temp\test_new_lossless.avi':
Metadata:
ISFT : Lavf57.71.100
Stream #0:0: Video: ffvhuff (FFVH / 0x48564646), yuv420p, 1280x720, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.89.100 ffvhuff
video:1629562kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.010102%
Start: 17:10:51
End: 17:11:22
Duration: 00:00:31
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lossless AVI MediaInfo
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General
CompleteName : D:\Temp\StaxRip\test_temp\test_new_lossless.avi
Format : AVI
Format/Info : Audio Video Interleave
Format_Profile : OpenDML
FileSize/String : 1.55 GiB
Duration/String : 4 min 9 s
OverallBitRate/String : 53.5 Mb/s
Encoded_Application/String : Lavf57.71.100
Video
ID/String : 0
Format : HuffYUV
Format_Version : Version 2
CodecID : FFVH
Duration/String : 4 min 9 s
BitRate/String : 53.5 Mb/s
Width/String : 1 280 pixels
Height/String : 720 pixels
DisplayAspectRatio/String : 16:9
FrameRate/String : 25.000 FPS
ColorSpace : YUV
ChromaSubsampling/String : 4:2:0
BitDepth/String : 8 bits
ScanType/String : Progressive
Bits-(Pixel*Frame) : 2.322
StreamSize/String : 1.55 GiB (100%)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Pre-render into lossless AVI using ffmpeg 3.3.1 x64
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
D:\Projekte\VS\VB\StaxRip\bin\Apps\ffmpeg\ffmpeg.exe -i D:\Temp\StaxRip\test_temp\test_new.avs -c:v utvideo -sn -an -hide_banner -y D:\Temp\StaxRip\test_temp\test_new_lossless.avi
Input #0, avisynth, from 'D:\Temp\StaxRip\test_temp\test_new.avs':
Duration: 00:04:09.52, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> utvideo (native))
Press [q] to stop, [?] for help
Output #0, avi, to 'D:\Temp\StaxRip\test_temp\test_new_lossless.avi':
Metadata:
ISFT : Lavf57.71.100
Stream #0:0: Video: utvideo (ULY0 / 0x30594C55), yuv420p, 1280x720, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.89.100 utvideo
video:2211272kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.006664%
Start: 17:25:14
End: 17:25:26
Duration: 00:00:12
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lossless AVI MediaInfo
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General
CompleteName : D:\Temp\StaxRip\test_temp\test_new_lossless.avi
Format : AVI
Format/Info : Audio Video Interleave
Format_Profile : OpenDML
FileSize/String : 2.11 GiB
Duration/String : 4 min 9 s
OverallBitRate/String : 72.6 Mb/s
Encoded_Application/String : Lavf57.71.100
Video
ID/String : 0
Format : YUV
CodecID : ULY0
CodecID/Info : Ut Video Lossless Codec
CodecID/Hint : Ut Video
Duration/String : 4 min 9 s
BitRate/String : 72.6 Mb/s
Width/String : 1 280 pixels
Height/String : 720 pixels
DisplayAspectRatio/String : 16:9
FrameRate/String : 25.000 FPS
ColorSpace : YUV
ChromaSubsampling/String : 4:2:0
Compression_Mode/String : Lossless
Bits-(Pixel*Frame) : 3.151
StreamSize/String : 2.11 GiB (100%)
Groucho2004
19th June 2017, 16:48
ffvhuff is slower but compresses better:Try "-pred median" with utvideo.
stax76
19th June 2017, 16:56
Try "-pred median" with utvideo.
Great, same size then ffvhuff now but 3 times faster.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.