Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mORMot2 FFmpeg Multi-Process Demo
- 2.4.14669 4
- > FFmpeg detected: \mORMot2\ex\external-process\exe\ffmpeg.exe
- ffmpeg version 2026-04-06-git-7fd2be97b9-essentials_build-www.gyan.dev Copyright (c) 2000-2026 the FFmpeg developers
- =============================================================
- Demo 1: Single FFmpeg instance - graceful "q" stdin shutdown
- =============================================================
- > Command:
- \mORMot2\ex\external-process\exe\ffmpeg.exe -y -hide_banner -loglevel info -re -f lavfi -i testsrc=size=640x480:rate=30 -t 15 -c:v libx264 -preset ultrafast -f null -
- > Started pid=11912 - letting it encode for 2 seconds...
- > collected 1200 bytes of stderr output so far:
- Side data:
- CPB properties: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
- frame= 45 fps= 29 q=15.0 size=N/A time=00:00:01.50 bitrate=N/A speed=0.974x elapsed=0:00:01.54
- > Sending "q"#10 to FFmpeg stdin for graceful shutdown...
- 264 @ 00000249fcb785c0] frame I:1 Avg QP:20.00 size: 13202
- [libx264 @ 00000249fcb785c0] frame P:76 Avg QP:15.34 size: 814
- [libx264 @ 00000249fcb785c0] mb I I16..4: 100.0% 0.0% 0.0%
- [libx264 @ 00000249fcb785c0] mb P I16..4: 2.5% 0.0% 0.0% P16..4: 6.8% 0.0% 0.0% 0.0% 0.0% skip:90.7%
- [libx264 @ 00000249fcb785c0] coded y,u,v intra: 3.6% 2.4% 2.0% inter: 1.1% 1.1% 0.9%
- [libx264 @ 00000249fcb785c0] i16 v,h,dc,p: 82% 4% 1% 12%
- [libx264 @ 00000249fcb785c0] kb/s:234.06
- > Result:
- exit code: 0 (0 = clean graceful exit)
- total time: 2250 ms
- =============================================================
- Demo 2: THREE concurrent FFmpeg instances, stopped one by one
- =============================================================
- [Deck1-testsrc pid=11660 started]
- [Deck2-smptebars pid=28068 started]
- [Deck3-mandelbrot pid=6800 started]
- > Letting all 3 decks encode for 2 seconds...
- > Stopping Deck2 gracefully (q#10)...
- [Deck2 exited with code=0]
- Deck1 running=1 Deck3 running=1
- > Remaining decks keep running for 1 more second...
- > Stopping Deck1 gracefully (q#10)...
- [Deck1 exited with code=0]
- Deck3 running=1
- > Stopping Deck3 gracefully (q#10)...
- [Deck3 exited with code=0]
- > All 3 decks stopped independently - sibling isolation confirmed
- =============================================================
- Demo 3: Graceful "q" vs hard Terminate()
- =============================================================
- > Run A: graceful "q" shutdown...
- exit code = 0 (expect 0)
- OK: FFmpeg printed final encoding summary (clean flush)
- > Run B: hard Terminate() without "q"...
- exit code = 255 (usually non-zero: hard kill)
- no final summary - encoder did not flush (expected for hard kill)
- === All FFmpeg demos complete ===
- Press Enter to exit...
Advertisement
Add Comment
Please, Sign In to add comment