Hi guys.
I'm helping a friend who has video 800 clips from his camera, all with identical video properties and in .mp3 format. I've tried pretty much every video edit program, Sony Vegas (crashes), AVIDemux (crashes), vdubmod (doesn't allow appending mpg files), videoredo (Input stream error: error opening file when saving) so it's getting kinda frustrating
I've used Windows command line to merge all the files into one big .mpg file, luckily they are numbered in ascending order but the numbering starts in the middle of nowhere so I used this command with wildcard:
copy /b abc*.mpg merged.mpg
I have a 11.7gb .mpg file (ironically this is the same size as all 800 split mpg files). It plays back fine in VLC however there is no time across the scroll bar which is probably as the big .mpg is patched by Windows. When I try importing the 11.7gb patched file, the above programs only recognise the first clip in the patched file and most crash when I try importing all 800 files.
My goal is to merge all the files and finally re-encode the merged file so it can be burned to 2 DVD's. I'm having a hard job completing step 1.
Any help would be most welcome
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 12 of 12
Thread
-
-
Disregarding the fact that .mp3 files ARE CLEARLY NOT video clips (your were probably thinking of .MPG), using Windows' Command Line is the ABSOLUTELY WRONG way to go, and is no surprise at all that most programs have problems with it.
A valid multimedia container file, such as MPG, has
A. A single container header
B. A (usually) single video header
C. A (usually) single audio header
D. sectors of elementary video stream interleaved with sectors of elementary audio stream
E. an Optional "Footer" to B,C, and A, usually having Indexing info.
Your combined file has 800 A's, 800 B's, 800'Cs and 800 interleaved streams, separated by those other items, plus conflicting/duplicated indexing info.
The fact that you got it to play back somewhat ok in VLC is just sheer dumb luck on VLC's part.
The fact is, barring a really cool script for ffmpeg that loads the info from some spreadsheet (which somebody here might be able to do, but I have neither the time nor inclination to do), or using a commercial batch encoder app ($$), I know of NO easy or automated way to do this.
I guess you could:
1. Create a script or get an app to batch demux the V & A streams to their elementary/raw files
2. Try Copy /B and append, in order, all the elementary V streams, and then all the elementary A streams, generating a single large V elementary stream and a single large A elementary stream.
3. Remux the resulting file(s) to MPG, which should hopefully clean up any weirdness in the aggregate streams.
4. THEN, re-encode.
I have got to ask: how long a duration is this combined file supposed to be? And Why didn't your friend's camera just give it to you as less # of larger files?
ScottLast edited by Cornucopia; 13th May 2014 at 22:57.
-
first of all use ffmpeg to do something like this...
first of all create a text file which contains the list of files to be concatenated ..
it should be something like this
Code:file '/path/to/file1.mpg' file '/path/to/file2.mpg' file '/path/to/file3.mpg'
the path may be relative . but i recommend full path.
then simply use this
Code:ffmpeg -f concat -i mylist.txt -c copy output.mpg
But the main part here is to type all the 800 files into the txt file ... you might be able to do it quickly using a C or java program..
and the rest of the task is simple
** the source is a video cam so I assume all the videos to be of the same specsLast edited by Placebo; 14th May 2014 at 01:51.
-
@Cornucopia - Sorry that was a typo, all files from his cam were in .mpg not .mp3. AFAIK all have identical properties and the combined length is about 3 hours and 10 minutes
@jagabo Mpg2cut2 opens the first 124 files only, I've tried saving batches of 124 and playing them back and Windows/VLC reports their length as long as the first clip in the compiled video e.g 8 seconds for the first 124 files I joined so I guess this isn't going to be a viable option.
@Placebo The problem is generating a .txt file with all the file paths on separate lines. I used to have a great app called treeprint in the past but this doesn't work with Windows 7 x64. Just to be sure, the text file needs to look like this right?
file D:/video/abc541.mpg
file D:/video/abc542.mpg
file D:/video/abc543.mpg
.... -
For me works : file 'C:\file_xx.xxx'
to generate list plain dir /b *.xxx > mylist.txt works ok, all you need to do is adding file 'C:\ ' to listed files (this can be done by automatic replace)
of course xxx etc is correct name, extension etc - it will be unique for your files -
Heyy @ rookieauthor
I found a fool proof method to generate the mylist.txt file !
I'll break it up in a few steps.
STEP 1 : Save the following command in a batch file (assuming you know how to make a batch file in Windows)
Code:dir /b /s *.mpg > mylist.txt
STEP 2 :
Now place this batch file inside the folder which has those 800 mpgs
Also create a new text file named "mylist.txt" in the same folder
Your folder should look something like this [ I have taken few avi files of my school Get TOgether ... ]
Run it (or double click it ..)
If everything goes correctly , then you'll have your 800 mpgs in the txt file.
In my case the output will be
Code:C:\Users\sandesh\Downloads\Compressed\GTO\GTO 01.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 02.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 03.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 04.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 05.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 06.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 07.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 08.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 09.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 10.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 11.avi C:\Users\sandesh\Downloads\Compressed\GTO\GTO 12.avi
Code:file 'D:\Users\sandesh\Downloads\Compressed\GTO\GTO 01.avi'
We will use the Find and replace features of text editors for this ...
STEP 3 :
Just findCode:C:\
Code:file 'C:\
NEXT do this :
findCode:.mpg
Code:.mpg'
Thats it .. move on to
STEP 4 :
Code:ffmpeg -f concat -i mylist.txt -c copy output.mpg
--- If you have any doubts, feel free.Last edited by Placebo; 14th May 2014 at 06:46. Reason: grammer ..
-
Placebo, thanks you're a diamond. I've remoted into my PC at home from work and have started ffmpeg, its constantly scrolling giving the below errors:
[mpeg @ 00000000055fe720] buffer underflow st=1 bufi=37828 size=66833
[mpeg @ 00000000055fe720] buffer underflow st=1 bufi=39865 size=66833
[mpeg @ 00000000055fe720] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000055fe720] buffer underflow st=1 bufi=39865 size=66833
[mpeg @ 00000000055fe720] buffer underflow st=1 bufi=41902 size=66833
[mpeg @ 00000000055fe720] packet too large, ignoring buffer limits to mux it
etc. I guess it's going to take a while to get through all 800 clips. Should these errors be of any concern? -
@rookieauthor
Looks like a warning , If it appears for a brief period , then just ignore it...
This buffer underflow warning is generally related to incompatibility between a container and video codec . Which codec are you using? -
I was getting the buffer underflow/packet too large errors 10x per sec. ffmpeg finally finished what it was doing and printed the following in command line
frame=346485 fps=151 q=-1.0 Lsize=12059700kB time=03:04:25.47 bitrate=8928.0kbit
s/s
video:351524kB audio:11641175kB subtitle:0kB other streams:0kB global headers:0k
B muxing overhead: 0.558686%
Stream 0
Type: Audio
Codec: A52 Audio (aka AC3) (a52)
Channels: Stereo
Sample rate: 48000 Hz
Bitrate: 256 kb/s
Stream 1
Type: Video
Codec: MPEG-1/2 Video (mgpv)
Resolutiion: 720x576
Frame rate: 25
Decoded format: Planar 4:2:0 YUV -
The video produced by ffmpeg unfortunately doesn't play on most my media players apart from VLC. In VLC, is starts and freezes on the first frame, audio is muffled and video stops at about 7 seconds. I think the clips may need re-encoding. I've ran a few clips through GSpot which gives the following as the codec used:
Container
DVD "VOB" format
MPEG-2 Program Stream << { 1 vid, 1 aud }
Sys Bitrate: 10080 kb/s VBR
Video
Codec: MPEG2
FPS: 25
WxD: 720 x 576
Average birate: 8804
Audio
Codec: AC3
Info: 0xbd[0x80]:48000Hz 256 kb/s tot , stereo (2/0)
ffmpeg -f concat -i d:\video\mylist.txt -vcodec copy -acodec copy -c copy D:\video\output.mpg -
Did you ever try concatenating the raw streams like I suggested?
Scott