Re: [FFmpeg-user] Random repetitions in output

2017-11-07 Thread Carl Eugen Hoyos
2017-11-07 13:51 GMT+01:00 Mikael Persson :

> I still do not have the latest ffmpeg(working on compiling it)

If you are unable to do:
$ wget http://ffmpeg.org/releases/ffmpeg-snapshot-git.tar.bz2
$ tar xf ffmpeg-snapshot-git.tar.bz2
$ cd ffmpeg (probably needs a tab here)
$ ./configure --enable-gpl --enable-libx264 && make ffmpeg

you will find a link to current binaries on http://ffmpeg.org/download.html

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-07 Thread Mikael Persson
Hello again,

If I understand you correctly then
ffmpeg -i vid.mov -vsync 0 %05d.png
Should output every frame without repetition.

I still do not have the latest ffmpeg(working on compiling it), but to
clarify:
When I  run the command using my current version while there are no
repetitions yay :):
Atleast 1 frame at the beginning of the video are dropped, boo :(. Shall I
intrepet this as a bug which may/should have been fixed in the latest
version?

I see the discrepancy by comparing the first frame opening the video in vlc
with the first output frame.

I append the output:
ffmpeg version N-85646-g550a9c5 Copyright (c) 2000-2017 the FFmpeg
developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --enable-gpl --enable-libx264
  libavutil  55. 61.100 / 55. 61.100
  libavcodec 57. 93.100 / 57. 93.100
  libavformat57. 72.101 / 57. 72.101
  libavdevice57.  7.100 / 57.  7.100
  libavfilter 6. 87.100 /  6. 87.100
  libswscale  4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2-22378.mov':
  Metadata:
major_brand : qt
minor_version   : 0
compatible_brands: qt
creation_time   : 2017-10-04T20:09:41.00Z
com.apple.quicktime.location.ISO6709: +59.6508+016.5466+027.920/
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iPhone 6s
com.apple.quicktime.software: 11.0
com.apple.quicktime.creationdate: 2017-08-20T10:19:25+0200
  Duration: 00:00:06.13, start: -0.022290, bitrate: 17498 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
bt709), 1920x1080, 15752 kb/s, 29.98 fps, 29.97 tbr, 600 tbn, 1200 tbc
(default)
Metadata:
  creation_time   : 2017-10-04T20:09:41.00Z
  handler_name: Core Media Data Handler
  encoder : H.264
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono,
fltp, 92 kb/s (default)
Metadata:
  creation_time   : 2017-10-04T20:09:41.00Z
  handler_name: Core Media Data Handler
Stream #0:2(und): Data: none (mebx / 0x7862656D) (default)
Metadata:
  creation_time   : 2017-10-04T20:09:41.00Z
  handler_name: Core Media Data Handler
Stream #0:3(und): Data: none (mebx / 0x7862656D) (default)
Metadata:
  creation_time   : 2017-10-04T20:09:41.00Z
  handler_name: Core Media Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
Output #0, image2, to '%5d.png':
  Metadata:
major_brand : qt
minor_version   : 0
compatible_brands: qt
com.apple.quicktime.creationdate: 2017-08-20T10:19:25+0200
com.apple.quicktime.location.ISO6709: +59.6508+016.5466+027.920/
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iPhone 6s
com.apple.quicktime.software: 11.0
encoder : Lavf57.72.101
Stream #0:0(und): Video: png, rgb24, 1920x1080, q=2-31, 200 kb/s, 29.97
fps, 29.97 tbn, 29.97 tbc (default)
Metadata:
  creation_time   : 2017-10-04T20:09:41.00Z
  handler_name: Core Media Data Handler
  encoder : Lavc57.93.100 png
frame=   16 fps=0.0 q=-0.0 size=N/A time=00:00:00.30 bitrate=N/A
speed=0.587x   frame=   27 fps= 26 q=-0.0 size=N/A time=00:00:00.66
bitrate=N/A speed=0.648x   frame=   40 fps= 26 q=-0.0 size=N/A
time=00:00:01.10 bitrate=N/A speed=0.719x   frame=   53 fps= 26 q=-0.0
size=N/A time=00:00:01.53 bitrate=N/A speed=0.745x   frame=   69 fps= 26
q=-0.0 size=N/A time=00:00:02.06 bitrate=N/A speed=0.772x   frame=   85
fps= 26 q=-0.0 size=N/A time=00:00:02.60 bitrate=N/A speed=0.791x   frame=
frame=  184 fps= 25 q=-0.0 Lsize=N/A time=00:00:06.17 bitrate=N/A
speed=0.825x
video:858331kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown






2017-11-07 13:39 GMT+01:00 Moritz Barsnick :

> On Mon, Nov 06, 2017 at 20:00:21 +0100, Carl Eugen Hoyos wrote:
> > That is because ffmpeg (the application) defaults to the input
> > framerate for the output file (for all output file types).
>
> Ah, okay, I get it. Thanks.
>
> Moritz
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-07 Thread Moritz Barsnick
On Mon, Nov 06, 2017 at 20:00:21 +0100, Carl Eugen Hoyos wrote:
> That is because ffmpeg (the application) defaults to the input
> framerate for the output file (for all output file types).

Ah, okay, I get it. Thanks.

Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-06 Thread Carl Eugen Hoyos
2017-11-06 14:25 GMT+01:00 Moritz Barsnick :
> On Mon, Nov 06, 2017 at 13:46:29 +0100, Carl Eugen Hoyos wrote:
>> > It seems the image2 muxer uses the framerate reported by the
>> > demuxer (but as cfr).
>>
>> This is wrong, the image2 muxer does not know anything about
>> the input frame rate.
>
> Hmm. Even if I avoid testsrc (in case it is not quite a demuxer, but
> rather a filter chain element) and go through an "external file", the
> image2 muxer reports use of the same framerate as the input:

That is because ffmpeg (the application) defaults to the input
framerate for the output file (for all output file types).

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-06 Thread Moritz Barsnick
On Mon, Nov 06, 2017 at 13:46:29 +0100, Carl Eugen Hoyos wrote:
> > It seems the image2 muxer uses the framerate reported by the
> > demuxer (but as cfr).
> 
> This is wrong, the image2 muxer does not know anything about
> the input frame rate.

Hmm. Even if I avoid testsrc (in case it is not quite a demuxer, but
rather a filter chain element) and go through an "external file", the
image2 muxer reports use of the same framerate as the input:

$ ffmpeg -f lavfi -i testsrc=r=25 -t 1 -f matroska - | ffmpeg -i - 
testimage_%03d.png
[...]
Output #0, image2, to 'testimage_%03d.png':
  Metadata:
encoder : Lavf58.0.102
Stream #0:0: Video: png, rgb24, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 
kb/s, 25 fps, 25 tbn, 25 tbc (default)
Metadata:
  encoder : Lavc58.1.100 png
frame=   25 fps=0.0 q=-0.0 Lsize=N/A time=00:00:01.00 bitrate=N/A speed=2.86x
video:447kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing 
overhead: unknown

$ ffmpeg -f lavfi -i testsrc=r=30 -t 1 -f matroska - | ffmpeg -i - 
testimage_%03d.png
[...]
Output #0, image2, to 'testimage_%03d.png':
  Metadata:
encoder : Lavf58.0.102
Stream #0:0: Video: png, rgb24, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 
kb/s, 30 fps, 30 tbn, 30 tbc (default)
Metadata:
  encoder : Lavc58.1.100 png
frame=   30 fps=0.0 q=-0.0 Lsize=N/A time=00:00:01.00 bitrate=N/A speed=2.48x
video:529kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing 
overhead: unknown

In both cases, the image2 muxer reports using the framerate which the
matroska demuxer identified. It must have that info from somewhere. Did
it look at the timestamps of the packets passing in?

Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-06 Thread Carl Eugen Hoyos
2017-11-06 12:23 GMT+01:00 Moritz Barsnick :
> On Sun, Nov 05, 2017 at 21:14:26 +0100, Mikael Persson wrote:
>> Regarding: -vsync vfr
>> From the doc: Frames are passed through with their timestamp or dropped so
>> as to prevent 2 frames from having the same timestamp.
>>
>> This would ensure no repetitions, but does not guarantee that no frames are
>> lost. I want both to be ensured.
>
> Did you read the "-vsync" docs? Value "passthrough" is described like
> "vfr", without the dropping:
>
> ‘0, passthrough’
> Each frame is passed with its timestamp from the demuxer to the muxer.

Thank you, that was what I meant!
(I don't think it makes a difference for the described use-case though.)

>> Further does -vsync have any effect at all if no output framerate is
>> specified?
>
> Yes, as there often needs to be an output framerate.

This does not sound completely correct to me, but may
just be a wording issue.

> How ffmpeg derives it, I would have to dig through the sources to
> understand.

> It seems the image2 muxer uses the framerate reported by the
> demuxer (but as cfr).

This is wrong, the image2 muxer does not know anything about
the input frame rate.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-06 Thread Moritz Barsnick
On Sun, Nov 05, 2017 at 21:14:26 +0100, Mikael Persson wrote:
> Regarding: -vsync vfr
> From the doc: Frames are passed through with their timestamp or dropped so
> as to prevent 2 frames from having the same timestamp.
> 
> This would ensure no repetitions, but does not guarantee that no frames are
> lost. I want both to be ensured.

Did you read the "-vsync" docs? Value "passthrough" is described like
"vfr", without the dropping:

‘0, passthrough’
Each frame is passed with its timestamp from the demuxer to the muxer.

> Further does -vsync have any effect at all if no output framerate is
> specified?

Yes, as there often needs to be an output framerate. How ffmpeg derives
it, I would have to dig through the sources to understand. It seems the
image2 muxer uses the framerate reported by the demuxer (but as cfr).

> I cannot believe that there is no way to tell ffmpeg to extract all frames
> without repetition or dropping, shouldnt that be the default, and the
> behaviour I see a bug?

It believe it is the default for most cases, but the image2 muxer (and
others perhaps - mp4?) forces cfr, which implies a change in the flow
or frames. (If it's not documented well, then perhaps it should be.)

Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-05 Thread Cley Faye
2017-11-05 21:14 GMT+01:00 Mikael Persson :

> I cannot believe that there is no way to tell ffmpeg to extract all frames
> without repetition or dropping, shouldnt that be the default, and the
> behaviour I see a bug?
>


​There's no way to tell without knowing what happen, and there's no way to
know what happen without the full command and console output. For all I
know it could be as simple as a framerate mismatch.​or as complex as who
knows what.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-05 Thread Mikael Persson
Ill update and continue from there, however it is still not clear from
documentation:

Regarding: -vsync vfr
From the doc: Frames are passed through with their timestamp or dropped so
as to prevent 2 frames from having the same timestamp.

This would ensure no repetitions, but does not guarantee that no frames are
lost. I want both to be ensured.

Further does -vsync have any effect at all if no output framerate is
specified?


Perhaps the following is interesting ?
-frame_drop_threshold parameter
Frame drop threshold, which specifies how much behind video frames can be
before they are dropped. In frame rate units, so 1.0 is one frame. The
default is -1.1. One possible usecase is to avoid framedrops in case of
noisy timestamps or to increase frame drop precision in case of exact
timestamps.

Unfortunately it does not state what the default means nor the option to
instruct it to have a truly infinite waiting period. I'm guessing thats
what a negative value means, anyone know for sure?

I cannot believe that there is no way to tell ffmpeg to extract all frames
without repetition or dropping, shouldnt that be the default, and the
behaviour I see a bug?









2017-11-04 23:34 GMT+01:00 Carl Eugen Hoyos :

> 2017-11-04 17:45 GMT+01:00 Mikael Persson :
> > The command:
> >
> > ffmpeg -i somevideo.someformat %07d.png
>
> Complete, uncut console output missing, please
> remember that only current FFmpeg git head is
> supported here.
>
> You may be searching for -vsync vfr
>
> Carl Eugen
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Random repetitions in output

2017-11-04 Thread Carl Eugen Hoyos
2017-11-04 17:45 GMT+01:00 Mikael Persson :
> The command:
>
> ffmpeg -i somevideo.someformat %07d.png

Complete, uncut console output missing, please
remember that only current FFmpeg git head is
supported here.

You may be searching for -vsync vfr

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Random repetitions in output

2017-11-04 Thread Mikael Persson
The command:

ffmpeg -i somevideo.someformat %07d.png

I would expect this to extract every frame in the sequence and losslessly
encode them as png.

What actually happens varies with ffmpeg version, 3.3.3 seems to extract
all or atleast most frames, but its hard to tell. The version in the ubuntu
16.04 repo instead extracts most or all frames and duplicates a few of
them. Sometimes up to 10 x times in a row.

Version 3.3.3 also does not extract identical files when run on mac and
linux. The difference isnt visible, but the md5sums dont match.

I want to extract every frame from the beginning to the end of the video,
so this isnt a question of seek accuracy.

Is there a command that extracts every single frame, repeatably, regardless
of os, input codec etc, without duplicates or skips from a video?



Cheers
//Mikael
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".