FLV cutting support

13 views
Skip to first unread message

tloo

unread,
Nov 8, 2008, 4:19:39 PM11/8/08
to FLVmeta Discussion
Is there is any plans on adding video cutting and merging into
FLVmeta ?

I mean being able to slice out a section of a video based on in/out
timestamps, like flvtool2 (using the -C option) and flvtool++ (not the
Facebook one). That would be cool, especially since there is no
command line tool out there currently with this feature that can deal
with extended timestamps (videos with a 4:40+ hours playtime), the
before mentioned ones included.

Marc

unread,
Nov 10, 2008, 10:12:47 AM11/10/08
to FLVmeta Discussion
Yes, I'm planning to do that, with a few limitations inherent to the
FLV format.

For example, merging two FLV files can only be done if the two videos
have the same resolution and encoding.

For cutting, for the cut fragment to be playable, it needs to be cut
just before a keyframe, which can cause some timing inexactitude.

I don't know how flvtool2 proceeds.

As for the interface, I can add two commands,
-S : slice
-M : merge
and specify the times, in seconds or milliseconds.

Eric Priou

unread,
Nov 11, 2008, 6:53:58 AM11/11/08
to flvmeta...@googlegroups.com
Hi,


I don't know how flvtool2 proceeds.
AFAIK, flvtool2 isn't able to add flv.
Only cut. 
I don't know about the new timestamps btw…

----
Eric Priou aka erixtekila 
Articles : http://www.v-i-a.net/inprogress

tloo

unread,
Nov 11, 2008, 1:03:36 PM11/11/08
to FLVmeta Discussion
On Nov 11, 12:53 pm, Eric Priou <erixtek...@gmail.com> wrote:
> Hi,
>
> > I don't know how flvtool2 proceeds.
>
> AFAIK, flvtool2 isn't able to add flv.
> Only cut.

yeah, flvtool2 can't do flv merging. As far as I know ffmpeg is the
only tool that does this reliably as of currently, and yes all parts
will have to end upp with the same resolution/format in the target
file. ffmpeg does a quite good job taking care of these issues
includng transcoding if neccessary, no matter of what various input
video you point at it.

> I don't know about the new timestamps btw…

I was referring to the timestamp extended u8 field as per the Flash v9
format specs, the flvmeta changelog speaks about this been adressed in
1.0.7.
Flvtool2 can't do cutting beyond 4:40 hours into a video, since it
doesn't take this extended timestamp value into account.

tloo

unread,
Nov 11, 2008, 1:33:48 PM11/11/08
to FLVmeta Discussion
On Nov 10, 4:12 pm, Marc <marc.noi...@gmail.com> wrote:
> Yes, I'm planning to do that, with a few limitations inherent to the
> FLV format.
>
> For example, merging two FLV files can only be done if the two videos
> have the same resolution and encoding.

yeah, I figure it is up to the user to prepare the source video files
accordingly.

> For cutting, for the cut fragment to be playable, it needs to be cut
> just before a keyframe, which can cause some timing inexactitude.

yes, the defined in/out points would need to be aligned to the nearest
keyframe.
The resulting timings thus might get a little fuzzy, depending on the
source video keyframe interval.
I for example, usually deal with videos having a 5 sec keyframe
interval, and being able to slice out a 10 minute portion say 3:50
hours
into a video with a 5 seconds in/out precision is still quite
acceptable in my book.

> I don't know how flvtool2 proceeds.

flvtool2 aligns the user defined in/out points (defined in
milliseconds) as described above.
For example, if I wanted to cut out a 1 min slice at 30 minutes into a
video, with flvtool2 I would issue:
flvtool2 -Cio 1800000 1860000 sourcevideo.flv cutout.flv

>
> As for the interface, I can add two commands,
> -S : slice
> -M : merge
> and specify the times, in seconds or milliseconds.

or maybe "C" for "Cut", like flvtool2 uses.
Milliseconds would be more precise, especially since a flv file could
be encoded with a sub-second keyframe interval.

Anyway, seeing this feature added to flvmeta would be totally cool :)

Marc

unread,
Nov 11, 2008, 7:09:05 PM11/11/08
to FLVmeta Discussion
> or maybe "C" for "Cut", like flvtool2 uses.
> Milliseconds would be more precise, especially since a flv file could
> be encoded with a sub-second keyframe interval.
>
> Anyway, seeing this feature added to flvmeta would be totally cool :)
>

-C is already planned to be used for the "Check" command which, like a
certain Adobe command-line tool, will validate the given FLV file.

I could specify the time like this: 5.236, or 5236, the first being
seconds, and the second one milliseconds.
I'm inclined to use the first form, as I'm used to the way ffmpeg and
mencoder work, and to automatically detect if a given integer value
is too big to represent seconds and therefore will represent ms.
Reply all
Reply to author
Forward
0 new messages