1 |
On Sat, 2008-04-26 at 19:56 +0100, Mick wrote: |
2 |
> On Saturday 26 April 2008, Hal Martin wrote: |
3 |
> > I assume you want each piece of this file to be play-able? If you don't |
4 |
> > care about that, just use split to chop them up into your desired size |
5 |
> > and then use cat to reassemble them at the destination. |
6 |
> > |
7 |
> > *$ split –bytes=1m /path/to/large/file /path/to/output/file/prefix* |
8 |
> > |
9 |
> > 'man split' will also contain this information. |
10 |
> |
11 |
> Thanks! I didn't know about split. |
12 |
> |
13 |
> I am afraid that the split files have to be playable. I intend to upload them |
14 |
> on a server for a MSWindows user to download and play. It has to be point & |
15 |
> click skill level at the receiving end. |
16 |
|
17 |
Hmm, theoretically it should be possible without re-encoding because |
18 |
video files contain I-frames which are encoded without reference to |
19 |
previous frames every x frames. With a media player you can only seek |
20 |
through a video from I-frame to I-frame (I think ...). |
21 |
|
22 |
If that assumption is right, it should be a relatively easy task. |
23 |
Something like this might work: |
24 |
|
25 |
mencoder -vf harddup -ovc copy -oac copy -of lavf -lavfopts format=mov |
26 |
-ss 1:30 -endpos 3:00 -o output.mov input.mov |
27 |
|
28 |
explanation: |
29 |
-vf harddup -> don't skip duplicate frames |
30 |
-ovc copy; -oac copy -> don't re-encode audio and video |
31 |
-of lavf -> use lavf for muxing |
32 |
-lavfopts format=mov -> mux into mov-format |
33 |
-ss 1:30 -> skip the first 1 min + 30 sec |
34 |
-endpos 3:00 -> end input at position 3:00 min of the original film |
35 |
-o output.mov -> write to output.mov |
36 |
|
37 |
This command should result in a file containing a total of |
38 |
3:00-1:30=1:30 min of film, however, seeking might be inaccurate |
39 |
(searches next or previous I-frame) so both videos might overlap for |
40 |
maybe a second or two or you could loose that amount time therefor |
41 |
tweaking might be necessary. |
42 |
|
43 |
Unfortunately, I couldn't test this because I have no suitable video |
44 |
file at hand. If it works, tell me please, if not, post your results, |
45 |
maybe I can look further into it. |