Log in

View Full Version : Splitting videos - nonlinear video editing


Theo_newbie
20th April 2003, 17:52
I have been investigating AVISynth with a view to the splitting of files for some time, but have found that the following limitations seems to make it difficult to use:

1) Limited application program support. Virtualdub works and actually opens MPEG1/2 files using the DirectShowSource command (Windows Media Player 6.4 does not seem to work on my computers). However one can only save as an AVI file in Virtualdub, not MPEG files. Although one could use say a MPEG4 codec in Virtualdub, I would really like to avoid decompressing the video file (do a direct stream copy in Virtualdub). Unfortunately this doesn't work properly in Virtualdub with MPEG2 files (Virtualdub does not have a MPEG export option as far as I know). TMPGEnc reads AVS files, but the same script file that works in Virtualdub unfortunately doesn't work in TMPGEnc. I also couldn't get AVS files working in Adobe Premiere.

2) As far as I can tell AVISynth does not have a command for splitting videos or exporting the finished video as a MPEG or AVI file. Relying on the application program (Virtualdub) to save the video file does not work well. I could of course save as an AVI file and then use TMPGEnc to encode the resulting file to MPEG format. However, due to the number of splits to be performed in the video file this is really not an attractive option.

3) The import of MPEG2 files with AVISynth only seems to work in Virtualdub at present. As far as I can tell, no MPEG2 export function is available in AVISynth.

Another option would be to use the 'Merge and cut' feature under the 'MPEG Tools' section of TMPGEnc. Unfortunately I don't know of an easy way to import my split list (consisting of in-out points in the source file and output filenames) into 'MPEG Tools' of TMPGEnc.

Any help with the above would be greatly appreciated.


Best regards,
Theo

sh0dan
20th April 2003, 18:08
Study avisynth.org

>Virtualdub works and actually opens MPEG1/2 files using the DirectShowSource command.

Use mpeg2dec3 or mpegdecoder plugin for mpeg2 / mpeg1.

>However one can only save as an AVI file in Virtualdub, not MPEG files.

Both TMPGEnc and CCE opens AviSynth files and encodes MPEG nicely.

>TMPGEnc reads AVS files, but the same script file that works in Virtualdub unfortunately doesn't work in TMPGEnc.

Read the FAQ!

>I also couldn't get AVS files working in Adobe Premiere.

Read the FAQ! There is a plugin, ffvfw and link2 works perfectly! THREE solutions - do you want more?

>As far as I can tell AVISynth does not have a command for splitting videos or exporting the finished video as a MPEG or AVI file.

This is not the job of AviSynth.

>I could of course save as an AVI file and then use TMPGEnc to encode the resulting file to MPEG format.

I have personally done this with thousands of clips - besides TMPGEnc opens AVS scripts nicely

>The import of MPEG2 files with AVISynth only seems to work in Virtualdub at present. As far as I can tell, no MPEG2 export function is available in AVISynth.

:readfaq:

Si
20th April 2003, 21:03
...Virtualdub works and actually opens MPEG1/2 files ...

A modified version of VirtualDub has only been able to directly open MPEG-2 files for a few months - this is after years of existance. So maybe in a few momths time Avisynth will be able to as well - in the meantime there are several workarounds available in Avisynth. Your expectations are unfortunately exceeded by reality. :(

regards
Simon

Theo_newbie
20th April 2003, 22:56
>Study avisynth.org

Thanks, I have already visited a number of times but couldn't find an answer to my question of splitting video files and saving MPEG files to disk. Could you give me a specific reference to answer my question?

>>Virtualdub works and actually opens MPEG1/2 files using the >>DirectShowSource command.

>Use mpeg2dec3 or mpegdecoder plugin for mpeg2 / mpeg1.

I have downloaded and tried all of the MPEG2 decoders mentioned in the FAQ at www.avisynth.org. Most of them simply don't work on my computer (message something like 'cannot open file'). Possibly I am doing something wrong, but I could not find detailed documentation on usage. I am looking for a simple MPEG test file and AVS script which should work on any computer (some decoders only work with a specific version of AVISynth, which I find rather strange).


>>However one can only save as an AVI file in Virtualdub, not MPEG >>files.

>Both TMPGEnc and CCE opens AviSynth files and encodes MPEG nicely.

How about splitting a video file into multiple sections, with each section a different filename - is it possible to do this with TMPGEnc?

>>TMPGEnc reads AVS files, but the same script file that works in >>Virtualdub unfortunately doesn't work in TMPGEnc.

>Read the FAQ!

Thanks for your comment, but even if I could get TMPGEnc to read AVS files, it wouldn't seem to solve the problem of splitting a video file. As far as I know AVISynth always returns a single video stream to the application? Is there perhaps an option to save a video stream to disk and then load a new file?

>>I also couldn't get AVS files working in Adobe Premiere.

>Read the FAQ! There is a plugin, ffvfw and link2 works perfectly! >THREE solutions - do you want more?

Thanks for your comment, but this is not a solution to my problem of splitting the files as far as I can tell. For other applications it would be of help and I might give it a try. By the way, are you referring to the FAQ at www.avisynth.org?


>>As far as I can tell AVISynth does not have a command for splitting >>videos or exporting the finished video as a MPEG or AVI file.

>This is not the job of AviSynth.
I am not the developer of the software, but would imagine that any piece of software should try to solve some real word problems. If the splitting of videos into clips is not something that AVISynth can do, I obviously have to look somewhere else.


>>I could of course save as an AVI file and then use TMPGEnc to >>encode the resulting file to MPEG format.

>I have personally done this with thousands of clips - besides >TMPGEnc opens AVS scripts nicely

Yes, but I want to split a single video file into multiple clips (not just on a single clip). Unfortunately AVISynth can only return a single video file to TMPGEnc. To open a separate AVS file for each split doesn't seem a good idea to me (if one have many splits as in my case).

>>The import of MPEG2 files with AVISynth only seems to work in >>Virtualdub at present. As far as I can tell, no MPEG2 export >>function is available in AVISynth.
>>
>>
>>
>>
>>__________________
>Regards, sh0dan // VoxPod
>[AviSynth 2 project] - [AviSynth 2/2.5 CVS binaries]
>
>
>
>quote:
>>-------------------------------------------------------------------->>------------
>>
>>
>>...Virtualdub works and actually opens MPEG1/2 files ...
>>
>>-------------------------------------------------------------------->>------------
>>
>>
>A modified version of VirtualDub has only been able to directly >open MPEG-2 files for a few months - this is after years of >existance. So maybe in a few momths time Avisynth will be able to >as well - in the meantime there are several workarounds available >in Avisynth. Your expectations are unfortunately exceeded by >reality.
If by expectations you mean the ability to read and write MPEG files, I don't consider that unrealistic at all. As far as I know most DVD players use MPEG compression. I don't quite understand your reply - I have been able to open MPEG2 files in Virtualdub using the DirectShowSource command (and the Elcard MPEG2 decoder). However, the same script doesn't work in Windows Media Player 6.4.

Best regards,
Theo

Zhnujm
21st April 2003, 01:40
i think you misunderstood the concept behind avisynth. it opens multimedia files, change them with varios filters and then delivers UNCOMPRESSED audio + video frames to any application. what happens behind this point is out of control of avisynth, it is completely in the hand of your target application.

and as lets say virtualdub only gets uncompressed data from avisynth it is not possible to save the audio or video without recompressing.
or in other words, if you use avisynth you have to reencode your file, there is no other way.

its not possible to use it for splitting without reencoding.

Theo_newbie
21st April 2003, 11:04
>i think you misunderstood the concept behind avisynth. it opens >multimedia files, change them with varios filters and then delivers >UNCOMPRESSED audio + video frames to any application. what happens >behind this point is out of control of avisynth, it is completely in >the hand of your target application.
>
>and as lets say virtualdub only gets uncompressed data from avisynth >it is not possible to save the audio or video without recompressing.
>or in other words, if you use avisynth you have to reencode your >file, there is no other way.
>
>its not possible to use it for splitting without reencoding.

Thanks for your explanation and sorry about my mistake. Is it possible to do spitting of video files with encoding using AVISynth?

As it seems like AVISynth is not meant for scripting of more than one video file, do you perhaps know of other video editing programs that can be used for scripting purposes (something like Sonic Foundry Sound Forge for audio that allows multiple selections or regions to be saved to disk)?

Best regards,
Theo

Zhnujm
21st April 2003, 19:28
im not exactly sure what you want to do, but you can surely select regions of your file in avisynth with the trim() command, or add multiple files in your script. but the target file will always depend on your application.

if you simply want to cut parts of your mpeg files without reencoding you can try somehting like tmpegenc mpeg-tools, mpeg2-vcr or similar.
but i must say i have not found a good and reliable solution for that. (and i have tried alot of programs, including the 2 above)


--edit--

just read that you want to split mpegs into multiple files.
if you dont fear reencoding the parts, why not load the file via avisynth into tmpeg and cut them with tmpegs source range filter ? its as easy as in vdub.
and make sure you dont use directshowsource() to load the files, its a real pain for editing.

Si
21st April 2003, 19:53
I'm sorry I am confusing you.
You are correct - Avisynth doesn't do what you want/expect.

I suggest using something else.

Have a nice day :D

regards
Simon

Theo_newbie
22nd April 2003, 00:26
>im not exactly sure what you want to do, but you can surely select >regions of your file in avisynth with the trim() command, or add >multiple files in your script. but the target file will always >depend on your application.
>
>if you simply want to cut parts of your mpeg files without >reencoding you can try somehting like tmpegenc mpeg-tools, mpeg2-vcr >or similar.
>but i must say i have not found a good and reliable solution for >that. (and i have tried alot of programs, including the 2 above)
>
>
>--edit--
>
>just read that you want to split mpegs into multiple files.
>if you dont fear reencoding the parts, why not load the file via >avisynth into tmpeg and cut them with tmpegs source range filter ? >its as easy as in vdub.
>and make sure you dont use directshowsource() to load the files, its >a real pain for editing.
>
>
>
>Last edited by Zhnujm on 21st April 2003 at 21:37

Thanks for your comments and feedback. The MPEGTools of TMPGEnc can already read MPEG2 files, so I can see little advantage in using AVISynth with TMPGEnc. Except that it may offer a way to read the split (in/out) points from a text file - although I am not sure if AVISynth can read plain text files? However, as one would have to setup an AVS file for each split in TMPGEnc it would be a laborious task to split all the files (AVISynth can only output one file as far as I know). As far as I know it is not possible to load a text file with split points in TMPGEnc (or a list of AVI files to be encoded to MPEG2 format)?
Why would you recommend not to use directshowsource() command for editing?
Do you perhaps know of other video editing programs that would accept scripts / command line parameters? I can, for example, generate a Virtualdub script to split the files, but Virtualdub doesn't seem to have a MPEG2 decoder, so I would have to reencode the splitted files again.

Best regards,
Theo

Zhnujm
22nd April 2003, 22:09
so you have already a text file with split point for your files ?
what i meant above was not using the mpeg-tools but tmpeg directly (it has the same editing functions as vdub, and you can do a batch encode after selecting all your parts). of course that would also need a reencode. and you cannot import your cuts file.
dont know if theres a program that can import such a file and split your mpegs directly, sorry.

i came across this http://mpgtx.sourceforge.net last week (i was searching for a command line utility for mpeg splitting to integrate in my dvb project), but i have not tried it yet, maybe its crap.

i was just suggesting not to use directshowsource because it is very slow and crashes a lot if you try to edit the file with vdub or whatever. its ok for encoding.

do you need exact split points or do you only want to split the files at let say a specific size or x parts ?

Theo_newbie
24th April 2003, 12:38
>so you have already a text file with split point for your files ?

Yes, I have a text file with the source filename, in point, out point and target filename on each line.

>what i meant above was not using the mpeg-tools but tmpeg directly >(it has the same editing functions as vdub, and you can do a batch >encode after selecting all your parts). of course that would also >need a reencode. and you cannot import your cuts file.
>dont know if theres a program that can import such a file and split >your mpegs directly, sorry.

I wonder if the source code for the MPEGTools of TMPGEnc is available? Then it might be possible to compile a command line version that could import a cut file...

>i came across this http://mpgtx.sourceforge.net last week (i was >searching for a command line utility for mpeg splitting to integrate >in my dvb project), but i have not tried it yet, maybe its crap.

Thanks, I'll have a look.

>i was just suggesting not to use directshowsource because it is very >slow and crashes a lot if you try to edit the file with vdub or >whatever. its ok for encoding.
>

Thanks for the feedback.

>do you need exact split points or do you only want to split the >files at let say a specific size or x parts ?

For the cut file I need exact split points. However, splitting into 1 of x parts could be useful e.g. for splitting a MPEG file to fit onto a CD.
Best regards,
Theo