add some docs info

This commit is contained in:
Nicolas Le Goff 2012-06-06 11:14:39 +02:00
commit 1c047458c5

View file

@ -73,14 +73,24 @@ Simple transcoding
To transcode a video, you have to pass the target format to FFMpeg.
When you define a format which implements the
:ref:`Resizable <resizable-reference>` interface.
You must set FFprobe (see :ref:`FF-probe<ffprobe-reference>`)
for probing the media and found its height and size.
The following example initialize a Ogg format and encodes a `Video.mpeg` to a
target file `file.ogv` :
.. code-block:: php
<?php
use FFMpeg\FFProbe;
use FFMpeg\Format\Video\Ogg;
$ffprobe = FFProbe::load($logger);
$ffmpeg->setProber($ffprobe);
$oggFormat = new Ogg();
$ffmpeg->open('Video.mpeg')
@ -178,6 +188,8 @@ Advanced media type
This section presents usage for the different interfaces. You can combine
them for your own formats.
.. _resizable-reference:
Resizable
.........
@ -207,13 +219,15 @@ The example below resizes a video by half.
->encode($format, 'file.mp4')
->close();
.. _resamplable-reference:
Resamplable
...........
This interface provides video resampling. The example below resample the video
at 15 frame per second with a I-frame every 30 image (see
`GOP on wikipedia <https://wikipedia.org/wiki/Group_of_pictures>`_).
`GOP on wikipedia <https://wikipedia.org/wiki/Group_of_pictures>`_) and supports
B-frames (see `B-frames on wikipedia <https://wikipedia.org/wiki/Video_compression_picture_types>`_)
.. code-block:: php
@ -234,6 +248,10 @@ at 15 frame per second with a I-frame every 30 image (see
return 30;
}
public function supportBFrames()
{
return true;
}
}
$format = new MyFormat();
@ -477,6 +495,8 @@ latest AvConv / FFMPeg version, aac encoding has to be executed with extra comma
->encode($format, 'output-aac.mp4')
->close();
.. _ffprobe-reference:
FFProbe recipes
---------------