Discussion:
[MPlayer-users] How to create a "neutral sequence" at the beginning of a video track ?
André P.
2015-08-07 12:16:03 UTC
Permalink
Is it possible to add a short "neutral sequence" (=short sequence of black -or white- stable image) at the begining or at the end of a video track with a command line program (ffmpeg, MEncoder, mkvtoolnix collection or other) ?
I am looking for the video equivalent of the "pad" parameter of the sox audio editor but would accept a more complex procedure.

Notice that creating a "neutral sequence" with
ffmpeg -i {original file} -t {some seconds} -vf "fade=t=in:st=600:d=0.5" {neutral sequence}
is not a satisfactory solution because the {neutral sequence} may not be concatenated to the {original file} because the caracteristics (codec,...) of the created {neutral sequence} usually differ from those of the {original file}. André
Nick Koretsky
2015-08-07 14:25:44 UTC
Permalink
On Fri, 7 Aug 2015 12:16:03 +0000 (UTC)
Post by André P.
Is it possible to add a short "neutral sequence" (=short sequence of
black -or white- stable image) at the begining or at the end of a video
track with a command line program (ffmpeg, MEncoder, mkvtoolnix
collection or other) ? I am looking for the video equivalent of the "pad"
parameter of the sox audio editor but would accept a more complex
procedure.
Notice that creating a "neutral sequence" with
ffmpeg -i {original file} -t {some seconds} -vf
"fade=t=in:st=600:d=0.5" {neutral sequence} is not a satisfactory
solution because the {neutral sequence} may not be concatenated to the
{original file} because the caracteristics (codec,...) of the created
{neutral sequence} usually differ from those of the {original
file}. 
What you are asking for is impossible in a general case. To add
something to a video track without reencode depending on a file format and
codecs used you will need to at least encode your sequence with the same
codec as your file, at worst you would have to match exact codec
parameters. If you are asking if there is a commandline tool capable to
automatically analyze input file, encode desired sequence using the right
parameters and append it to input then i am not aware of anything even
remotely close.
--
Nick Koretsky (***@gmail.com)
André P.
2015-08-07 15:30:44 UTC
Permalink
@ Nick KoretskyThank you for your quick answer.
- I exclude the re-encoding the {original file} in order to create a {neutral sequence} with the same caracteristics because the re-encoding would be too time consuming.
- Woukd I be able to collect all the caracteristics of the {original file} (and I am fat from that), I also exclude to create the {neutral sequence} with these caracteristics because I have no control on the {original files} (some come from emule, some from DDL).There a so many differant formats/codecs that the probabibilty that I miss the required one is too high.
 André
De : Nick Koretsky <***@ukr.net>
À : mplayer-***@mplayerhq.hu
Cc : André P. <csosog-at-***@ffmpeg.org>
Envoyé le : Vendredi 7 août 2015 16h25
Objet : Re: [MPlayer-users] How to create a "neutral sequence" at the beginning of a video track ?

On Fri, 7 Aug 2015 12:16:03 +0000 (UTC)
Post by André P.
Is it possible to add a short "neutral sequence" (=short sequence of
black -or white- stable image) at the begining or at the end of a video
track with a command line program (ffmpeg, MEncoder, mkvtoolnix
collection or other) ? I am looking for the video equivalent of the "pad"
parameter of the sox audio editor but would accept a more complex
procedure.
Notice that creating a "neutral sequence" with
ffmpeg -i {original file} -t {some seconds} -vf
"fade=t=in:st=600:d=0.5" {neutral sequence} is not a satisfactory
solution because the {neutral sequence} may not be concatenated to the
{original file} because the caracteristics (codec,...) of the created
{neutral sequence} usually differ from those of the {original
file}. 
What you are asking for is impossible in a general case. To add
something to a video track without reencode depending on a file format and
codecs used you will need to at least encode your sequence with the same
codec as your file, at worst you would have to match exact codec
parameters. If you are asking if there is a commandline tool capable to
automatically analyze input file, encode desired sequence using the right
parameters and append it to input then i am not aware of anything even
remotely close.
--
  Nick Koretsky (***@gmail.com)


 
_______________________________________________
MPlayer-users mailing list
MPlayer-***@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
André P.
2015-08-07 15:41:50 UTC
Permalink
Sorry for the mistakes ;(
@ Nick KoretskyThank you for your quick answer.
- I exclude the re-encoding the {original file} in order to create a {neutral sequence} with the same caracteristics because the re-encoding would be too time consuming.
- WouLd I be able to collect all the caracteristics of the {original file} (and I am faR from that), I also exclude to create the {neutral sequence} with these caracteristics because I have no control on the {original files} (some come from emule, some from DDL).There aRE so many differEnt formats/codecs that the probability that I miss the required one is too high. André
Nick Koretsky
2015-08-07 17:09:54 UTC
Permalink
On Fri, 7 Aug 2015 15:41:50 +0000 (UTC)
Post by André P.
Sorry for the mistakes ;(
@ Nick KoretskyThank you for your quick answer.
- I exclude the re-encoding the {original file} in order to create a
{neutral sequence} with the same caracteristics because the re-encoding
would be too time consuming.
- WouLd I be able to collect all the caracteristics of the {original
file} (and I am faR from that), I also exclude to create the {neutral
sequence} with these caracteristics because I have no control on the
{original files} (some come from emule, some from DDL).There aRE so many
differEnt formats/codecs that the probability that I miss the required
one is too high. 
And that is exactly why i said that what you are asking for is impossible in
a general case. There is only two ways to append something to video track -
reencode or match source codec. There is no way around that.
--
Nick Koretsky (***@gmail.com)
Dominik 'Rathann' Mierzejewski
2015-08-07 17:13:54 UTC
Permalink
Post by Nick Koretsky
On Fri, 7 Aug 2015 15:41:50 +0000 (UTC)
Post by André P.
Sorry for the mistakes ;(
@ Nick KoretskyThank you for your quick answer.
- I exclude the re-encoding the {original file} in order to create a
{neutral sequence} with the same caracteristics because the re-encoding
would be too time consuming.
- WouLd I be able to collect all the caracteristics of the {original
file} (and I am faR from that), I also exclude to create the {neutral
sequence} with these caracteristics because I have no control on the
{original files} (some come from emule, some from DDL).There aRE so many
differEnt formats/codecs that the probability that I miss the required
one is too high. 
And that is exactly why i said that what you are asking for is impossible in
a general case. There is only two ways to append something to video track -
reencode or match source codec. There is no way around that.
You could have such sequence stored in a separate file and compressed with
a lossless codec and reencode it each time you need to append it to some new
video file, matching the file's codec parameters.

That might even be possible to automate and shouldn't take too much
time.

Regards,
Dominik
--
MPlayer http://mplayerhq.hu | RPM Fusion http://rpmfusion.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
Reimar Döffinger
2015-08-08 16:47:55 UTC
Permalink
Post by Dominik 'Rathann' Mierzejewski
You could have such sequence stored in a separate file and compressed with
a lossless codec and reencode it each time you need to append it to some new
video file, matching the file's codec parameters.
Well, in the real world it's not unlikely that even if you match
the codec parameters exactly it's likely there will be some kind of
"break" between the two parts and a few less forgiving players
might stumble (e.g. DVD players might assume a fixed keyframe
interval which would break, or your new encode can't really know
the variable bitrate buffer state and thus might go above or below
the required bitrate - even if going below normally should not matter).
I guess the summary is: If you want a quick hack that mostly works,
you can likely script something.
If you want something that actually properly works, good luck,
I'm fairly sure the only way is a really significant expense in
either time, money or both.

Loading...