Changeset View
Standalone View
release/scripts/startup/bl_app_templates_system/Video_Editing/__init__.py
| Context not available. | |||||
| params = space.params | params = space.params | ||||
| params.use_filter_folder = True | params.use_filter_folder = True | ||||
| render = bpy.context.scene.render | |||||
ISS: This prevents user from saving his own timecode style in user preferences.
You would have to… | |||||
Done Inline ActionsAvoid using the context in versioning code, loop over bpy.data.scenes instead. campbellbarton: Avoid using the context in versioning code, loop over `bpy.data.scenes` instead. | |||||
| render.image_settings.file_format = 'FFMPEG' | |||||
Done Inline Actionsbpy.data.scenes is collection of scenes you have to iterate it or access by index. I assume that iterating is preferred even if there is only 1 scene. for scene in bpy.data.scenes:
render = scene.render
render.image_settings.file_format = 'FFMPEG'
preset = "h264_in_MP4"
filename = bpy.utils.preset_find(preset, preset_path="ffmpeg")
if filename:
bpy.utils.execfile(filename)
else:
print("Preset %r not found" % preset)
render.ffmpeg.audio_codec = "AAC"
render.ffmpeg.audio_bitrate = 256ISS: `bpy.data.scenes` is collection of scenes you have to iterate it or access by index. I assume… | |||||
| render.image_settings.file_format = "FFMPEG" | |||||
Done Inline ActionsI think setting this once should be enough :) ISS: I think setting this once should be enough :) | |||||
Done Inline ActionsThanks. tintwotin: Thanks. | |||||
| render.ffmpeg.format = "MPEG4" | |||||
| render.ffmpeg.codec = "H264" | |||||
| render.ffmpeg.constant_rate_factor = "PERC_LOSSLESS" | |||||
| render.ffmpeg.ffmpeg_preset = "REALTIME" | |||||
Not Done Inline ActionsThis can be moved into a utility function, for now this is OK though. campbellbarton: This can be moved into a utility function, for now this is OK though. | |||||
| scene = bpy.context.scene | |||||
| fps = scene.render.fps / scene.render.fps_base | |||||
| render.ffmpeg.gopsize = round(fps / 2.0) | |||||
| render.ffmpeg.use_max_b_frames = True | |||||
| render.ffmpeg.max_b_frames = 2 | |||||
Done Inline ActionsI have done test of influence of GOP and max B-frames value with default preset vs. proposed - Render time was pretty much same, filesize as well and seekability difference was impercievable. So I think we should set these to preset default - GOP: 18 and max B frames to False ISS: I have done test of influence of GOP and max B-frames value with default preset vs. proposed… | |||||
Done Inline ActionsJust as an FYI: According to this paper from 2010, GOP size influences video quality when viewing video over a wireless network. Higher GOP sizes are better when there is more traffic and therefore packet loss. The higher the GOP size, the lower the chance that consecutive I-frames packets are lost. Testing video quality on a local machine won't show this. =) Youtube recommends GOP size to be "half the frame rate" and "2 consecutive B frames." EAW: Just as an FYI: According to [this paper from 2010](https://www.researchgate. | |||||
| render.ffmpeg.video_bitrate = 8000 | |||||
| render.ffmpeg.maxrate = 8000 | |||||
| render.ffmpeg.minrate = 0 | |||||
| render.ffmpeg.buffersize = 224 * 8 | |||||
| render.ffmpeg.packetsize = 2048 | |||||
| render.ffmpeg.muxrate = 10080000 | |||||
Not Done Inline ActionsAren't these values ignored when you set constant_rate_factor to MEDIUM? ISS: Aren't these values ignored when you set `constant_rate_factor` to `MEDIUM`? | |||||
Done Inline ActionsI basically just the settings from this file: https://developer.blender.org/diffusion/B/browse/master/release/scripts/presets/ffmpeg/h264_in_MP4.py But since these settings also affect UI settings I've added: render.ffmpeg.constant_rate_factor = "MEDIUM" render.ffmpeg.ffmpeg_preset = "REALTIME" I know that using these preset values directly in a command line they'll override individual settings, but I do not know if this happens when set through the UI in Blender. tintwotin: I basically just the settings from this file: https://developer.blender. | |||||
Not Done Inline ActionsI have checked in code and these values are overridden We can keep them in case we want preset for constant bitrate, but I don't think it make sense really, so I would remove these ISS: I have checked in code and these values are overridden
We can keep them in case we want preset… | |||||
| render.ffmpeg.audio_codec = "AAC" | |||||
| render.ffmpeg.audio_bitrate = 384 | |||||
| def register(): | def register(): | ||||
| bpy.app.handlers.load_factory_startup_post.append(load_handler) | bpy.app.handlers.load_factory_startup_post.append(load_handler) | ||||
| Context not available. | |||||
This prevents user from saving his own timecode style in user preferences.
You would have to do this in load_factory_preferences_post handler as versioning change. And include userpref.blend file for sequencer.
See example in https://docs.blender.org/manual/en/latest/advanced/app_templates.html#template-scripts
Question is if this is OK to do UI wise, because none builtin template have own preferences. This can cause some confusion I think.
Also then any versioning change of preferences file would have to take sequencer preferences into account, which is not very nice.
So unless anybody has idea how to do this nicely, I disagree with this change.