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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
02-14-2014, 10:26 AM
|
#1
|
Member
Registered: May 2008
Location: West Coast Canada
Posts: 282
Rep:
|
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?
|
|
|
02-14-2014, 10:54 AM
|
#2
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,953
|
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.
|
|
|
02-14-2014, 11:52 AM
|
#3
|
Member
Registered: May 2008
Location: West Coast Canada
Posts: 282
Original Poster
Rep:
|
ok ty I will check those out 
|
|
|
02-14-2014, 12:23 PM
|
#4
|
Member
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855
Rep: 
|
I once had excellent results for joining video files using cat command.
|
|
|
02-14-2014, 12:36 PM
|
#5
|
Member
Registered: May 2008
Location: West Coast Canada
Posts: 282
Original Poster
Rep:
|
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
|
|
|
02-14-2014, 12:40 PM
|
#6
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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 01:40 PM.
Reason: added -and frame rate-
|
|
|
02-14-2014, 12:49 PM
|
#7
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,953
|
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 >
|
|
|
02-14-2014, 01:14 PM
|
#8
|
Member
Registered: May 2008
Location: West Coast Canada
Posts: 282
Original Poster
Rep:
|
Quote:
Originally Posted by schneidz
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?
|
|
|
02-14-2014, 01:30 PM
|
#9
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,953
|
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
|
|
|
02-14-2014, 01:35 PM
|
#10
|
Member
Registered: Sep 2004
Distribution: Slackware-14.2
Posts: 472
Rep: 
|
Quote:
Originally Posted by Shadowmeph
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 
|
|
|
02-14-2014, 01:55 PM
|
#11
|
Member
Registered: May 2008
Location: West Coast Canada
Posts: 282
Original Poster
Rep:
|
dam wasted my time transcoding the files to m4v only to discover that transcoder doesn't work with those file types lol
|
|
|
02-14-2014, 02:19 PM
|
#12
|
Member
Registered: May 2008
Location: West Coast Canada
Posts: 282
Original Poster
Rep:
|
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 02:22 PM.
|
|
|
02-14-2014, 02:42 PM
|
#13
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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 02:47 PM.
|
|
|
02-14-2014, 03:46 PM
|
#14
|
Member
Registered: May 2008
Location: West Coast Canada
Posts: 282
Original Poster
Rep:
|
Quote:
Originally Posted by schneidz
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?
|
|
|
02-14-2014, 04:26 PM
|
#15
|
Member
Registered: May 2008
Location: West Coast Canada
Posts: 282
Original Poster
Rep:
|
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?
|
|
|
All times are GMT -5. The time now is 04:23 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|