Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > DV
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th February 2016, 18:40   #1  |  Link
P.J
Δ
 
Join Date: Jun 2008
Posts: 535
How to change the Scan Order of avi?

Anyway to change the Scan Order of AVI container (DVsd) from BFF to TFF without re-encoding?
ReStream can do it but only for MPEG2/VOB
P.J is offline   Reply With Quote
Old 22nd February 2016, 17:35   #2  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
From what I read, this can not be specified in DV, it is always assumed to be BFF.
If you have to manipulate DV fields around you will have to do this physically, I guess.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 23rd February 2016, 10:26   #3  |  Link
P.J
Δ
 
Join Date: Jun 2008
Posts: 535
What if I remux it in .mov?
P.J is offline   Reply With Quote
Old 25th February 2016, 19:15   #4  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,744
If you need real TFF, you will have to convert, as suggested by Emulgator.
A simple header change is only appropriate when the Scan Order is wrong (for example if you specify TFF when you encode your avi while it's actually BFF).
MPEG4Modifier can do this with divx5 (an Xvid), maybe not with DVsd.
Music Fan is offline   Reply With Quote
Old 27th February 2016, 20:55   #5  |  Link
P.J
Δ
 
Join Date: Jun 2008
Posts: 535
MPEG4Modifier can't do it
Does any other container except avi support DVsd format?
P.J is offline   Reply With Quote
Old 28th February 2016, 01:02   #6  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,744
Maybe mkv but even if you find a way to change the parity, don't do it. If you specify TFF while it's BFF, the video won't be decoded properly.
Music Fan is offline   Reply With Quote
Old 28th February 2016, 15:22   #7  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by Music Fan View Post
Maybe mkv but even if you find a way to change the parity, don't do it. If you specify TFF while it's BFF, the video won't be decoded properly.
Agree entirely. Only way to do it AFAIK is by reversing the field dominance using the AVISynth ReverseFieldDominance filter:

http://avisynth.org.ru/docs/english/...ddominance.htm

So, yes, that will mean re-encoding if you plan to keep it in DV format. In which case you'd be wanting to transcode to the vfwMatrox DV codec which is TFF. Otherwise a lossless intermediate. Or use the Matrox DV codec as the decoder for AVISynth if you want to output TFF for transcoding to another TFF format.

Many moons ago I used to use the Matrox DV codecs before Cedocida came along.

http://www.matrox.com/video/en/suppo...es/version1.0/
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 28th February 2016 at 17:01.
WorBry is offline   Reply With Quote
Old 28th February 2016, 18:01   #8  |  Link
P.J
Δ
 
Join Date: Jun 2008
Posts: 535
Mkvtoolnix couldn't do it.
I don't wanna re-encode to avoid quality loss
P.J is offline   Reply With Quote
Old 28th February 2016, 18:06   #9  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,744
From Dvsd to Dvsd (with an avisynth process between both files), you won't see easily any difference.

By the way, ReStream don't transform tff in bff (or bff in tff), it only corrects bad parity, as MPEG4Modifier does with divx.
Parity can not be changed without re-encoding, whatever the codec.

Last edited by Music Fan; 28th February 2016 at 18:26.
Music Fan is offline   Reply With Quote
Old 28th February 2016, 19:01   #10  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by Music Fan View Post
From Dvsd to Dvsd (with an avisynth process between both files), you won't see easily any difference.
Exactly. If you do that though, use Cedocida's DV codec for the initial decode:
http://www.cithraidt.de/cedocida/index.html

and configure the output:



It's been a while since I used it, but IIRC the "DV" YV12 chroma sampling option is for direct pass-thru and only applies to PAL DV sources.

Edit: Ah yes, the explanation is given there in the codec description:

Quote:
Some remarks on "YV12 (DV)" input/output option in combination with NTSC video:
Because NTSC DV uses 4:1:1 subsampling type, you will see weird color when viewed with a normal YV12 program which assumes 4:2:0. This is no bug. If you need YV12 format for producing DVD content, use the option "YV12 (MPEG 2 *)".
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 28th February 2016 at 19:51.
WorBry is offline   Reply With Quote
Old 29th February 2016, 12:00   #11  |  Link
P.J
Δ
 
Join Date: Jun 2008
Posts: 535
Would you explain in depth? I'm not familiar with AviSynth and encoding =/
P.J is offline   Reply With Quote
Old 29th February 2016, 15:18   #12  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Have you used AviSynth and/or VirtualDub before at all ?

What system are you going to be putting these files into and for what goal - transcoding to another TFF format?

In other words, do you actually need DVsd.avi files with the fields reversed or is there scope for frame-serving TFF from AVISynth?
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 29th February 2016 at 15:40.
WorBry is offline   Reply With Quote
Old 5th March 2016, 05:36   #13  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
As per your PM, you confirmed that you want to create a DV file with the field order reversed.

It's been a while since I worked with DV, but having run a few tests I recall now that the Matrox DV codecs
are a PITA to use (and only output RGB) and that it can all be done using the Cedocida DV codec and
the ReverseFieldDominance filter.

You will need to get a little acquainted with AVISynth and processing scripts in VirtualDub, but there's no
lack of documentation for beginners - the AVISynth wiki for one:

http://avisynth.nl/index.php/Main_Page

So, here’s the procedure:

1.Install AVISynth:
https://sourceforge.net/projects/avisynth2/

2. Install VirtualDub:
https://sourceforge.net/projects/vir...?source=navbar
Note: "Open-up VirtualDub" in the procedures below means clicking on the VirtualDub.exe file in the folder that
you extracted the zip file to. For convenience create a shortcut to the exe file on your desktop.

3.Install ReverseFieldDominance plugin
http://web.archive.org/web/200910280...dominance.html

Download and unzip version 1.2 and copy the reversefielddominance.dll to the AVISynth plugins folder:

32bit Windows: C:\Program Files\AviSynth 2.5\plugins
64bit Windows: C:\Program Files (x86)\AviSynth 2.5\plugins

4. Install Cedocida DV codec
http://www.cithraidt.de/cedocida/index.html
Download and upzip version 0.2.3. Right click on the cedocida_dv_only.inf file and Install.
Open up VirtualDub >Video>Compression and you should see the Cedocida DV codec listed there.



Click on the Cedocida codec > Configure, and configure like so:



Set the appropriate aspect ratio for your DV source.
Click OK, to save configuration.

5. Open up Notepad and paste in this script:
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ReverseFieldDominance.dll")
#LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ReverseFieldDominance.dll")
#
AVISource("C:\...path...\Video.avi", audio=false).AssumeFPS(30000,1001)
AssumeBFF()
ReverseFieldDominance()
AssumeTFF()

Where,
Code:
AVISource("C:\...path...\Video.avi", audio=false).AssumeFPS(30000,1001)
is the path of your DV video and AssumeFPS is the framerate:
AssumeFPS(30000,1001) for NTSC 60i DV
AssumeFPS(25,1) for PAL 50i DV

Set the path of the ReverseFieldDominance.dll as appropriate for your system.

Name and save script as .avs file.

6.Open up the DV video file in VirtualDub and extract the WAV audio:
File>Open Video File>Save WAV. The encode job should autostart.

7.Open up the avs script in VirtualDub:
File>Open Video File and select the avs script. The video output should display.
Go to Video>Compression again, select the Cedcocida DV codec. Check the codec configuration is still as above. Click OK.
Select Fast Recompress
Go to Audio> Audio from another file, and select the extracted WAV audio
Go to File> Queue Batch operation>Save as AVI. Name and save the output avi file.
Go to Job>Start, to start encoding

The encoded avi file should now be DV with TFF field order.

I think that’s adequately in-depth, and serves as a good introduction to using AVISynth

P.S. Sorry about the text formatting.
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 10th March 2016 at 01:27.
WorBry is offline   Reply With Quote
Old 7th March 2016, 04:03   #14  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
@P.J. So were you successful in applying the above method ?
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 8th March 2016, 20:46   #15  |  Link
P.J
Δ
 
Join Date: Jun 2008
Posts: 535
Thank you very much

I'll try it soon, hope I can do it
P.J is offline   Reply With Quote
Old 9th March 2016, 02:45   #16  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Just follow the steps.
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 9th March 2016, 18:23   #17  |  Link
Mounir
Registered User
 
Join Date: Nov 2006
Posts: 773
with avisynth you can use this code to change the field dominance:
Quote:
avisource()
separatefields().trim(1,0).weave()
or also (u have to convert in yuy2 before):

Quote:
converttoyuy2(interlaced=true).crop(0,1,0,0).addborders(0,0,0,1).converttoyv12(interlaced=true)
Mounir is offline   Reply With Quote
Old 9th March 2016, 21:19   #18  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
The Reverse Field Dominance plugin requires YUY2 also - that's why I advised configuring the Cedocida codec as shown.
__________________
Nostalgia's not what it used to be
WorBry is offline   Reply With Quote
Old 9th March 2016, 21:29   #19  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,744
Quote:
Originally Posted by WorBry View Post
The Reverse Field Dominance plugin requires YUY2 also - that's why I advised configuring the Cedocida codec as shown.
Thus you should add converttoyuy2(interlaced=true) before ReverseFieldDominance() in your script.
And if you put converttoyv12(interlaced=true) after ReverseFieldDominance() in this script, you can configure the input as yv12 in the Cedocida settings, otherwise Cedocida will convert itself yuy2 to yv12 ; I don't know if it's as well done as with avisynth.
Music Fan is offline   Reply With Quote
Old 9th March 2016, 22:08   #20  |  Link
WorBry
Registered User
 
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
Quote:
Originally Posted by Music Fan View Post
Thus you should add converttoyuy2(interlaced=true) before ReverseFieldDominance() in your script.
Why? Note in the screenshot, Cedocida is configured to output YUY2.

Quote:
Originally Posted by Music Fan View Post
And if you put converttoyv12(interlaced=true) after ReverseFieldDominance() in this script, you can configure the input as yv12 in the Cedocida settings, otherwise Cedocida will convert itself yuy2 to yv12 ; I don't know if it's as well done as with avisynth.
As I recall, way back when, there was a lengthy forum discussion in which Cedocida himself clarified the internal color space transforms that take place, and there was confidence that all is performed correctly. So, yes, I could have just as easily added ConvertToYV12(interlaced=true) to script and configured the Cedocida encoder for YV12 input with "MPEG-2 interlaced" chroma subsampling. I tested the described method "as-is" and it works fine. So, for the O.P's benefit, probably best not to complicate matters with alternative approaches that amount to the same thing.

P.J, just do it as described and it will work just fine.
If you want to satisfy yourself that the field order is indeed changed to TFF, simply load the encoded avi file with this script:

Code:
AVISource("C:\...path...\EncodedVideo.avi", audio=false).AssumeFPS(30000,1001)
AssumeTFF()
SeparateFields()
And then, using the >> control button at the bottom of the VirtualDub screen, advance the video frame by frame. If it is TFF, the motion will be 'normal'. If it were BFF, it would jerk back and to.

The only thing that could complicate matters is if your source DV is in Type I format. In which case, you'll need to convert it to Type II beforehand:

http://www.videohelp.com/software/DV...pe-2-Converter

(As long as the source file is <4GB)

And let us know how you get on. We're all rooting for you
__________________
Nostalgia's not what it used to be

Last edited by WorBry; 9th March 2016 at 23:33.
WorBry is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.