开发者

Windows copy command does not concatenates video files properly [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I have concatenated 3 mpg files to one avi file using windows COPY command. I tried this from the command prompt as well as from my application that i created in C# (using system.diagnostics.process.start)

I found that the resultant file plays well on VLC but when i try to play the same file on Windows Media Player then the resultant file plays only parts belonging to 1st and 2nd mpg's and not the third one.Though the file size is perfect.

I also tried copying the 3 mpg files to output.mpg and then converting this to final.avi..But the problem is same

Command:

Copy /b first.mpg /b + second.mpg /b + third.mpg /b output.avi /b

can anybody suggest me what should i do or what could be the poss开发者_StackOverflow社区ible issue.

Thanks.


Concatenating files this way does not make sense. It actually only makes sense for plain text files (and even then, only if they don't include a BOM marker).

In general files have an internal structure, and concatenating two of these structures doesn't make it a valid new structure. E.g. take a simple HTML page:

<HTML>
<HEAD></HEAD>
<BODY>
   <H1>Hello World</H1>
</BODY>
</HTML>

If you concatenate two of these files you get this:

<HTML>
<HEAD></HEAD>
<BODY>
   <H1>Hello World</H1>
</BODY>
</HTML>
<HTML>
<HEAD></HEAD>
<BODY>
   <H1>Hello Again</H1>
</BODY>
</HTML>

But you problably want this:

<HTML>
<HEAD></HEAD>
<BODY>
   <H1>Hello World</H1>
   <H1>Hello Again</H1>
</BODY>
</HTML>

Therefore, concatenating files must be done using the correct software that knows the internal structure and knows how to correctly concatenate these files.

Because it may work in some cases, it doesn't mean that the resulting file is correct. Maybe in your example, VLC is rather forgiving and skips unrecognized blocks. Other media players may not be that forgiving and play only the first part, play nothing at all, or crash.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜