Re: [FFmpeg-user] Set keyframe interval raw video

2016-10-25 Thread Anatol
On Thu, Oct 20, 2016 at 12:13 PM, Carl Eugen Hoyos <ceffm...@gmail.com>
wrote:

> 2016-10-20 10:38 GMT+02:00 Gabor Alsecz <alse...@gmail.com>:
> > Dear All,
> >
> > Would like to know what is the best way/parameter to force key frame
> > interval. I would need 2*FPS
> > I'm feeding FFmpeg's stdout with raw images at fps 25.
>
> > So far i have the following command:
>
> > ffmpeg -y -loglevel info  -f lavfi -i aevalsrc=0  -f rawvideo  -pix_fmt
> > rgb24 -video_size 1280x720 -framerate=25 -i "-"  -f flv -acodec aac
> -vcodec
>
> I don't think this is supposed to work.
>
> > h264_nvenc  -profile:v high -vf "fps=25,format=yuv420p" -minrate 3000k
>
> Careful with the fps filter: If input fps == output fps, don't use it to be
> on the safe side.
>
> > -maxrate 3000k -bufsize 6000k output.mp4
>
> -g should set the keyframe interval.
>
> Carl Eugen
>

Carl,
Why we should be careful with the fps filter?
What's wrong with it?

Anatol
___
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] theoretical concurrency limitations

2016-09-16 Thread Anatol
On Fri, Sep 16, 2016 at 3:31 PM, Carl Eugen Hoyos <ceffm...@gmail.com>
wrote:

> 2016-09-16 14:19 GMT+02:00 Anatol <anatol2...@gmail.com>:
>
> > The high thread count caused significant quality reduction
> > with older ffmpeg/x264 encoders.
>
> So this has nothing to do with FFmpeg at all?
>
> 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".
>

I don't know whether it is ffmpeg or x264 decision to use ALL the cores as
a default '-threads' behavior.
Did not check it.

The x264 encoder behavior with high thread count is surely on x264 side.
___
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] theoretical concurrency limitations

2016-09-16 Thread Anatol
Sorry for the top-post, unintentionally.

The high thread count caused significant quality reduction with older
ffmpeg/x264 encoders.
I'll run some tests with the newer versions and post the results.

In most cases there is no reason for multi threaded decoding.
On the other hand 4 threaded x264 encoding runs 2.5-3 times faster than a
single threaded encoding, assuming that there are enough free CPU.
With 4 threads the quality insignificantly lower, almost invisible.
Unfortunately, I did not keep the PSNR results.
___
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] aes-ctr cipher

2016-08-09 Thread Anatol
It works only with MP4

On Tue, Aug 9, 2016 at 4:31 PM, Saelis  wrote:

> Hi,
>
> I see that aes-ctr support is included in FFmpeg since commit
> 23ac99dc17b0c4ff43bb56c1f8cbe7feb34bada5
> (https://ffmpeg.org/pipermail/ffmpeg-cvslog/2015-December/096510.html).
>
> I can't find documentation on how to use this feature.
> Does anyone have a working exemple to cipher mpeg-ts segments with aes-ctr
> ?
>
> Thanks a lot.
>
>
>
>
>
> --
> View this message in context: http://ffmpeg-users.933282.n4.
> nabble.com/aes-ctr-cipher-tp4677029.html
> Sent from the FFmpeg-users mailing list archive at Nabble.com.
> ___
> 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] [CVBR] How to generate .MP4 or .TS files

2016-05-06 Thread Anatol
May be MP4/MPEG-TS do not support Opus audio?

Kindly, send the command line that u used end the output printout.
Kindly.

On Wed, May 4, 2016 at 2:53 PM, Karthik Gowda  wrote:

> All,
>
> I have generated a .MP4 or .TS with CVBR[constrained]bitrate mode, Kindly
> help me command for the same.
>
> I came to know that i can generated using libpous.
> https://www.ffmpeg.org/ffmpeg-codecs.html
>
> But i fail to get a command for AV with CVBR, Kindly help me
>
> Thanks and regard
> Karthik K
> ___
> 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] Interlaced x264

2016-04-07 Thread Anatol
Andy,
U don't see 'weightp' warning, because I have 'weightp=0' at the end of the
'x264opts' list in my "monster" command line (its sometimes a fun to be a
monster ...).
The results with ffmpeg3 are the same (for monster and simple cmd-lines).
In all cases the x264 gets the correct interlaced params - media info shows
"interlaced=tff" in the 'Encoding settings', but the 'idet' test remains
the same.

But, it look like 'tinterlace' produces something more meaningful -

[Parsed_idet_0 @ 0x1fdb060] Repeated Fields: Neither:   118 Top: 0
Bottom: 2
[Parsed_idet_0 @ 0x1fdb060] Single frame detection: TFF:   105 BFF: 2
Progressive: 1 Undetermined:12
[Parsed_idet_0 @ 0x1fdb060] Multi frame detection: TFF:   120 BFF: 0
Progressive: 0 Undetermined: 0

But only with 'simple' cmd line:

ffmpeg -threads 1 -i BBB_30sec.mp4 -c:v libx264 -vf
"tinterlace,fieldorder=tff" -flags +ilme+ildct -threads 4  -y
BBB_30sec_interlaced.ts


Do u know whether there are any quality or other issues with 'tinterlace'
filter?

Thanks,
Anatol
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


Re: [FFmpeg-user] Interlaced x264

2016-04-05 Thread Anatol
Kim,
I used that flag ("-flags +ilme+ildct"),
but got the results that u can see above
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


Re: [FFmpeg-user] Interlaced x264

2016-04-05 Thread Anatol
The idet results are of an output file.
The source is progressive.
I don't have the command line of the sample file.

I am aware that those are unrelated issues, but thanks for the clear
expatiation, it helped me to understand it better.
I'll try the 'interlace' filter, but skip the 'phase' filter.

Do u know how can I make it encoded in a way that it will be identified as
TFF?

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


Re: [FFmpeg-user] Interlaced x264

2016-04-05 Thread Anatol
Following are idet results of my file:

[Parsed_idet_0 @ 0x1dee2c0] Repeated Fields: Neither:   903 Top: 0
Bottom: 1
[Parsed_idet_0 @ 0x1dee2c0] Single frame detection: TFF: 0 BFF: 0
Progressive:   220 Undetermined:   684
[Parsed_idet_0 @ 0x1dee2c0] Multi frame detection: TFF: 0 BFF: 0
Progressive:   902 Undetermined: 2

While those are idet of a sample file that was generated from the same
source and with similar encoding params (more or less), but with PAFF/TFF:

[Parsed_idet_0 @ 0x19e7540] Repeated Fields: Neither:   884 Top:11
Bottom: 5
[Parsed_idet_0 @ 0x19e7540] Single frame detection: TFF:   572 BFF: 0
Progressive: 2 Undetermined:   326
[Parsed_idet_0 @ 0x19e7540] Multi frame detection: TFF:   900 BFF: 0
Progressive: 0 Undetermined: 0

Well, it would be nice if the Mediainfo would say it that it is
'interlaced' with 'Top Field First' scan order,
but my main concern that those files have different structure, therefore
the file that I generated won't comply with the sample file that I got.

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


[FFmpeg-user] Interlaced x264

2016-04-05 Thread Anatol
Hi,
I am looking for a way to create interlaced x264 TFF file.
The media info result that I get is

Scan type: MBAFF

The scan order is not mentioned.
The '-vf idet' check of the resultant file is considerably different
compared to an interlaced PAFF file.

Command line:

ffmpeg -threads 1 -i
/web//content/r71v1/entry/data/551/98/1_jpzy9xr0_1_t3mdjl8h_11.mp4 -c:v
libx264  -subq 7 -qcomp 0.6 -qmin 10 -qmax 50 -qdiff 4 -bf 16 -coder 1
-refs 6 -x264opts
b-pyramid:weightb:mixed-refs:8x8dct:no-fast-pskip=0:interlaced=1:tff=1:weightp=0
-vprofile high -force_key_frames expr:'gte(t,n_forced*2)' -pix_fmt yuv420p
-b:v 4000k -s 720x480 -r 29.97 -g 60 -aspect 720:480 -c:a libfdk_aac -b:a
128k -ar 48000 -ac 2 -f mpegts -flags +loop+mv4 -cmp 256 -partitions
+parti4x4+partp8x8+partb8x8 -trellis 1 -refs 3 -me_range 16 -keyint_min 20
-sc_threshold 40 -i_qfactor 0.71 -bt 1200k -maxrate 4000k -bufsize 8000k
-rc_eq 'blurCplx^(1-qComp)' -aspect 4:3 -top 1 -flags +ilme+ildct  -vsync 1
-threads 4  -y BBB_30sec_interlaced.ts

Uncut console output - in the attached file.

Thanks in advance,
Anatol


uncut.log
Description: Binary data
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


Re: [FFmpeg-user] Which command line and version do I need to reproduce those properties?

2015-12-27 Thread Anatol
try to add:
-profile main -pix_fmt yuvj420p -aspect 1280:720

It could help if u added the ffprobe printout of the resultant file.
Anyhow your printout does not represent the structure of the TEST.MOV file.

On Sat, Dec 26, 2015 at 10:22 PM, Alexander Winnig <
vernehmlass...@googlemail.com> wrote:

> I have a file for which ffmpeg gave those properties:
>
>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'TEST.MOV':
>>   Metadata:
>> major_brand : qt
>> minor_version   : 0
>> compatible_brands: qt
>> creation_time   : 2015-12-26 07:45:26
>>   Duration: 00:00:02.75, start: 0.00, bitrate: 4935 kb/s
>> Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661),
>> yuvj420p(pc), 1280x720 [SAR 1:1 DAR 16:9], 4775 kb/s, 59.94 fps, 59.94 tbr,
>> 180k tbn, 119.88 tbc (default)
>> Metadata:
>>   creation_time   : 2015-12-26 07:45:26
>>   handler_name: Ambarella AVC
>> Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono,
>> fltp, 64 kb/s (default)
>> Metadata:
>>   creation_time   : 2015-12-26 07:45:26
>>   handler_name: Ambarella AAC
>>
>
>
> Which command line and version do I need to reproduce those properties?
>
> I tried
>
> ffmpeg -i "test.mp4" -s 1280x720 -vcodec libx264 -c:a libvo_aacenc -q:a 3
>> -r 59.94 -b:v 4935k -b:a 64k -ac 1 -ar 48000 TEST2.MOV
>>
>
> But it's not the same.
>
> Goal is simple: my actioncam has a hdmi-output. I want to watch movies
> next to my own footage using my actioncam when I am abroad. Goal is to make
> the actioncam think, it was it's own footage to play it back. Currently I
> only get 'invalid'.
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user


Re: [FFmpeg-user] ffprobe -show_frames values

2015-05-13 Thread Anatol
Thanks Werner.
I believe that u'll find out that disabling scene cut detection might cause
a significant quality reduction.
Therefore, activating together the forced keyframes and the scene cut
detection is probably the most reasonable compromise.

On Wed, May 13, 2015 at 12:47 PM, Werner Robitza werner.robi...@gmail.com
wrote:

 On Wed, May 13, 2015 at 7:07 AM, Anatol anatol2...@gmail.com wrote:
  Werner, can you please shortly explain the no-scenecut issue.
  Without scenecut detection, if such event occurs in the middle of the
 GOP,
  as it usually does, the video quality till the end of the GOP will be
  rather compromised. It appears as a 'breathing effect'.
  It is mostly stands out when a high quality video played on a large
 screen.
  Is there a way to avoid such effects without scene cut detection?

 I haven't seen this in real life but we had pretty short GOPs in our
 tests. Could it be that the bitrate is generally too low then?

 Perhaps the qpstep value can be increased to allow the encoder to
 choose a lower QP for the non-I frames following a scene cut.

 I still have to test the force_key_frames method to see whether the
 quality is really noticeably worse compared to disabling scene-cut
 detection altogether.
 ___
 ffmpeg-user mailing list
 ffmpeg-user@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] ffprobe -show_frames values

2015-05-12 Thread Anatol
You don't have to disable scene cut detection. Without scencut the video
quality is dramatically lower than when it is used.
'force_key_frames' and 'scenecut' work just fine together. Such videos
passes Apple AppStore validation and Akamai does not complain about it
either.
Make sure to disable '-g' option, occasionally x264 generates both forced
and '-g', increasing the bitrate, reducing the quality and causing some
other mess.

On Tue, May 12, 2015 at 12:26 PM, Werner Robitza werner.robi...@gmail.com
wrote:

 On Mon, May 11, 2015 at 10:49 PM, Joel Lopez badassmexi...@gmail.com
 wrote:
  Could I just run my unaligned files through ffmpeg again with a set
  keyframe interval and disabled scene cut detection?
 
  Or do I need to scrap them and re-encode the source file and generate
  new files that are properly aligned?  We have thousands and am trying
  to save time where possible.

 You will have to re-encode the files from source.

 (Please do not top-post.)
 ___
 ffmpeg-user mailing list
 ffmpeg-user@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] ffprobe -show_frames values

2015-05-12 Thread Anatol
Large gop value is good enough for disabling it.


On Tue, May 12, 2015 at 2:25 PM, Werner Robitza werner.robi...@gmail.com
wrote:

  Make sure to disable '-g' option, occasionally x264 generates both forced
  and '-g', increasing the bitrate, reducing the quality and causing some
  other mess.

 There's no way to disable the -g option. If you don't use it, x264
 will stick to the default values of keyint=250 and min-keyint=25.
 ___
 ffmpeg-user mailing list
 ffmpeg-user@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Use force_key_frames to obtain keyframes at exactly the same positions as in the input stream?

2015-05-05 Thread Anatol
Added a small patch to support 'source' option for 'force_key_frames' -
https://github.com/anatolschwarz/FFmpeg/commit/1968f5fd83fcece5422b7bca4a37e48087774915

On Sun, May 3, 2015 at 2:12 AM, Henk D. Schoneveld belca...@zonnet.nl
wrote:


  On 02 May 2015, at 22:32, Anatol anatol2...@gmail.com wrote:
 
  Henk,
  Live streaming, not files.
 OK, I was thinking with options as pause and go back in time, but you only
 intend linear streaming.
 Sorry for the misunderstanding.
 
  On Sat, May 2, 2015 at 10:32 PM, Henk D. Schoneveld belca...@zonnet.nl
  wrote:
 
 
  On 02 May 2015, at 21:11, Anatol anatol2...@gmail.com wrote:
 
  Henk,
  Its a real problem, if the streams are un-aligned, the playback gets
 into
  jump-forward-backward mood.
  If you create a 5min source file and split in 5 1 minute chunks with the
  help of the hls function of ffmpeg.
  Then create 3 other quality streams form these chunks.
  This results in a total of 4 hls compatible streams where switching
  between each of them should be without any problem I think.
  It's not a problem to get source file key frames and to have them
 encoded
  into the rest of the files.
  The problem is with a live streaming, because it is not possible to
 query
  it for the keyframe lications
 
  Reuben,
  The whole idea is to avoid intense CPU consumption for LIVE streaming.
 
 
  On Sat, May 2, 2015 at 8:31 PM, Reuben Martin reube...@gmail.com
  wrote:
 
  On Saturday, May 02, 2015 06:00:32 PM Haris Zukanovic wrote:
  My case is live streaming.
  I have tried it and definitely keyframes are not aligned between
 input
  and output streams.
  For all encoded output streams it is very simple to obtain alignement
  with setting the fixed GOP size. But the PTS and keyframes of input
 are
  never aligned with that.
 
 
  I’ve had success with it as long as I encode all the derivative
 streams
  at
  once from the same encoder process. This of course can consume
  significant
  CPU
  resources.
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

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


Re: [FFmpeg-user] Use force_key_frames to obtain keyframes at exactly the same positions as in the input stream?

2015-05-02 Thread Anatol
I don't think that 'keep source keyframes' might impose any a/v sync issues
that differ from any other encoding flows.
AFIAK, 'force_key_frames' acts on the output/encoding, it does not aware of
the decoding processing. For that matter - scene cuts are evaluated from
post-decoding/raw frames.

On Sat, May 2, 2015 at 12:31 PM, Haris Zukanovic 
haris.zukanovi...@gmail.com wrote:

 My simple idea was that instead of deducing from a formula like
 -force_key_frames 'expr:gte(t,n_forced*5)'
 force_key_frames somehow took this kind of info directly from the input
 stream and passed onto all output streams

 This could be called something like

 -force_key_frames 'from_source'


 Do you think it is possible to do?





 On 5/2/15 10:41 AM, Anatol wrote:

 It does not matter the type of the incoming protocol.
 And slight un-alignment tolerated by the CDN providers and Apple HLS
 validation tools.
 Therefore the source live stream can be used in an adaptive-bitrate sets,
 IF the other streams match their key frames.
 By the way Wowza has this option (keep Source key frames) in its
 Transcoder add-on.
 But Wowza also has other problems ...


 On Sat, May 2, 2015 at 11:06 AM, Henk D. Schoneveld belca...@zonnet.nl
 wrote:

  On 02 May 2015, at 06:27, Anatol anatol2...@gmail.com wrote:

 The idea is to gain the option to use the H264 source stream along with
 live transcoded streams in an adaptive bitrate delivery modes (HLS, HDS,
 etc), that require aligned keyframes on ALL participating streams.

 Could it be ALL, except the livestream itself ?
 Or is the livestream also available via HLS ?
 If yes, then you’ll have to encode this one as well.
 This can only be achieved if the source stream is encoded with the same
 version of the encoder you’re using your self. I can imagine that
 different
 encoders could behave slightly different.
 BTW what is your source ? Is it predictable like DVB-S from the same
 broadcaster ?
  From the top of my head BBC broadcast has an I-frame every 12 or 13
 frames.
 Another potential issue could be the delay between the video and audio
 stream, which would force you to also encode the source stream.
 Hope it helps.

 On Sat, May 2, 2015 at 2:48 AM, Henk D. Schoneveld belca...@zonnet.nl
 wrote:

  On 01 May 2015, at 20:43, Haris Zukanovic haris.zukanovi...@gmail.com

 wrote:

 Indeed force-ing keyframes at certain positions is meant to keep

 multiple

 output encodings keyframe aligned. The input stream is already h264 in

 our

 case.
 Moreover, if one could copy all iframe positions, and possibly also

 all

 other frametypes from the input stream there would not be any need for
 scene detection if that was already done in the input stream. I am not

 sure

 how much heavy lookahead calculations and perhaps other heavy

 calculations

 could also be skipped?

 What are you trying to achieve ? A performance boost ? I don’t think

 that

 you’ll achieve improvement worthwhile, if anything at all. The working

 of

 the encoder should need to be totally rewritten to make something like

 this

 happen at all. Encoding of a frame depends on former and following

 frames,

 the result I P or B frame is the result. Your source is h264  already,

 so I

 think you’ll rescale and re-encode to achieve that. The calculation has

 to

 be done. Knowing in advance that it will be en I P or B frame won’t make
 any difference in the amount of calculations in my opinion.

 On May 1, 2015 7:42 PM, Henk D. Schoneveld belca...@zonnet.nl

 wrote:

 On 01 May 2015, at 13:06, Haris Zukanovic 

 haris.zukanovi...@gmail.com

 wrote:

 Is the decision about exactly which frame to make an IDR frame made

 in

 x264 or ffmpeg?
 In general I-frames are placed at scene-changes, this can happen

 random.

 Additionally you can can force an I-frame every arbitrary amount of

 frames

 by specifying the gop-size. The function of an I-frame is to hold max

 frame

 info P and B frames build on that complete I-frame. It doesn’t make

 sense

 from an encoding viewpoint to skip an I-frame at a scene-change, it’s

 just

 impossible.
 Adding more than ‘a minimum amount’ of I-frames only makes sense for
 seeking purposes, at the cost of less compression/higher then

 necessary

 bitrate.

 Any pointer or advice on where to look for this in the code?


 On 4/29/15 8:54 PM, Anatol wrote:

 No responses on that one?
 It is very important issue.

 On Mon, Apr 27, 2015 at 11:47 PM, Haris Zukanovic 
 haris.zukanovi...@gmail.com wrote:

  Hello,
 Can I use force_key_frames in some way to produce keyframes (IDR,

 not

 I-frames) at exactly the same PTS in output streams as they are

 found

 in

 the live input stream? Both input and output are h264 and live

 streaming.

 Something analogous to using 2 pass encoding for VOD and in the

 second

 pass keyframes are inserted exactly where they are recorded in the

 first

 pass... Is that something like that even theoretically doable for

 live

 streaming?



 thanx

Re: [FFmpeg-user] Use force_key_frames to obtain keyframes at exactly the same positions as in the input stream?

2015-05-02 Thread Anatol
It does not matter the type of the incoming protocol.
And slight un-alignment tolerated by the CDN providers and Apple HLS
validation tools.
Therefore the source live stream can be used in an adaptive-bitrate sets,
IF the other streams match their key frames.
By the way Wowza has this option (keep Source key frames) in its
Transcoder add-on.
But Wowza also has other problems ...


On Sat, May 2, 2015 at 11:06 AM, Henk D. Schoneveld belca...@zonnet.nl
wrote:


  On 02 May 2015, at 06:27, Anatol anatol2...@gmail.com wrote:
 
  The idea is to gain the option to use the H264 source stream along with
  live transcoded streams in an adaptive bitrate delivery modes (HLS, HDS,
  etc), that require aligned keyframes on ALL participating streams.
 Could it be ALL, except the livestream itself ?
 Or is the livestream also available via HLS ?
 If yes, then you’ll have to encode this one as well.
 This can only be achieved if the source stream is encoded with the same
 version of the encoder you’re using your self. I can imagine that different
 encoders could behave slightly different.
 BTW what is your source ? Is it predictable like DVB-S from the same
 broadcaster ?
 From the top of my head BBC broadcast has an I-frame every 12 or 13 frames.
 Another potential issue could be the delay between the video and audio
 stream, which would force you to also encode the source stream.
 Hope it helps.
 
  On Sat, May 2, 2015 at 2:48 AM, Henk D. Schoneveld belca...@zonnet.nl
  wrote:
 
 
  On 01 May 2015, at 20:43, Haris Zukanovic haris.zukanovi...@gmail.com
 
  wrote:
 
  Indeed force-ing keyframes at certain positions is meant to keep
 multiple
  output encodings keyframe aligned. The input stream is already h264 in
  our
  case.
  Moreover, if one could copy all iframe positions, and possibly also
 all
  other frametypes from the input stream there would not be any need for
  scene detection if that was already done in the input stream. I am not
  sure
  how much heavy lookahead calculations and perhaps other heavy
  calculations
  could also be skipped?
  What are you trying to achieve ? A performance boost ? I don’t think
 that
  you’ll achieve improvement worthwhile, if anything at all. The working
 of
  the encoder should need to be totally rewritten to make something like
 this
  happen at all. Encoding of a frame depends on former and following
 frames,
  the result I P or B frame is the result. Your source is h264  already,
 so I
  think you’ll rescale and re-encode to achieve that. The calculation has
 to
  be done. Knowing in advance that it will be en I P or B frame won’t make
  any difference in the amount of calculations in my opinion.
  On May 1, 2015 7:42 PM, Henk D. Schoneveld belca...@zonnet.nl
 wrote:
 
 
  On 01 May 2015, at 13:06, Haris Zukanovic 
 haris.zukanovi...@gmail.com
 
  wrote:
 
  Is the decision about exactly which frame to make an IDR frame made
 in
  x264 or ffmpeg?
  In general I-frames are placed at scene-changes, this can happen
 random.
  Additionally you can can force an I-frame every arbitrary amount of
  frames
  by specifying the gop-size. The function of an I-frame is to hold max
  frame
  info P and B frames build on that complete I-frame. It doesn’t make
  sense
  from an encoding viewpoint to skip an I-frame at a scene-change, it’s
  just
  impossible.
  Adding more than ‘a minimum amount’ of I-frames only makes sense for
  seeking purposes, at the cost of less compression/higher then
 necessary
  bitrate.
  Any pointer or advice on where to look for this in the code?
 
 
  On 4/29/15 8:54 PM, Anatol wrote:
  No responses on that one?
  It is very important issue.
 
  On Mon, Apr 27, 2015 at 11:47 PM, Haris Zukanovic 
  haris.zukanovi...@gmail.com wrote:
 
  Hello,
  Can I use force_key_frames in some way to produce keyframes (IDR,
 not
  I-frames) at exactly the same PTS in output streams as they are
 found
  in
  the live input stream? Both input and output are h264 and live
  streaming.
 
  Something analogous to using 2 pass encoding for VOD and in the
  second
  pass keyframes are inserted exactly where they are recorded in the
  first
  pass... Is that something like that even theoretically doable for
  live
  streaming?
 
 
 
  thanx
 
  --
  --
  Haris Zukanovic
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  --
  --
  Haris Zukanovic
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list

Re: [FFmpeg-user] Use force_key_frames to obtain keyframes at exactly the same positions as in the input stream?

2015-05-02 Thread Anatol
Henk,
Its a real problem, if the streams are un-aligned, the playback gets into
jump-forward-backward mood.
It's not a problem to get source file key frames and to have them encoded
into the rest of the files.
The problem is with a live streaming, because it is not possible to query
it for the keyframe lications

Reuben,
The whole idea is to avoid intense CPU consumption for LIVE streaming.


On Sat, May 2, 2015 at 8:31 PM, Reuben Martin reube...@gmail.com wrote:

 On Saturday, May 02, 2015 06:00:32 PM Haris Zukanovic wrote:
  My case is live streaming.
  I have tried it and definitely keyframes are not aligned between input
  and output streams.
  For all encoded output streams it is very simple to obtain alignement
  with setting the fixed GOP size. But the PTS and keyframes of input are
  never aligned with that.
 

 I’ve had success with it as long as I encode all the derivative streams at
 once from the same encoder process. This of course can consume significant
 CPU
 resources.
 ___
 ffmpeg-user mailing list
 ffmpeg-user@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Use force_key_frames to obtain keyframes at exactly the same positions as in the input stream?

2015-05-02 Thread Anatol
Henk,
Live streaming, not files.

On Sat, May 2, 2015 at 10:32 PM, Henk D. Schoneveld belca...@zonnet.nl
wrote:


  On 02 May 2015, at 21:11, Anatol anatol2...@gmail.com wrote:
 
  Henk,
  Its a real problem, if the streams are un-aligned, the playback gets into
  jump-forward-backward mood.
 If you create a 5min source file and split in 5 1 minute chunks with the
 help of the hls function of ffmpeg.
 Then create 3 other quality streams form these chunks.
 This results in a total of 4 hls compatible streams where switching
 between each of them should be without any problem I think.
  It's not a problem to get source file key frames and to have them encoded
  into the rest of the files.
  The problem is with a live streaming, because it is not possible to query
  it for the keyframe lications
 
  Reuben,
  The whole idea is to avoid intense CPU consumption for LIVE streaming.
 
 
  On Sat, May 2, 2015 at 8:31 PM, Reuben Martin reube...@gmail.com
 wrote:
 
  On Saturday, May 02, 2015 06:00:32 PM Haris Zukanovic wrote:
  My case is live streaming.
  I have tried it and definitely keyframes are not aligned between input
  and output streams.
  For all encoded output streams it is very simple to obtain alignement
  with setting the fixed GOP size. But the PTS and keyframes of input are
  never aligned with that.
 
 
  I’ve had success with it as long as I encode all the derivative streams
 at
  once from the same encoder process. This of course can consume
 significant
  CPU
  resources.
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

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


Re: [FFmpeg-user] Use force_key_frames to obtain keyframes at exactly the same positions as in the input stream?

2015-05-01 Thread Anatol
The idea is to gain the option to use the H264 source stream along with
live transcoded streams in an adaptive bitrate delivery modes (HLS, HDS,
etc), that require aligned keyframes on ALL participating streams.

On Sat, May 2, 2015 at 2:48 AM, Henk D. Schoneveld belca...@zonnet.nl
wrote:


  On 01 May 2015, at 20:43, Haris Zukanovic haris.zukanovi...@gmail.com
 wrote:
 
  Indeed force-ing keyframes at certain positions is meant to keep multiple
  output encodings keyframe aligned. The input stream is already h264 in
 our
  case.
  Moreover, if one could copy all iframe positions, and possibly also all
  other frametypes from the input stream there would not be any need for
  scene detection if that was already done in the input stream. I am not
 sure
  how much heavy lookahead calculations and perhaps other heavy
 calculations
  could also be skipped?
 What are you trying to achieve ? A performance boost ? I don’t think that
 you’ll achieve improvement worthwhile, if anything at all. The working of
 the encoder should need to be totally rewritten to make something like this
 happen at all. Encoding of a frame depends on former and following frames,
 the result I P or B frame is the result. Your source is h264  already, so I
 think you’ll rescale and re-encode to achieve that. The calculation has to
 be done. Knowing in advance that it will be en I P or B frame won’t make
 any difference in the amount of calculations in my opinion.
  On May 1, 2015 7:42 PM, Henk D. Schoneveld belca...@zonnet.nl wrote:
 
 
  On 01 May 2015, at 13:06, Haris Zukanovic haris.zukanovi...@gmail.com
 
  wrote:
 
  Is the decision about exactly which frame to make an IDR frame made in
  x264 or ffmpeg?
  In general I-frames are placed at scene-changes, this can happen random.
  Additionally you can can force an I-frame every arbitrary amount of
 frames
  by specifying the gop-size. The function of an I-frame is to hold max
 frame
  info P and B frames build on that complete I-frame. It doesn’t make
 sense
  from an encoding viewpoint to skip an I-frame at a scene-change, it’s
 just
  impossible.
  Adding more than ‘a minimum amount’ of I-frames only makes sense for
  seeking purposes, at the cost of less compression/higher then necessary
  bitrate.
  Any pointer or advice on where to look for this in the code?
 
 
  On 4/29/15 8:54 PM, Anatol wrote:
  No responses on that one?
  It is very important issue.
 
  On Mon, Apr 27, 2015 at 11:47 PM, Haris Zukanovic 
  haris.zukanovi...@gmail.com wrote:
 
  Hello,
  Can I use force_key_frames in some way to produce keyframes (IDR, not
  I-frames) at exactly the same PTS in output streams as they are found
  in
  the live input stream? Both input and output are h264 and live
  streaming.
 
  Something analogous to using 2 pass encoding for VOD and in the
 second
  pass keyframes are inserted exactly where they are recorded in the
  first
  pass... Is that something like that even theoretically doable for
 live
  streaming?
 
 
 
  thanx
 
  --
  --
  Haris Zukanovic
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  --
  --
  Haris Zukanovic
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user
 
  ___
  ffmpeg-user mailing list
  ffmpeg-user@ffmpeg.org
  http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

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


Re: [FFmpeg-user] Use force_key_frames to obtain keyframes at exactly the same positions as in the input stream?

2015-04-29 Thread Anatol
No responses on that one?
It is very important issue.

On Mon, Apr 27, 2015 at 11:47 PM, Haris Zukanovic 
haris.zukanovi...@gmail.com wrote:

 Hello,
 Can I use force_key_frames in some way to produce keyframes (IDR, not
 I-frames) at exactly the same PTS in output streams as they are found in
 the live input stream? Both input and output are h264 and live streaming.

 Something analogous to using 2 pass encoding for VOD and in the second
 pass keyframes are inserted exactly where they are recorded in the first
 pass... Is that something like that even theoretically doable for live
 streaming?



 thanx

 --
 --
 Haris Zukanovic

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

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


Re: [FFmpeg-user] Can I use ffmpeg to combine audio streams in .ts file?

2014-09-30 Thread Anatol
ffmpeg -i SOURCE.mov -i LOGO.png -c:v libx264  -subq 7 -qcomp 0.6 -qmin 10
-qmax 50 -qdiff 4 -bf 16 -coder 1 -refs 6 -x264opts
b-pyramid:weightb:mixed-refs:8x8dct:no-fast-pskip=0:nal-hrd=cbr -vprofile
high -force_key_frames expr:'gte(t,n_forced*2)' -pix_fmt yuv420p -b:v 550k
-s 640x360 -r 29.97 -g 60 -filter_complex
'[0:v][1:v]overlay=main_w-overlay_w-100:10' -c:a libfdk_aac -b:a 64k -ar
44100 -ac 2 -filter_complex
'[0:1][0:2]amix=inputs=2[aflt];[aflt]aresample=async=1:min_hard_comp=0.10:first_pts=0'
-map_chapters -1 -map_metadata -1  -f mp4 -flags +loop+mv4 -cmp 256
-partitions +parti4x4+partp8x8+partb8x8 -trellis 1 -refs 1 -me_range 16
-keyint_min 20 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 600k
-bufsize 1200k -rc_eq 'blurCplx^(1-qComp)' -level 30  -vsync 1 OUTPUT.mp4

Sample 'real-life' command line with 'filter_complex' for mixing audio
streams and adding burned-in logo ...

On Tue, Sep 30, 2014 at 3:49 PM, skyscan...@gmx.ca wrote:


 On Tue, 30 Sep 2014 10:45:37 +0200, barsn...@gmx.net wrote:

  Since you have already built an understanding of what you want to
  combine in which way, this page should give you some hints and examples
  of how to achieve that:

  https://trac.ffmpeg.org/wiki/AudioChannelManipulation

  Note that it goes beyond pure mapping, using e.g. the amerge and pan
  filters.

 Thank you, but I actually found that page a couple of days ago and it was
 not at all helpful to me for a couple of reasons. First, I am REALLY new to
 ffmpeg and don't yet understand how all the options work and interrelate,
 in fact I have the nagging feeling that the way I did use the options was
 probably not the best way, but ffmpeg is a VERY complex program and it's
 hard to figure out the correct way to do something like this.

 But also, all of the examples on that page are for a single stream. Every
 single example only mentions stream 0 - there is no reference anywhere to
 a stream 1, stream 2, etc. That is why I am beginning to wonder if
 ffmpeg even has the capability to merge streams. I have looked at a lot of
 pages on ffmpeg, some of which make some sense to me and many which didn't,
 but the common thread is that I could not find a single example anywhere of
 multiple streams being mixed down to a single stream or to fewer streams.
 The channel mapping is only a secondary concern to me and it's not going to
 bother me that much if I never get true 5.1, but not being able able to
 hear all the audio is the big issue now.

 Also that page seems to be dealing with audio files only, not video, and
 even in the example for 2 × stereo → stereo is talking about starting
 with two .wav files and converting them to a single .mp3 file. Once again,
 nothing at all is said about merging multiple audio streams from the same
 .ts file. So if you know of any examples of merging audio streams in files
 with video and audio present, that's what I really need to see right now.


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

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


Re: [FFmpeg-user] How to generate h.264 raw data

2014-09-25 Thread Anatol
Deron,
Please explain the data it generated did not look correct

Anatol

On Thu, Sep 25, 2014 at 7:16 PM, Deron de...@pagestream.org wrote:

 Is it possible to output just raw h.264 data? Better yet, both AnnexB and
 AVCC? Or is there a simple muxer that I can use that won't be so hard to
 look through to see the h.264?

 I tried

 ffmpeg -i test.avi -c:v libx264 -bsf h264_mp4toannexb -f h264 -an -y
 test.h264

 But the data it generated did not look correct, as far as I understand it
 (which is what I am trying to learn, so my understanding is very limited!).

 Thanks,
 Deron

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

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


Re: [FFmpeg-user] Concatenating two audio files

2014-07-31 Thread Anatol
Turn your WAV files into raw PCM files -
ffmpeg -i INPUT1 -c:a copy -vn -f s16le -y PCM1

Then u can either cat them together to get a raw PCM file or use ffmpeg
concat protocol:
ffmpeg -ar SAMPLE_RATE -channel_layout STEREO/MONO -f s16le -i
concat:PCM1|PCM2|... -vn -c:a copy -f wav -y OUTPUT


On Thu, Jul 31, 2014 at 1:47 PM, Stuart Bruce stuartrbr...@gmail.com
wrote:

 Hello

 I've been trying to get FFmpeg to concatenate two audio files together,
 based on the top answer from this forum:

 http://superuser.com/questions/587511/concatenate-multiple-wav-files-using-single-command-without-extra-file

 Although I believe I've replicated the winning answer, I can't seem to work
 out what the correct syntax is to make it work.

 My log output (original parameters and console output) is below. For
 security I've had to change all the actual file paths to '' but all
 the paths and files are valid.

 I'm hoping somebody could point me to the problem, which I'm hoping is
 something as simple as having a quote mark out of place or something like
 that. Any help would be very much appreciated.

 Thanks

 Stuart


 FFmpeg process log.
 Started: 31/07/2014 11:45:59
 exe:
 C:\Users\Stuart\***\FFmpeg\ffmpeg.exe
 Arguments:
 -i
 C:\Users\Stuart\AppData\*\cache\310714_3Vc1AQqWBXtqimH5Sj1j.wav
 -i
 C:\Users\Stuart\AppData\**\cache\310714_bGhog6vOWMmn8x4J8ADz.wav
 -filter_complex '[0:0][1:0]concat=n=2:v=0:a=1[out]' -map [out]
 C:\Users\Stuart\**\s-tk-220-00200.wav
 FFmpeg output:
 ffmpeg version N-53868-gc51654f Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Jun  6 2013 03:00:45 with gcc 4.7.3 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
 --enable-gnutls --enable-iconv --enable-libass --enable-libbluray
 --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc
 --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
 --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus
 --enable-librtmp --enable-libschroedinger --enable-libsoxr
 --enable-libspeex --enable-libtheora --enable-libtwolame
 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
 --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid
 --enable-zlib
   libavutil  52. 35.100 / 52. 35.100
   libavcodec 55. 15.100 / 55. 15.100
   libavformat55.  8.102 / 55.  8.102
   libavdevice55.  2.100 / 55.  2.100
   libavfilter 3. 75.101 /  3. 75.101
   libswscale  2.  3.100 /  2.  3.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc52.  3.100 / 52.  3.100
 Guessed Channel Layout for  Input Stream #0.0 : mono
 Input #0, wav, from
 'C:\Users\Stuart\*\cache\310714_3Vc1AQqWBXtqimH5Sj1j.wav':
   Metadata:
 encoder : Lavf55.8.102
   Duration: 00:00:04.18, bitrate: 705 kb/s
 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono,
 s16, 705 kb/s
 [wav @ 00353400] max_analyze_duration 500 reached at 5015510
 microseconds
 [wav @ 00353400] Estimating duration from bitrate, this may be inaccurate
 Guessed Channel Layout for  Input Stream #1.0 : stereo
 Input #1, wav, from
 'C:\Users\Stuart\**\cache\310714_bGhog6vOWMmn8x4J8ADz.wav':
   Duration: 00:00:05.20, bitrate: 1411 kb/s
 Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz,
 stereo, s16, 1411 kb/s
 [AVFilterGraph @ 0035bd80] No such filter:
 '[0:0][1:0]concat=n=2:v=0:a=1[out]'
 Error configuring filters.
 ___
 ffmpeg-user mailing list
 ffmpeg-user@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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