Hi, MPEG4 encoding is rather poor. I’ve tried increasing encoding quality via the KBitRate for MPEG4 codec, and it didn’t make any difference. (The file size stays exactly the same).
Also, for certain bit rate, Drafts fails completely, saying “RuntimeError: could not open codec”
Would it be possible for you to please send us a copy of your script, along with some image files that reproduce the problem? You can send files to us using our ticket system.
In addition, could you please tell us the exact parameter values that gave you trouble? (Ideally the entire VideoEncoder() line with all of the parameter values.)
fail example: (if I used 10000 instead of 99999, then it will work, but producing really poor/heavily compressed result)
File “/mnt/Z/tools/production/review_tool/versions/farm/review_tool/lib/free_session.py”, line 512, in annotate_and_generate_movie
encoder = Draft.VideoEncoder( movie_out, 24, width, height, 99999, “MPEG4”, trim_audio_path, audio_offset )
RuntimeError: could not open codec
the compression/quality of H264 is really good (and it works fine for Draft). However, h264 encoded video caches/decompress substantially slower in RV. This is especially true when decompressing the video backwards, this necessary for scrubbing where RV caches both backwards and forward from the current playback point. Mpeg4 is better in this regard, where compression/quality as well as playback cache speed is optimal.
I will use H264 for now, picture quality is higher priority in this case.
Unfortunately for latest RV 3.12.16 as well as 3.12.14, the movie with encoded H264 doesn’t play. So now I am looking again back at the alternative of MJPEG or MPEG4…
MJEPG is ok, but the quality is still poor in comparison to that of H264 (also larger in file size because it’s not doing any inter-frame compression). The biggest draw back is there seem to be a max quality threshold for the bit per second setting, for example. There is no difference in file size if I set the bit rate at 16000 kbps vs 8000 kbps, any ideas why?
for MJPEG, I also notice the quality is inconsistent throughout the movie, for example, frame 1 is poor, frame 2 is best, then slowly degrades from there on…to poorest quality at the end of the movie. This is very noticeable for green text, which become so muddy it’s illegible.
Also the bits per second seems completely ignored when using MPEG4, has this been fixed?
No I’ve seen this one before. It’s really frustrating because you have to set it to super-human bit-depths for frame 1 sometimes to “seed” the DCT transforms or something. Increasing bit depth over-all can take really absurd values to fix. Can’t rememeber if I’ve seen it in Draft though.
MPEG4: Can you suggest some values I can try for the bit rate? from range 4000-8000, there is definitely no change in file size. BEYOND a certain rate, there simply no difference in quality, can you reproduce this? Unfortunately even at the best quality, the result is poor, substantially different comparing to H264. Also, there is color shift from the first frame to the rest of the movie.
I will email the package with all my sample data to thinkbox support
I’ve installed beta 10 a while ago, is there a command which can query the exact version?
Unfortunately not. I suspect we’re using FFmpeg’s rate control incorrectly. However I have gotten what I consider good results by specifying the quality instead of the bit rate. Quality controls should be included in the next Draft release.
It should print the version to stdout when you “import Draft”. You can also get the version as a string using the function:
Draft.LibraryInfo.Version()
For the latest beta, this should return “0.10.0.47171”.
I tested this in RV 3.12.17 on Linux and it seems to work without crashing. Unfortunately I don’t have any earlier versions around, so I’m not sure if this is a new fix.
Yes, could you please try the latest Draft Beta 12 build, and set quality=100?
For example:
enc = Draft.VideoEncoder( movie_out, 24, width, height, quality=100, codec="MPEG4", audioFilename=trim_audio_path, audioDelay=audio_offset )
(Please note that currently you must pass the codec, audioFilename, and audioDelay parameters by name if you set the quality.)