[MPlayer-dev-eng] Updated nailfps filter patches

Christopher "Monty" Montgomery xiphmont at gmail.com
Sun Nov 11 11:27:40 CET 2007


Attached are the following patches, seperated apart to make them easy
to read, but intended to be applied in sequence.  They are against SVN
of 2007/11/09.

The goal of these patches is to implement strict A/V sync when dumping
audio and video from mplayer; that is, when the outputs are (eg) -vo
yuv4mpeg and -ao pcm, the data written out has identical initial
offset and is lock-step synchronized through the entire dump, even
across discontinuities, seeks (not sure why anyone would try it), and
file transitions (eg, -fixed-vo).  The vf_nailfps by itself locks the
video stream to the fixed frame rate set by -fps.  When used with
af_nailsync, the audio is also locked to the video (in truth, the
video is locked to the audio, but that's a nitpick that will just
confuse users).  The rest of the patches are small changes required by
the new filters.

vfctrl_reset.patch: send a reset message to the vf pipeline on seek.
Also moves the vo_out reset call to vf_vo as recommended by iive.

afctrl_reset.patch: same idea for audio filters.

af_pts.patch: add and set .pts field to the af_data_t passed to audio
filters, indicating hte presentation timestamp of the first sample of
the passed audio data.

video_stallable.patch: Alter the new video frame generation code for
correct-pts to allow the video pipeline to stall (not require it to
produce a frame every loop). Stalling is supported by the
non-correct-pts code, and is required for nailfps to work with
nailsync (because the audio PTS is the important one, we need an audio
PTS before we can sync the first video frame to anything).

pcm_append.patch: Modify ao_pcm to not repeatedly overwrite the same
output file when dumping multiple files; it looks to see if the file
has already been opened once since starting, and if so appends rather
than overwrites.

vf_nailfps.patch: implements something like '-ofps' in a video filter
for use with MPlayer.  Split out from but also requires the next
patch...

af_nailsync.patch: Implements audio filter to fix the audio against
the fixed-rate video constructed by nailfps.  nailsync and nailfps as
implemented are in cahoots.

Example:

mplayer -vo yuv4mpeg:file=vidpipe -ao pcm:fast:file=wavpipe -vf
nailfps -af nailsync -fps 30000/1001 my-favorite-pr0n.wmv

... now works the way you would want it should with enforced sync
and corrected offset between vidpipe and wavpipe.

[before anyone complains, there is an exit() to kick out on an error
in the audio filter.  There's no way for an audio filter to return a
fatal error like a video filter can].

Monty
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vfctrl_reset.patch
Type: text/x-patch
Size: 1697 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071111/90fba122/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: afctrl_reset.patch
Type: text/x-patch
Size: 1900 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071111/90fba122/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: af_pts.patch
Type: text/x-patch
Size: 867 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071111/90fba122/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: video_stallable.patch
Type: text/x-patch
Size: 1664 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071111/90fba122/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pcm_append.patch
Type: text/x-patch
Size: 1057 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071111/90fba122/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vf_nailfps.patch
Type: text/x-patch
Size: 7854 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071111/90fba122/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: af_nailsync.patch
Type: text/x-patch
Size: 4806 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071111/90fba122/attachment-0006.bin>


More information about the MPlayer-dev-eng mailing list