There are 2 ways to do this, both of these scripts are distributed with Blender, but can be used outside of Blender, and involve reading the file using Python.
Extract information from the header, Blender writes the: Scene name, start-frame, end-frame into the file header in a way that can be extracted without reading the entire file.
You can test this from within Blender, assuming you have a file loaded:
import blend_render_info
import bpy
filepath = bpy.data.filepath
data = blend_render_info.read_blend_rend_chunk(filepath)
for frame_start, frame_end, scene_name in data:
print(frame_start, frame_end, scene_name)
The module blend_render_info.py comes with Blender (included under 2.77/scripts/modules/blend_render_info.py). And is a single-file Python module that can also be run directly, eg:
eg:
python 2.77/scripts/modules/blend_render_info.py /path/to/test.blend
Outputs for example:
1 250 Scene
This is a single-file Python module which implements a full blend file reader/writer.
This means you can do access any information you like, however doing so is more involved, as well as being slower since its needs to read the blend file - not just the header (although it will still be much faster then loading Blender, then the file).
This is an example of a script that prints scene frame, name and unlike the previous example, the output path.
#!/usr/bin/env python3
"""
This takes a blend file argument and prints out some of its details, eg:
blend_info.py /path/to/test.blend
"""
import blendfile
import sys
filepath = sys.argv[-1]
with blendfile.open_blend(filepath) as blend:
scenes = [b for b in blend.blocks if b.code == b'SC']
for scene in scenes:
name = scene[b'id', b'name'][2:].decode('utf-8')
path = scene[b'r', b'pic'].decode('utf-8')
frame_start = scene[b'r', b'sfra']
frame_end = scene[b'r', b'efra']
print(frame_start, frame_end, repr(name), repr(path))
Example output:
1 250 'Scene' '//'
Note: if you want to extract other info, you can use the Python interactive prompt, and call block.keys() to see which members are available. All keys are bytes, not strings, so take care not to mix this up.
This API is currently not documented, but the script is not so huge, for now you have to read the code to see whats possible.