Sujet : Re: More Funny Stuff From The Joke Python
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.advocacyDate : 09. Jun 2024, 03:09:50
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v42vcu$2u4lh$14@dont-email.me>
References : 1 2 3 4 5 6
User-Agent : Pan/0.158 (Avdiivka; )
On Sat, 08 Jun 2024 17:32:14 -0400, Joel wrote:
I can't imagine I'd need anything beyond C.
Python lets you get things done more quickly.
Example: a client needed to extract sensor data from MPEG-4 movies
recorded with GoPro cameras. I wrote a Python script which spawned the
“ffprobe” command (part of the FFmpeg suite) to dump out the stream
listing in JSON format, which was easy enough to parse. Then, having
identified the stream containing the instrumentation data, another ffprobe
call gave me the locations in the file (and the movie timestamps) for the
individual packets in that stream.
The actual packets were easy enough to decode from the GoPro docs (with
some adjustments for the inevitable discrepancies between what they say
and what they do), using the struct module
<
https://docs.python.org/3/library/struct.html> from the standard Python
library to extract the bits.
Net result: a bit over 700 lines of Python code needed.