Streams
Stream objects represent the flow of multimedia data through the processing pipeline.
Stream Class
pyffmpeg.node.Stream
Bases: GeneratedFiltersMixin
Represents a single output stream from a node.
Source code in src/pyffmpeg/node.py
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | |
audio
property
Accesses the audio elementary stream component.
Returns:
| Name | Type | Description |
|---|---|---|
TypedStream |
TypedStream
|
An object representing the audio component of this stream. |
video
property
Accesses the video elementary stream component.
If the video stream wrapper has not been accessed before for this node, creates and caches a new 'TypedStream' instance representing video.
Returns:
| Name | Type | Description |
|---|---|---|
TypedStream |
TypedStream
|
An object representing the video component of this stream. |
node
property
Retrieves all output streams produced by the source filter node.
This property allows access to the complete list of outputs generated by the filter that created this specific stream instance (accessing sibling streams).
Returns:
| Type | Description |
|---|---|
list[Stream]
|
list[Stream]: A list of all output streams from the parent FilterNode. |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If the source node is not a FilterNode (e.g., it is an InputNode), as it does not perform filtering operations. |
__init__(source_node)
Source code in src/pyffmpeg/node.py
426 427 428 429 | |
__getitem__(key)
Allows accessing elementary stream contained in this Stream
Source code in src/pyffmpeg/node.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | |
filter(filter_name, *args, **kwargs)
Custom filter with a single input and a single output
Source code in src/pyffmpeg/node.py
579 580 581 | |
filter_multi_output(filter_name, *args, **kwargs)
Creates a custom filter allowing dynamic creation of output streams
Source code in src/pyffmpeg/node.py
583 584 585 586 587 588 589 590 591 592 593 594 | |
output(filename, streams=None, format=None, vcodec=None, acodec=None, video_bitrate=None, audio_bitrate=None, aspect=None, frames=None, shortest=False, **kwargs)
Creates an output node for this stream, optionally muxing other streams.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
The output file path or URL. |
required |
streams
|
list[Stream] | None
|
Additional streams to include in the output (e.g., audio tracks, subtitles) alongside the current stream. |
None
|
format
|
str | None
|
Force output format (ffmpeg flag: |
None
|
vcodec
|
str | None
|
Video codec (ffmpeg flag: |
None
|
acodec
|
str | None
|
Audio codec (ffmpeg flag: |
None
|
video_bitrate
|
str | int | None
|
Video bitrate (ffmpeg flag: |
None
|
audio_bitrate
|
str | int | None
|
Audio bitrate (ffmpeg flag: |
None
|
aspect
|
str | float | None
|
Set aspect ratio (ffmpeg flag: |
None
|
frames
|
int | None
|
Number of video frames to output (ffmpeg flag: |
None
|
shortest
|
bool
|
Finish encoding when the shortest input stream ends. |
False
|
**kwargs
|
Additional output options. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
OutputNode |
OutputNode
|
The created output node. |
Source code in src/pyffmpeg/node.py
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | |
Elementary Streams
pyffmpeg.node.TypedStream
Bases: Stream
Elementary stream representing specific type of media out of those contained within a Stream
Source code in src/pyffmpeg/node.py
658 659 660 661 662 663 664 665 666 667 668 669 | |
__getitem__(_)
Raises ValueError
Source code in src/pyffmpeg/node.py
666 667 668 669 | |
pyffmpeg.node.IndexedStream
Bases: Stream
Elementary stream represented by index within the containing stream
Source code in src/pyffmpeg/node.py
672 673 674 675 676 677 678 679 680 681 682 | |
__getitem__(_)
Raises ValueError
Source code in src/pyffmpeg/node.py
680 681 682 | |