Re: Restore/set aspect ratio header in DV files?

Dan Dennedy <[email protected]>
Newsgroups gmane.comp.video.kino.devel
Message-ID <[email protected]>
On Tue, May 26, 2009 at 12:14 PM, Richard Rasker <[email protected]> wrote:
> Op dinsdag 26-05-2009 om 09:52 uur [tijdzone -0700], schreef Dan
> Dennedy:
>> On Tue, May 26, 2009 at 5:57 AM, Richard Rasker <[email protected]> wrote:
>
> [snip Cinelerra messes up DV aspect ratio]
>
>> > The basic question is simple: is there a way to force a 16:9 aspect
>> > ratio onto a DV file -- iow: set the 16:9 aspect ratio header in the DV
>> > file? Kino's Edit -> Preferences -> Defaults offer an aspect ratio
>> > setting, but this is apparently overridden by the project/video file, so
>> > Cinelerra's faulty header settings are not changed.
>> >
>>
>> It depends upon your definition of easy and what you are willing to
>> sacrifice. :-) I see 2 ways: transcode with ffmpeg using the -aspect
>> option, or write a little C program using libdv to change the
>> metadata. With the transcode you will lose a little quality, but not
>> much, and it takes time and space. And at least you can use the
>> -threads option to make it faster.
>
> OK, the ffmpeg command seems to work fine already, thanks a lot!
>
> About the C program: I'd really like that solution, as it sounds much
> cleaner and faster than transcoding. But alas, I'm not really a
> proficient C programmer, to put it mildly. Nevertheless, I'd like to
> give it a serious try, if someone can start the wool on for me, as it
> were :-) And perhaps I could even supply a fix for Cinelerra ...
>
> So what DV metadata would need changing, exactly? Is this metadata

See
void dv_encode_metadata(uint8_t *target, int isPAL, int is16x9, time_t
*datetime, int frame);

where target is a frame of raw DV and the last param, frame, is a
number incrementing for each frame.

> contained in every frame, or is it just one header somewhere at the
> start of the DV file? And could you name an example of a source file
> which performs a similar operation on a DV file?

The libdv tarball contains reppm.c and recode.c. recode.c reads from
stdin and writes to stdout, which might provide a suitable model for
you, and reppm.c contains an example call to dv_encode_metadata().

-- 
+-DRD-+

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.