Joining wmv files

"Please leave a message at the beep, we will get back to you when your support contract expires."

Moderators: phlip, Larson, Moderators General, Prelates

Joining wmv files

Postby RedWolf » Sun May 03, 2009 3:13 am UTC

If anybody can't solve the problems below but knows of another way to join wmvs, please let me know.

Here's the situation. I'm trying to use hjsplit to join multiple wmvs together. I appended the necessary numbers to the end of their extensions (e.g. myfile.wmv.001). Everything appears to work fine (that is, I can locate the first .001 file and wait a minute for it to say it has finished joining). The final file is approximately 500 MB, like it should be, however! when I open the final file, the video is equivalent to only the last wmv file joined, i.e. the file is 500 MB but I can only watch the last minute or so (It should be about 16 minutes long)

I have tried joining only the first two files together, but that gives the same result: the file size is accurate, but the video itself only shows the last wmv added.

The reason I'm using hjsplit instead of Windows Movie Maker is because WMM doesn't work either for more unknown reasons, telling me to check if the original source files are still available, the saving location is still available, and there is enough free disk space, even though the source files haven't moved, the saving location should be available, and there is more than enough free disk space.
User avatar
RedWolf
 
Posts: 236
Joined: Mon Dec 31, 2007 8:19 pm UTC

Re: Joining wmv files

Postby hotaru » Sun May 03, 2009 4:21 am UTC

mencoder?

i'm pretty sure this should do it:
Code: Select all
mencoder -oac copy -ovc copy -of lavf -lavfopts format=asf myfile.wmv.001 myfile.wmv.002 -o myfile.wmv


basically your problem is like this:
you have several small boxes (asf container files) with small blocks (video and audio streams) in them. you want to combine the small blocks into one big block and then put it into a single large box. using hjsplit (or cat or the windows "copy" command with "+") is like gluing the small boxes together. the result is about the same size as what you want, but not what you want.

mencoder knows enough about the formats involved to take the streams out of their containers and combine them, and then make a new container to put the result in.
Code: Select all
#include <stdio.h>

int main()
{
 struct { unsigned a:3, b:3, c:2; } n = {0};
  do do printf("%hhu\n", *&n);
  while(!(n.a-- && !++n.b));
  while(++n.c);
  return 0; } 
User avatar
hotaru
 
Posts: 931
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Joining wmv files

Postby mrbaggins » Sun May 03, 2009 11:23 am UTC

Download and try WMM2?
Why is it that 4chan is either infinitely awesome, infinitely bad, or "lolwut", but never any intermediary level?
User avatar
mrbaggins
 
Posts: 1609
Joined: Tue Jan 15, 2008 3:23 am UTC
Location: Wagga, Australia

Re: Joining wmv files

Postby RedWolf » Sun May 03, 2009 5:10 pm UTC

hotaru:
That sounds like it may work. I downloaded mplayer from their site, but I can't seem to find mencoder anywhere... where would I find that?

mrbaggins:
I am using WMM2. Sorry for the misunderstanding.
User avatar
RedWolf
 
Posts: 236
Joined: Mon Dec 31, 2007 8:19 pm UTC

Re: Joining wmv files

Postby hotaru » Sun May 03, 2009 5:22 pm UTC

RedWolf wrote:hotaru:
That sounds like it may work. I downloaded mplayer from their site, but I can't seem to find mencoder anywhere... where would I find that?

it should be included with mplayer. look for mencoder.exe in the same folder as mplayer.exe.
Code: Select all
#include <stdio.h>

int main()
{
 struct { unsigned a:3, b:3, c:2; } n = {0};
  do do printf("%hhu\n", *&n);
  while(!(n.a-- && !++n.b));
  while(++n.c);
  return 0; } 
User avatar
hotaru
 
Posts: 931
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Joining wmv files

Postby Emu* » Sun May 03, 2009 6:52 pm UTC

Won't WMM unencode and reencode everything, rather than just gluing the containers together? JPEG fuzz etc?
Cosmologicon wrote:Emu* implemented a naive east-first strategy and ran it for an hour, producing results that rivaled many sophisticated strategies, visiting 614 cells. For this, Emu* is awarded Best Deterministic Algorithm!
User avatar
Emu*
 
Posts: 689
Joined: Mon Apr 28, 2008 9:47 am UTC
Location: Cardiff, UK

Re: Joining wmv files

Postby RedWolf » Sun May 03, 2009 7:37 pm UTC

hotaru wrote:
RedWolf wrote:hotaru:
That sounds like it may work. I downloaded mplayer from their site, but I can't seem to find mencoder anywhere... where would I find that?

it should be included with mplayer. look for mencoder.exe in the same folder as mplayer.exe.

Nope, not there. The one I downloaded from here was the second one under Source and Binaries, in case you want to have a look yourself.
User avatar
RedWolf
 
Posts: 236
Joined: Mon Dec 31, 2007 8:19 pm UTC

Re: Joining wmv files

Postby hotaru » Sun May 03, 2009 10:24 pm UTC

RedWolf wrote:
hotaru wrote:
RedWolf wrote:hotaru:
That sounds like it may work. I downloaded mplayer from their site, but I can't seem to find mencoder anywhere... where would I find that?

it should be included with mplayer. look for mencoder.exe in the same folder as mplayer.exe.

Nope, not there. The one I downloaded from here was the second one under Source and Binaries, in case you want to have a look yourself.

ah, i guess they changed some things since the last time i downloaded it... try the third or fourth one.
Code: Select all
#include <stdio.h>

int main()
{
 struct { unsigned a:3, b:3, c:2; } n = {0};
  do do printf("%hhu\n", *&n);
  while(!(n.a-- && !++n.b));
  while(++n.c);
  return 0; } 
User avatar
hotaru
 
Posts: 931
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Joining wmv files

Postby RedWolf » Sun May 03, 2009 11:15 pm UTC

hotaru wrote:
RedWolf wrote:
hotaru wrote:
RedWolf wrote:hotaru:
That sounds like it may work. I downloaded mplayer from their site, but I can't seem to find mencoder anywhere... where would I find that?

it should be included with mplayer. look for mencoder.exe in the same folder as mplayer.exe.

Nope, not there. The one I downloaded from here was the second one under Source and Binaries, in case you want to have a look yourself.

ah, i guess they changed some things since the last time i downloaded it... try the third or fourth one.

Ah, ok, you were right, I've both mplayer.exe and mencoder.exe now. Do I have to have the folder in a particular place or with a particular name? because the command line still isn't recognizing "mencoder".
User avatar
RedWolf
 
Posts: 236
Joined: Mon Dec 31, 2007 8:19 pm UTC

Re: Joining wmv files

Postby hotaru » Mon May 04, 2009 12:32 am UTC

RedWolf wrote:Do I have to have the folder in a particular place or with a particular name? because the command line still isn't recognizing "mencoder".

you have to either have it in some folder that's in your "PATH" environment variable (you can set the path variable in control panel, how to do it depends on what version of windows you're using)... or you can just specify the whole path... for example, if the folder you put it in is C:\Program Files\MPlayer, you'd do this:
Code: Select all
"C:\Program Files\MPlayer\mencoder -oac copy -ovc copy -of lavf -lavfopts format=asf myfile.wmv.001 myfile.wmv.002 -o myfile.wmv

also, i just downloaded that third one to a windows machine here (because it has a much faster processor than any of my *nix machines) to convert some videos and it seems to have some issues with libavformat that the fourth one doesn't have, so you may need to use that one...
Code: Select all
#include <stdio.h>

int main()
{
 struct { unsigned a:3, b:3, c:2; } n = {0};
  do do printf("%hhu\n", *&n);
  while(!(n.a-- && !++n.b));
  while(++n.c);
  return 0; } 
User avatar
hotaru
 
Posts: 931
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Joining wmv files

Postby RedWolf » Mon May 04, 2009 3:43 am UTC

Alright, excellent, it works perfectly. Thank you so much for your help. :D
User avatar
RedWolf
 
Posts: 236
Joined: Mon Dec 31, 2007 8:19 pm UTC

Re: Joining wmv files

Postby rajuk » Thu Jan 12, 2012 1:46 pm UTC

I need to combine two wmv files in my project. I am getting an exception here. I know last reply was years back . I still believe the person who succeeded in getting this done will receive my post and provide me a solution. Thanks in advance


C:\Documents and Settings\rajuk\Desktop\mencoder>mencoder -oac copy -ovc copy -o
f lavf -lavfopts format=asf 1.wmv.001 2.wmv.001 -o 6p.wmv
MEncoder 1.0rc1-3.4.2 (C) 2000-2006 MPlayer Team
CPU: Pentium(R) Dual-Core CPU E5400 @ 2.70GHz (Family: 6, Model: 23, Step
ping: 10)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
parse error at line 22
success: format: 0 data: 0x0 - 0x2a09
ASF file format detected.
[asfheader] Video stream found, -vid 1
ASF: No video stream found.
Video stream is mandatory!

Exiting...


with warm regards
raju
rajuk
 
Posts: 1
Joined: Thu Jan 12, 2012 1:42 pm UTC

Re: Joining wmv files

Postby phlip » Fri Jan 13, 2012 1:52 am UTC

Two points: first, can you play the two files separately with mplayer? It's looking like it might be having trouble reading them. Also, I'm not sure if you can use -oac copy and -ovc copy when you're working with multiple sources... it probably depends on the codec being used. You may need to pick an actual encoder.
While no one overhear you quickly tell me not cow cow.
but how about watch phone?
User avatar
phlip
Restorer of Worlds
 
Posts: 6739
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia


Return to The Help Desk

Who is online

Users browsing this forum: ipaipanma and 2 guests