LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-14-2014, 11:26 AM   #1
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Rep: Reputation: 29
which software to convert video files then join them together?


I have a few video file some mp4,mkv avi , I thuink I need tio cionvert them all into the same file format, I guess I need a program that canformat then tio the same type and then join them togehter any suggestions on which program or programs that can do this?
 
Old 02-14-2014, 11:54 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,158
Blog Entries: 13

Rep: Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567
I'm sure there are better ways, but you can use either ffmpeg or avconv to convert these to MPEG and then copy then together into one file.
 
Old 02-14-2014, 12:52 PM   #3
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Original Poster
Rep: Reputation: 29
ok ty I will check those out
 
Old 02-14-2014, 01:23 PM   #4
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
I once had excellent results for joining video files using cat command.
 
Old 02-14-2014, 01:36 PM   #5
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Original Poster
Rep: Reputation: 29
I tryied the above but it doesn't seem to find the audio in the file, I then found and installed hand vbreak which works but now I am not sure what to use to merge or join the files together
 
Old 02-14-2014, 01:40 PM   #6
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,265

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
this is what i do:
Code:
mencoder -oac copy -ovc copy -o tmp.avi breaking-bad-35-thirty-eight-snub.mkv breaking-bad-45-end-times.mkv
/usr/bin/mkvmerge   --title "$dvd-$title-ac3" --track-name 0:"$dvd-$title-ac3" --language 1:en --track-name 1:"AC3 5.1" tmp.avi -o whatever-floats-your-boat.mkv
mencoder will take any type of file/container/codec/format it can understand and spit it out as avi but it takes the first input file's resolution and frame rate for the output.

Last edited by schneidz; 02-14-2014 at 02:40 PM. Reason: added -and frame rate-
 
Old 02-14-2014, 01:49 PM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,158
Blog Entries: 13

Rep: Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567
Pretty sure I used lxsplit. I named one of the files a.mpg.001 and the other one a.mpg.002 then used lxsplit with the -j option. When I said "copy" before I was thinking of cp; however I'm realizing that DOS copy would allow a+b+c to concatenate files, Linux cp does not. The cat idea would work too if you did it correctly.

Code:
cat a.mpg > c.mpg
cat b.mpg >> c.mpg
Note that the second one concatenates to the end of the existing file, the first one creates the new file, that's the difference between the single and double >
 
Old 02-14-2014, 02:14 PM   #8
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by schneidz View Post
this is what i do:
Code:
mencoder -oac copy -ovc copy -o tmp.avi breaking-bad-35-thirty-eight-snub.mkv breaking-bad-45-end-times.mkv
/usr/bin/mkvmerge   --title "$dvd-$title-ac3" --track-name 0:"$dvd-$title-ac3" --language 1:en --track-name 1:"AC3 5.1" tmp.avi -o whatever-floats-your-boat.mkv
mencoder will take any type of file/container/codec/format it can understand and spit it out as avi but it takes the first input file's resolution for the output.
ok so I need to install mencoder then after the install I open terminal to where ever the files are mencoder -oac copy ( I think means load mencoder and copy the audio which woukld make the -ovc video) -0 ( I am nopt sure twat that does) but this tmp.avi I think means the file output and then the name of the files , so in this like if I wanted to merge or add 4 files I need to type in the names of the four files and file types like ex1.mkv ek1.mp4 ex2.mkv ea1.avi
the problem I see if that I need to first cionvert them into the same file type say a mp4 the do the above?
 
Old 02-14-2014, 02:30 PM   #9
rtmistler
Moderator
 
Registered: Mar 2011
Location: MA, USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,158
Blog Entries: 13

Rep: Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567Reputation: 3567
I would make them the same format. Admittedly the few times I did it; it was to take a full video we made of either a class or a technical discussion. I used tools (like ffmpeg) to create smaller videos from the main one, they were not all encompassing; the idea was to take a portion of the discussion which was considered relevant and save that, do that for all relevant portions, then create one video which was continuous, but smaller, shorter than the original.

The other point there is that there were no coding differences, no differences in frames per second, and no differences in size of the frames. I'm not sure what would happen if you had totally different video formats, in resolution as well as size and encoding.

I'd probably lean towards using the lowest common format. I.e. if you had one at 640x480 and another at a higher resolution, I'd try to code the better one down to the lower resolution before I combined them. That concept stinks, but I'm not sure you can just mix different resolutions and have it all work cleanly.

Worth a try though. What you can do is take one file and grab a short chunk of it. Same for the next file. See what happens if you combine different resolutions, or if you try to take a lower resolution file and make it higher resolution, see how bad it ends up looking. Otherwise lower the resolution of the better one.

Sorry, I don't know the syntax of mencoder, seems to be similar to ffmpeg, though. For instance to grab a 2 second chunk of some video using ffmpeg, I'd do the following:
Code:
ffmpeg -i input.mpg -t 0:00:02 output.mpg
Or for instance to grab 2 seconds of video but starting at timestamp 1m, 34 seconds:
Code:
ffmpeg -i input.mpg -ss 0:01:34 -t 0:00:02 output.mpg
 
Old 02-14-2014, 02:35 PM   #10
harryhaller
Member
 
Registered: Sep 2004
Distribution: Slackware-14.0
Posts: 452

Rep: Reputation: Disabled
Quote:
Originally Posted by Shadowmeph View Post
ok so I need to install mencoder then
If you have mplayer, you should have mencoder - they even have the same man page - and do read it and see how powerful it is
 
Old 02-14-2014, 02:55 PM   #11
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Original Poster
Rep: Reputation: 29
dam wasted my time transcoding the files to m4v only to discover that transcoder doesn't work with those file types lol
 
Old 02-14-2014, 03:19 PM   #12
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Original Poster
Rep: Reputation: 29
ok so I actually was able to merge 2 files together they were both .m4v files each was under 300mb but the output of the avi file was over 1.5 gb which is almsot twice the size I was hoping for. I used mencoder

Last edited by Shadowmeph; 02-14-2014 at 03:22 PM.
 
Old 02-14-2014, 03:42 PM   #13
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,265

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
thats weird, can you show output like below:
Code:
[schneidz@mom breaking-bad]$ ll breaking-bad-35-thirty-eight-snub.mkv breaking-bad-45-end-times.mkv
-rwxrwxr-x. 1 schneidz schneidz 495913639 Dec 11 20:15 breaking-bad-35-thirty-eight-snub.mkv
-rwxrwxr-x. 1 schneidz schneidz 495928472 Dec 11 20:23 breaking-bad-45-end-times.mkv
[schneidz@mom breaking-bad]$ file breaking-bad-35-thirty-eight-snub.mkv breaking-bad-45-end-times.mkv
breaking-bad-35-thirty-eight-snub.mkv: Matroska data
breaking-bad-45-end-times.mkv:         Matroska data
[schneidz@mom breaking-bad]$ mencoder -oac copy -ovc copy -o tmp.mkv breaking-bad-35-thirty-eight-snub.mkv breaking-bad-45-end-times.mkv
...
[schneidz@mom breaking-bad]$ ll tmp.mkv 
-rw-rw-r--. 1 schneidz schneidz 915222606 Feb 14 15:40 tmp.mkv
[schneidz@mom breaking-bad]$ file tmp.mkv 
tmp.mkv: RIFF (little-endian) data, AVI, 720 x 480, ~30 fps, video:, audio: Dolby AC3 (6 channels, 48000 Hz)

Last edited by schneidz; 02-14-2014 at 03:47 PM.
 
Old 02-14-2014, 04:46 PM   #14
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by schneidz View Post
thats weird, can you show output like below:
Code:
[schneidz@mom breaking-bad]$ ll breaking-bad-35-thirty-eight-snub.mkv breaking-bad-45-end-times.mkv
-rwxrwxr-x. 1 schneidz schneidz 495913639 Dec 11 20:15 breaking-bad-35-thirty-eight-snub.mkv
-rwxrwxr-x. 1 schneidz schneidz 495928472 Dec 11 20:23 breaking-bad-45-end-times.mkv
[schneidz@mom breaking-bad]$ file breaking-bad-35-thirty-eight-snub.mkv breaking-bad-45-end-times.mkv
breaking-bad-35-thirty-eight-snub.mkv: Matroska data
breaking-bad-45-end-times.mkv:         Matroska data
[schneidz@mom breaking-bad]$ mencoder -oac copy -ovc copy -o tmp.mkv breaking-bad-35-thirty-eight-snub.mkv breaking-bad-45-end-times.mkv
...
[schneidz@mom breaking-bad]$ ll tmp.mkv 
-rw-rw-r--. 1 schneidz schneidz 915222606 Feb 14 15:40 tmp.mkv
[schneidz@mom breaking-bad]$ file tmp.mkv 
tmp.mkv: RIFF (little-endian) data, AVI, 720 x 480, ~30 fps, video:, audio: Dolby AC3 (6 channels, 48000 Hz)
I am currently trying winFF .
where do I find the output files from menocoder?
 
Old 02-14-2014, 05:26 PM   #15
Shadowmeph
Member
 
Registered: May 2008
Location: West Coast Canada
Posts: 280

Original Poster
Rep: Reputation: 29
Ok I am just going to paste the most of the output.

Code:
mediapc@mediapc-desktop ~/TVVideos/WPC $ mencoder -oac copy -ovc copy -o WPC.56.1-2.avi WPC.56.S02E01.m4v WPC.56.S02E02.
MEncoder svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team
success: format: 0  data: 0x0 - 0x11b29900
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  852x480  24bpp  25.000 fps  754.6 kbps (92.1 kbyte/s)
[V] filefmt:44  fourcc:0x34363248  size:852x480  fps:25.000  ftime:=0.0400
videocodec: framecopy (852x480 24bpp fourcc=34363248)
Audio format 0x4134504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it.

Exiting...
mediapc@mediapc-desktop ~/TVVideos/WPC $ mencoder -oac pcm -ovc copy -o WPC.56.1-2.avi WPC.56.S02E01.m4v WPC.56.S02E02.m4v
MEncoder svn r34540 (Ubuntu), built with gcc-4.7 (C) 2000-2012 MPlayer Team
success: format: 0  data: 0x0 - 0x11b29900
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  852x480  24bpp  25.000 fps  754.6 kbps (92.1 kbyte/s)
[V] filefmt:44  fourcc:0x34363248  size:852x480  fps:25.000  ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
AUDIO: 48000 Hz, 2 ch, s16le, 159.9 kbit/10.41% (ratio: 19990->192000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
videocodec: framecopy (852x480 24bpp fourcc=34363248)
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Pos:2584.8s  64621f (99%) 4686.42fps Trem:   0min 709mb  A-V:0.026 [754:1536]
success: format: 0  data: 0x0 - 0x1123fa5d
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  852x480  24bpp  25.000 fps  693.9 kbps (84.7 kbyte/s)
[V] filefmt:44  fourcc:0x34363248  size:852x480  fps:25.000  ftime:=0.0400
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 160.0 kbit/10.41% (ratio: 19994->192000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
.
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream:  723.698 kbit/s  (90462 B/s)  size: 476319718 bytes  5265.400 secs  131635 frames

Audio stream: 1536.000 kbit/s  (192000 B/s)  size: 1010974720 bytes  5265.493 secs
mediapc@mediapc-desktop ~/TVVideos/WPC $
What did I do wrong?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert video files milkjerry3 Linux - Newbie 3 04-04-2007 01:18 AM
Can anyone recommend some good software to convert *.wav files into *mp3 files? Tom "Techno" Earl Linux - Software 4 10-12-2006 05:03 PM
Any software out there for linux to join movie files? theMonkeY Linux - Software 1 11-07-2004 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration