Re: [FFmpeg-user] Add subtitles to trimmed mp4

2021-02-12 Thread Leo Butler via ffmpeg-user
adam smith via ffmpeg-user  writes:

> Hi people, I have a subtitle question; yay. 
>
> I have a 2 minute mp4 that I am going to trim using -ss and -to . 
>
> I have a SRT subtitle file with timings that will line up with the trimmed 
> mp4. 
>
> If I try and trim the mp4 and add the subtitles at the same time, the trim is 
> ignored and the whole media file is encoded. 
>
> ffmpeg -y -i
> /data/disposable/localised_20210212-1147-u81zpu/full_mp4.mp4 -ss 10
> -to 40 -i https://somewhere/source/subtitles/subtitles.srt

I think you want to do

ffmpeg -y -ss 10 -t 30 -i input.mp4 -ss 10 -t 30 -i input.srt ...

See

https://ffmpeg.org/ffmpeg-all.html#toc-Main-options

Leo

> -filter_complex "[0:1]fifo[vout];[0:0]afifo[01_afifo]" -map "[vout]"
> -map "[01_afifo]" -map 1 -pix_fmt yuv420p -c:v libx264 -s 1920x1080
> -profile:v high -level:v 4.1 -refs:v 2 -keyint_min 50 -b:v 15000k -r
> 25 -ac 2 -bsf:a aac_adtstoasc -c:a libfdk_aac -ar 48000 -b:a 192k
> -c:s:0 mov_text -metadata:s:s:0 language=eng -flags +global_header -f
> tee
> "[f=mp4:movflags=+faststart]/data/disposable/transcode_20210212-1147-znbqck/edit_2805.mp4"

Do you mean to you `tee' with only one output sink?

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

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

[FFmpeg-user] Trying to stream to rtmp from my rsp4 and a GoPro

2021-02-12 Thread Mike Soultanian

Hey Everyone,

I'm trying to stream from my GoPro into a USB capture device through my 
Raspberry Pi 4 and send the feed up to Twitch or my rtmp server.  After 
a lot of head banging I realized that there were two things that were 
messing me up: 1) specifying an audio input seems to break things and 2) 
trying to use the h264_v4l2m2m hardware encoder also seems to mess 
things up.   After finding the ffmpeg streaming wiki here:


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

I was finally able to cobble this command-line together and get it 
working... kinda:


*ffmpeg -f v4l2 -video_size 1280x720 -framerate 30 -i /dev/video0 -c:v 
libx264 -preset veryfast -b:v 1984k -maxrate 1984k -bufsize 3968k -vf 
"format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100 -f flv 
rtmp://sfo.contribute.live-video.net/app/[my key]*


I say kinda because I can't seem to get audio working.  Now, I just want 
to say that using the QT v4l2 test utility I'm able to get audio and 
video simultaneously, so I know that the capture feed from my GoPro is 
healthy, and using ffmpeg I'm able to record either video from 
*/dev/video0* or audio from *plughw:2,0*, but it seems like whenever I 
add *-f alsa -i plughw:2,0* in addition to *-i /dev/video0*, it won't 
stream anything (or record anything during my recording attempts).


Am I missing something obvious here?  I was hoping that I'm just doing 
something stupid, but even looking on that wiki listed above it looks 
like all I need to do is add *-f alsa -ac 2 -i plughw:2,0* and it should 
work, but it just seems to kill the stream or record nothing.


Also, I'd love to be able to use the hardware encoder, so any thoughts 
on that would be appreciated, but getting both audio and video is the 
main priority.


Btw, if you're curious about what I'm doing, I'm trying to build a DIY 
mobile streaming rig that I can take hangliding/paragliding with me so 
people can watch.  I thought it would be a fun project but this portion 
has turned out to be quite challenging!!


Thanks!

Mike

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

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

[FFmpeg-user] Add subtitles to trimmed mp4

2021-02-12 Thread adam smith via ffmpeg-user
Hi people, I have a subtitle question; yay. 

I have a 2 minute mp4 that I am going to trim using -ss and -to . 

I have a SRT subtitle file with timings that will line up with the trimmed mp4. 

If I try and trim the mp4 and add the subtitles at the same time, the trim is 
ignored and the whole media file is encoded. 

ffmpeg -y -i /data/disposable/localised_20210212-1147-u81zpu/full_mp4.mp4 -ss 
10 -to 40 -i https://somewhere/source/subtitles/subtitles.srt -filter_complex 
"[0:1]fifo[vout];[0:0]afifo[01_afifo]" -map "[vout]" -map "[01_afifo]" -map 1 
-pix_fmt yuv420p -c:v libx264 -s 1920x1080 -profile:v high -level:v 4.1  
-refs:v 2 -keyint_min 50 -b:v 15000k -r 25 -ac 2 -bsf:a aac_adtstoasc -c:a 
libfdk_aac -ar 48000 -b:a 192k -c:s:0 mov_text -metadata:s:s:0 language=eng 
-flags +global_header -f tee 
"[f=mp4:movflags=+faststart]/data/disposable/transcode_20210212-1147-znbqck/edit_2805.mp4"


If I add the -ss and -to command to the subtitle input file too, the output 
file has been trimmed, but the subtitles are out of sync. The subtitles stay 
locked to the time of the source media. 

ffmpeg -y -i /data/disposable/localised_20210212-1147-u81zpu/full_mp4.mp4 -ss 
10 -to 40 -i https://somewhere/source/subtitles/subtitles.srt -ss 10 -to 40 
-filter_complex "[0:1]fifo[vout];[0:0]afifo[01_afifo]" -map "[vout]" -map 
"[01_afifo]" -map 1 -pix_fmt yuv420p -c:v libx264 -s 1920x1080 -profile:v high 
-level:v 4.1  -refs:v 2 -keyint_min 50 -b:v 15000k -r 25 -ac 2 -bsf:a 
aac_adtstoasc -c:a libfdk_aac -ar 48000 -b:a 192k -c:s:0 mov_text 
-metadata:s:s:0 language=eng -flags +global_header -f tee 
"[f=mp4:movflags=+faststart]/data/disposable/transcode_20210212-1147-znbqck/edit_2805.mp4"


Is there any way to force the subtitles in the SRT to be mapped to the time of 
the output?
I would prefer not to do it in two passes if possible. 

I can include console output if it helps but I am pretty sure I am just putting 
the command together incorrectly and nothing untoward is happening. 

Thanks in advance for your advice. 

Adam

Sent from my iPhone
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Is there something about inputting raw frames

2021-02-12 Thread pdr0
Mark Filipak (ffmpeg) wrote
> On 02/12/2021 10:34 AM, pdr0 wrote:
>> Mark Filipak (ffmpeg) wrote
> 
> -snip-
> 
>> "72fps" or "144fps" equivalent in a cinema is not the same thing - the
>> analogy would be the cinema is repeating frames, vs interpolating new
>> in-between frames on a motion flow TV. ...
> 
> To some transcodes, repeating frames does apply. To interpolation, some
> other considerations apply. 
> Also, I contend that, due to its real-time schedule, a motion flow TV
> can't faithfully reproduce 24 
> pictures per second converted to 60 pictures per second via motion vector
> interperpolation.

Motion flow in TV's is the hardware (realtime) implementation of software
optical flow. There are different trade names by different manufacturers,
but they all use motion interpolation and optical flow.  For a 24pN native
source, it's a real time conversion to 120fps, then evenly divided by 2 for
60fps. Each frame is "evenly spaced in time".   It produces similar results
to mvtools2, interframe, twixtor, svpflow, kronos, DAIN, all the ones I
mentioned in your other thread . The TV version of optical flow even produce
similar artifacts. This has been around for many years, probably 10-15
years,  and those TV optical flow sets almost as long. It might be new to
you , but this is all old news.



If you're still interested, I tested the avs script and produces the proper
results you want for the checkerblend with InterleaveEvery . The short
version is it's probably not worth it if you're using libx265. Minterpolate
was your bottleneck; interframe or any interplolation script is unlikely to
be a bottleneck unless you use very slow settings




Observations . This was tested on a 5 year old laptop. 

If we take Interframe @ 6/1001 ( Preset="medium", Tuning="smooth",
InputType="2D", NewNum=6, NewDen=1001, GPU=True) I used cores=8 prefetch
8 for the "baseline" avs version

Interframe @6/1001 ffmpeg pipe speed 38-39fps
Interframe @48000/1001 ffmpeg pipe speed 46-47fps
Interleaveevery checker ffmpeg pipe speed  49-50fps (interesting that this
was faster than the Interframe 48000/1001 run alone)

Actual encoding speeds
interframe @6/1001 libx265 8-8.5fps
interleaveevery checker libx265 7-7.5fps (interesting that the pipe speed
was faster, but the actual encoding speed slower than just using interframe)
interframe @6/1001 libx264 21-22fps
interleaveevery checker libx264 22-23fps




You can measure pipe speed vs actual encoding speeds to help determine where
some bottlenecks are

ffmpeg -i input.avs -an -f null NUL

or

vspipe --y4m input.vpy - | ffmpeg -f yuv4mpegpipe -i - -an -f null NUL

There are other tools like vsedit, avspmod, avsmeter that can help you
optimize scripts by benchmarking speeds, so you can adjust settings, preview
results. If you're not using these, they are helpful tools that complement
ffmpeg workflows



When you were using minterpolate - that was probably the bottleneck. So any
filter chain speed optimization will make a significant difference in
realized encoding speed when using minterpolate , and could be worth
pursuing if speed optimization vs. quality was your goal. 

But interframe pipe speed into ffmpeg is much faster, and generally not the
bottleneck. (You could use faster interframe settings if you needed to). 
It's better to address bottlenecks (more "bang for you buck") . On this
hardware, when using the checker blend approach, there was marginal speed
improvement with additional artifacts and jerkiness , and it actually was
slower than just interframe when using libx265 - that latter observation was
unexpected because the pipe speed was faster than Interframe @6/1001 .
Might be some threading issues with the avs version, or some LUTs not
optimized eg. mt_lutspa for the checker mask


On my setup, libx265 (using your same settings) - is the bottleneck. So
adusting the script or filters will make little differnece (but  faster
script means more resources for libx265 to use, it'll be marginally faster)
. YMMV between hardware. In all cases , the input pipe speed is
significantly faster than the actual libx265 encoding speed. Just switching
to libx264 or using faster libx265 settings more than doubled the speed for
me

Check your bottlenecks; if you need more info on scripts or procedure or
samples let me know. I don't think I can easily translate it to vapoursynth,
my python is weak. The InterleaveEvery function and frame based nature of
avisynth is what makes it easy to do




--
Sent from: http://ffmpeg-users.933282.n4.nabble.com/
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Is there something about inputting raw frames

2021-02-12 Thread Mark Filipak (ffmpeg)

On 02/12/2021 10:34 AM, pdr0 wrote:

Mark Filipak (ffmpeg) wrote


-snip-


"72fps" or "144fps" equivalent in a cinema is not the same thing - the
analogy would be the cinema is repeating frames, vs interpolating new
in-between frames on a motion flow TV. ...


To some transcodes, repeating frames does apply. To interpolation, some other considerations apply. 
Also, I contend that, due to its real-time schedule, a motion flow TV can't faithfully reproduce 24 
pictures per second converted to 60 pictures per second via motion vector interperpolation.


I respectfully submit that words alone are inadequate to describe what we 
discuss.

I present the following to introduce a notation, not to be pedantic -- I know you know this stuff, 
but you're not familiar with the notation. Consider these:


60fps24pps.repeat(30fps24pps.telecine(24fps24pps))
60fps24pps.telecine(48fps24pps.repeat(24fps24pps))
60fps48pps.telecine(48fps48pps.interpolate(24fps24pps))
60fps60pps.interpolate(24fps24pps)

Expansions & diagrams -- I apologize if your email client makes soup of the diagrams by wrapping 
lines. If so, kindly copy this whole message into a plain text editor. Hopefully your email client 
will preserve all the spaces properly.


60fps[24pps].repeat(30fps[24pps].telecine(24fps[24pps])) is 24pps @ 24fps telecined to 30fps, then 
frame repeated to 60fps.
+--+ 
1/6 second
[A.a_][B.b_][C.c_][D.d_] 
24fps[24pps] source
[A.a___][B.b___][B.c___][C.d___][D.d___] 
30fps[24pps].telecine(24fps[24pps])
[A.a___][A.a___][B.b___][B.b___][B.c___][B.c___][C.d___][C.d___][D.d___][D.d___] 
60fps[24pps].repeat(30fps[24pps].telecine(24fps[24pps]))
 
 40% comb @ 6Hz
<--><--><--><--> 
25% judder @ 12Hz


60fps24pps.telecine(48fps24pps.repeat(24fps24pps)) is 24pps @ 24fps frame repeated to 48fps, then 
telecined to 60fps. Judder is 1/24 sec. @ 12Hz. Combing is 20%.
+--+ 
1/6 second
[A.a_][B.b_][C.c_][D.d_] 
24fps[24pps] source
[A.a__][A.a__][B.b__][B.b__][C.c__][C.c__][D.d__][D.d__] 
48fps24pps.repeat(24fps24pps)
[A.a___][A.a___][A.b___][B.b___][B.b___][C.c___][C.c___][C.d___][D.d___][D.d___] 
60fps24pps.telecine(48fps24pps.repeat(24fps24pps))
 
 20% comb @ 12Hz
<><><><> 
zero judder


60fps48pps.telecine(48fps48pps.interpolate(24fps24pps)) is 24pps interpolated to 48pps @ 48fps, then 
telecined to 60fps. Judder is 1/48 sec. @
+--+ 
1/6 second
[A.a_][B.b_][C.c_][D.d_] 
24fps[24pps] source
[A.a__][AB.ab][B.b__][BC.bc][C.c__][CD.cd][D.d__][DE.de] 
48fps48pps.interpolate(24fps24pps)
[A.a___][AB.ab_][AB.b__][B.bc__][BC.bc_][C.c___][CD.cd_][CD.d__][D.de__][DE.de_] 
60fps48pps.telecine(48fps48pps.interpolate(24fps24pps))
 
 40% comb @ 12Hz

<--><--><--><--><--><--><--><-->
 33% judder @ 24Hz

60fps60pps.interpolate(24fps24pps) is 24pps interpolated to 60pps @ 60fps. Judder is 1/60 sec. @ 
60Hz (essentially imperceptible).
+--+ 
1/6 second
[A.a_][B.b_][C.c_][D.d_] 
24fps[24pps] source
[A.a___][AAB.aab___][AB.ab_][B.b___][BC.bc_][C.c___][CCD.ccd___][CD.cd_][D.d___][DE.de_] 
60fps60pps.interpolate(24fps24pps)


 zero comb
<--><--><--><--><--><--><--><--><--><--> 
zero judder


-snip-

--
The U.S. 

Re: [FFmpeg-user] Re-writing hot .ts file that rotates every 24 hours in realtime

2021-02-12 Thread Michael Glenn Williams
Hi Korn,

We need additional info to help you. What O/S are you working with?
This is relevant to the buffered input and output when reading from stdin
and writing to stdout.
What language are you writing your script/program in?
This is relevant to what capabilities your tool will have access to.

Thank you for your question!
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Same output bit depth and sampling frequency as input?

2021-02-12 Thread Paul B Mahol
On Fri, Feb 12, 2021 at 7:17 PM Marco Mircoli  wrote:

> Il giorno ven 12 feb 2021 alle ore 10:53 Paul B Mahol 
> ha
> scritto:
>
> > On Fri, Feb 12, 2021 at 12:48 AM Marco Mircoli 
> > wrote:
> >
> > > Hello everybody,
> > >  wondering how to set the same output audio specs (sample rate anche
> bit
> > > depth) as input.
> > >
> > > I tried like that
> > >
> > > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> > > 5:TP=-1.5:LRA=7 -sample_fmt s16 -ar 44100 FILE_TO
> > >
> > >
> > >
> > > if I have a 48KHZ input, the output is 44100, so doesn't work for my
> > needs
> > >
> > > Tried without
> > >
> > >
> > > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> > > 5:TP=-1.5:LRA=7  FILE_TO
> > >
> > > The result is: same bit depth of input file but 192Khz sample rate.
> (file
> > > input sr is 48khz)
> > >
> > > Anybody can give me a suggest?
> > >
> >
> > Use shell scripting.
> >
> > Also using those 2 filters at same time is entirely invalid and
> pointless.
> >
> >
> >
> Unfortunately, don't know ho to use shell. I'm a newbe. Any resource that
> can help me to start with shell scriping?
>
> ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.5:TP=-1.5:LRA=7  FILE_TO
>
> Cannot understand why this Is invalid.
> 1st filter (dynaudnorm), level the audio changing the volume every frame
> window
> 2nd filter (loudnorm) set an offset to the gain to let the loudness go to
> 16.5lkfs
>
> I've miss something?
>

Is there any difference when you remove dynaudnorm?


>
> Thanks.
> S:
>
>
>
>
>
>
>
> >
> > > Thanks,
> > > S.
> > > ___
> > > ffmpeg-user mailing list
> > > ffmpeg-user@ffmpeg.org
> > > https://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
> > https://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
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Same output bit depth and sampling frequency as input?

2021-02-12 Thread Marco Mircoli
Il giorno ven 12 feb 2021 alle ore 10:53 Paul B Mahol  ha
scritto:

> On Fri, Feb 12, 2021 at 12:48 AM Marco Mircoli 
> wrote:
>
> > Hello everybody,
> >  wondering how to set the same output audio specs (sample rate anche bit
> > depth) as input.
> >
> > I tried like that
> >
> > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> > 5:TP=-1.5:LRA=7 -sample_fmt s16 -ar 44100 FILE_TO
> >
> >
> >
> > if I have a 48KHZ input, the output is 44100, so doesn't work for my
> needs
> >
> > Tried without
> >
> >
> > ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> > 5:TP=-1.5:LRA=7  FILE_TO
> >
> > The result is: same bit depth of input file but 192Khz sample rate. (file
> > input sr is 48khz)
> >
> > Anybody can give me a suggest?
> >
>
> Use shell scripting.
>
> Also using those 2 filters at same time is entirely invalid and pointless.
>
>
>
Unfortunately, don't know ho to use shell. I'm a newbe. Any resource that
can help me to start with shell scriping?

ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.5:TP=-1.5:LRA=7  FILE_TO

Cannot understand why this Is invalid.
1st filter (dynaudnorm), level the audio changing the volume every frame
window
2nd filter (loudnorm) set an offset to the gain to let the loudness go to
16.5lkfs

I've miss something?

Thanks.
S:







>
> > Thanks,
> > S.
> > ___
> > ffmpeg-user mailing list
> > ffmpeg-user@ffmpeg.org
> > https://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
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Is there something about inputting raw frames

2021-02-12 Thread pdr0
Mark Filipak (ffmpeg) wrote
>> Either way, cadence wise that's going to be worse in terms of smoothness
>> then an optical flow retimed 6/1001 . (Some people would argue it's
>> worse period, you're retiming it and making it look like a soap opera...)
> 
> You know, I think that "soap opera" opinion is entirely bogus. In a movie
> theater, projectors are 
> triple shuttered. That essentially brings the frame rate up to 72fps with
> picture rate of 24pps (or, 
> if you include the times when the shutter is closed, 144fps). When some
> people see on a TV what they 
> would see in a cinema, they say it looks like a soap opera. It's not what
> they're used to seeing on 
> a TV. I think 60fps on a 60Hz TV looks much better, that it looks like
> reality. If you've been 
> following what I've been doing, you'll know that's been my objective all
> along. I'd hoped that 
> minterpolate would do it, but minterpolate makes too many errors. svpflow
> does a much better job and 
> it does it via GPU (so transcoding goes from 4 days to 14 hours). I'm
> pretty confident that going to 
> 48fps (instead of 60fps) and then adding a modulo-4 frame will speed up
> the transcode by about 40% 
> (to 8-1/2 hours -- an overnight job!).

It's ok to "like" one thing vs. another, that's why there are motion flow
TV's that use optical flow/motion interpolation on the fly, and judderless
TV's that have different refresh rates

"72fps" or "144fps" equivalent in a cinema is not the same thing - the
analogy would be the cinema is repeating frames, vs interpolating new
in-between frames on a motion flow TV. Actual film samples in the cinema are
still at 24.  A judderless TV looks like a theatre, because they have the
equivalent of repeating frames at 120Hz, 144Hz, 300Hz, etc... The motion
characteristics are the same for the judderless display and the cinema. 


Optical flow motion interpolation is generating new motion samples. It's
completely different. Soap operas are shot at 59.94fps , not 24fps. New
motion samples and (synthesized or real) high frame rate recording
completely change the look of the material. The other difference is shutter
speed of the acquisition camera. The faster the acquisition speed, usually
the higher the shutter speed and less motion blur. Synthesized interpolation
does not remove the motion blur with 24p acquisition, in fact it adds more
blur. Native 59.94p acquisition is "sharper" with  less motion blur

The live look or soap opera reality TV is ok for sports, reality TV, news,
but it changes the look of a theatrical movie shot at 24p. Motion
interpolated 59.94p looks completely different from the cinema, and that's
the issue many people have with it





>> Are you actually interested in workarounds and getting the job done, or
>> just
>> how to do this in ffmpeg?
> 
> Well, I guess I just want to get the job done. The linchpin is the added
> frame. What I want to do is 
> create a modulo-4, 1/60th second gap in the frames coming out of
> VapourSynth and filling it with a 
> checkerboard blend of the frames on either side of the gap -- essentially
> a blended decombing -- 
> with PTSs set to give 60/1.001fps. I realize that will produce a slight
> judder (1 frame in every 5 
> frames, but based on my experiments with minterplolate, that judder is
> *almost* imperceptible. If 
> shuffleframes proves to be the problem, I'll do a 3322telecine and
> checkerboard blend the combed 
> frame. I'll get where I want to go eventually. All the guesswork &
> discovery regarding how ffmpeg 
> filters work is just awfully tedious.
> 
>> If you just want it done, this is easier in avisynth because of the
>> InterleaveEvery function;
>> http://avisynth.nl/index.php/ApplyEvery#InterleaveEvery
> 
> Oh, my. Avisynth? 'InterleaveEvery', eh? That doesn't sound like what I
> want, but I'll check it out. 
> Thanks.

I  don't know why frames are being dropped with those ffmpeg filters, but
I'd like to figure out why

But in the meantime, if your ulitmate goal was smooth interpolation to
59.94, why not just use Interframe to generate 59.94 ? Earlier, you
mentioned speed - is that the reason ?

The "checkerboard  blend from the gap" -  If the 48000/1001 interpolated
stream is A,B,C,D,E , you want a frame inserted between D and E, that is
comprised of a "checkerboard blend" of D and E, for a resulting 6/1001 ? 
It seems like a poor tradeoff for a small gain in speed. But InterleaveEvery
is one way of doing it





--
Sent from: http://ffmpeg-users.933282.n4.nabble.com/
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Is there something about inputting raw frames

2021-02-12 Thread Mark Filipak (ffmpeg)

On 02/12/2021 04:49 AM, Paul B Mahol wrote:

On Fri, Feb 12, 2021 at 9:36 AM Mark Filipak (ffmpeg) 
wrote:


On 02/12/2021 02:48 AM, pdr0 wrote:

Mark Filipak (ffmpeg) wrote

On 02/12/2021 02:28 AM, pdr0 wrote:

Mark Filipak (ffmpeg) wrote

On 02/12/2021 01:27 AM, pdr0 wrote:

Mark Filipak (ffmpeg) wrote

-snip-

Thanks.

-snip-

Thanks for your help. It was instrumental. The rest is up to me.

-snip-

Please just leave, your are not helping at all, you are also not grateful
at all when some one helps you.


Gosh, Paul. You're a tough audience.

--
The U.S. Senate and House should follow the ancient Roman model.
Their Princeps Senatus and Tribunus Plebis had their own armies.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Same output bit depth and sampling frequency as input?

2021-02-12 Thread Paul B Mahol
On Fri, Feb 12, 2021 at 12:48 AM Marco Mircoli  wrote:

> Hello everybody,
>  wondering how to set the same output audio specs (sample rate anche bit
> depth) as input.
>
> I tried like that
>
> ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> 5:TP=-1.5:LRA=7 -sample_fmt s16 -ar 44100 FILE_TO
>
>
>
> if I have a 48KHZ input, the output is 44100, so doesn't work for my needs
>
> Tried without
>
>
> ffmpeg -i FILE_FROM -af dynaudnorm,loudnorm=I=-16.
> 5:TP=-1.5:LRA=7  FILE_TO
>
> The result is: same bit depth of input file but 192Khz sample rate. (file
> input sr is 48khz)
>
> Anybody can give me a suggest?
>

Use shell scripting.

Also using those 2 filters at same time is entirely invalid and pointless.



> Thanks,
> S.
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://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
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Is there something about inputting raw frames

2021-02-12 Thread Paul B Mahol
On Fri, Feb 12, 2021 at 9:36 AM Mark Filipak (ffmpeg) 
wrote:

> On 02/12/2021 02:48 AM, pdr0 wrote:
> > Mark Filipak (ffmpeg) wrote
> >> On 02/12/2021 02:28 AM, pdr0 wrote:
> >>> Mark Filipak (ffmpeg) wrote
>  On 02/12/2021 01:27 AM, pdr0 wrote:
> > Mark Filipak (ffmpeg) wrote
> >> Is there something about inputting raw frames that I don't know?
> >>
> >> I'm using 'vspipe' to pipe raw frames to 'ffmpeg -i pipe:'.
> >> The vapoursynth script, 'Mark's.vpy', is known good.
> >> The output of vapoursynth is known good.
> >> I've tried to be careful to retain valid PTSs, but apparently have
> >> failed.
> >> The output should be around 1200 frames, but 364 frames are dropped.
> >> I've frame stepped through the target, 'Mark's_script_6.mkv', and
> the
> >> frames that are there are in
> >> the correct order.
> >> The only thing I can guess is that ffmpeg handles 48/1.001fps raw
> >> video
> >> frames in such a way that
> >> PTS is not valid or can't be changed with 'setpts=fps=6/1001'.
> >> Can anyone see an error. Or, lacking an error, does anyone know of a
> >> workaround?
> >>
> >> Thanks.
> >>
> >> Mark's_script_6.cmd
> >> =
> >> ECHO from vapoursynth import core>Mark's.vpy
> >> ECHO video =
> >> core.ffms2.Source(source='Mark\'s_source.mkv')>>Mark's.vpy
> >> ECHO import havsfunc as havsfunc>>Mark's.vpy
> >> ECHO video = havsfunc.InterFrame(video, Preset="medium",
> >> Tuning="smooth",
> >> InputType="2D",
> >> NewNum=48000, NewDen=1001, GPU=True)>>Mark's.vpy
> >> ECHO video.set_output()>>Mark's.vpy
> >> vspipe --y4m Mark's.vpy - | ffmpeg -thread_queue_size 2048 -i pipe:
> >> -filter_complex
> >> "setpts=N*1001/6/TB, split[1][2], [1]shuffleframes=0 1 2 3 3,
> >> select=not(eq(mod(n\,5)\,4))[3],
> >> [2]tblend=all_expr='if(eq(mod(X,2),mod(Y,2)),TOP,BOTTOM)',
> >> shuffleframes=0
> >> 1 2 2 3,
> >> select=eq(mod(n\,5)\,4)[4], [3][4]interleave" -i Mark's_source.mkv
> >> -map
> >> 0:v -map 1:a -codec:v
> >> libx265 -x265-params "crf=16:qcomp=0.60" -codec:a copy -codec:s copy
> >> Mark's_script_6.mkv -y
> >
> >
> > Are you trying to keep the same frames from vapoursynth output node,
> > but
> > assign 6/1001 fps and timestamps instead of 48000/1001 ?
> > (effectively
> > making it a speed up)
> >
> > If so, the workaround is : add after the Interframe line
> >
> > video = core.std.AssumeFPS(video, fpsnum=6, fpsden=1001)
> 
>  After your suggested addition to the python script, Mark's.vpy,
>  With '-filter_complex "setpts=N*1001/6/TB, split[1][2]...' there
> are
>  335 drops.
>  With '-filter_complex "split[1][2]...' there are 190 drops.
> >>>
> >>> The workaround is correct for the PTS
> >>>
> >>>AssumeFPS is used to change the frame rate (and timestamps) without
> >>> changing the frame count. It just assigns a framerate (and their PTS).
> So
> >>> you would use that instead of setpts
> >>>
> >>> There are no frame drops or additions from vapoursynth. The framecount,
> >>> framerate and PTS are correct at that point. You can verify this by
> >>> encoding
> >>> the vpy script directly without other filters.
> >>>
> >>> So this implies the some drops are from setpts, and some other drops
> are
> >>> from some of your other filters
> >>
> >> Well, I previously removed the 'setpts' directives with no change.
> Also, I
> >> previously tested with no
> >> ffmpeg filters at all and got the expected sped up video. I honestly
> can't
> >> see anything else to
> >> discover. But I'll start stripping filters one by one and hack a
> solution
> >> (or make a discovery). Of
> >> course, the 'shuffleframes' directives are most suspect, but I've used
> >> 'shuffleframes' in the past
> >> and succeeded.
> >>
> >> Thanks for your help. It was instrumental. The rest is up to me.
> >
> >
> >
> >
> > I realize this is ffmpeg-user board, but why not do some of the video
> > processing in vapoursynth ? You're already using it for part of it.  But
> I'm
> > not sure what you're trying to do ?
> >
> > It looks like you're taking the 48000/1001 interpolated frame doubled
> output
> > and adding a "BC~C.bc~c" frame to every group of 4, to make up the
> > 6/1001?
> >
> > What is a "BC~C.bc~c" frame ? Is it that checkerboard blend?
> > http://ffmpeg.org/pipermail/ffmpeg-user/2021-February/051852.html
> >
> > Either way, cadence wise that's going to be worse in terms of smoothness
> > then an optical flow retimed 6/1001 . (Some people would argue it's
> > worse period, you're retiming it and making it look like a soap opera...)
>
> You know, I think that "soap opera" opinion is entirely bogus. In a movie
> theater, projectors are
> triple shuttered. That essentially brings the frame rate up to 72fps with
> picture rate of 24pps (or,
> if you include the times 

Re: [FFmpeg-user] Is there something about inputting raw frames

2021-02-12 Thread Mark Filipak (ffmpeg)

On 02/12/2021 02:48 AM, pdr0 wrote:

Mark Filipak (ffmpeg) wrote

On 02/12/2021 02:28 AM, pdr0 wrote:

Mark Filipak (ffmpeg) wrote

On 02/12/2021 01:27 AM, pdr0 wrote:

Mark Filipak (ffmpeg) wrote

Is there something about inputting raw frames that I don't know?

I'm using 'vspipe' to pipe raw frames to 'ffmpeg -i pipe:'.
The vapoursynth script, 'Mark's.vpy', is known good.
The output of vapoursynth is known good.
I've tried to be careful to retain valid PTSs, but apparently have
failed.
The output should be around 1200 frames, but 364 frames are dropped.
I've frame stepped through the target, 'Mark's_script_6.mkv', and the
frames that are there are in
the correct order.
The only thing I can guess is that ffmpeg handles 48/1.001fps raw
video
frames in such a way that
PTS is not valid or can't be changed with 'setpts=fps=6/1001'.
Can anyone see an error. Or, lacking an error, does anyone know of a
workaround?

Thanks.

Mark's_script_6.cmd
=
ECHO from vapoursynth import core>Mark's.vpy
ECHO video =
core.ffms2.Source(source='Mark\'s_source.mkv')>>Mark's.vpy
ECHO import havsfunc as havsfunc>>Mark's.vpy
ECHO video = havsfunc.InterFrame(video, Preset="medium",
Tuning="smooth",
InputType="2D",
NewNum=48000, NewDen=1001, GPU=True)>>Mark's.vpy
ECHO video.set_output()>>Mark's.vpy
vspipe --y4m Mark's.vpy - | ffmpeg -thread_queue_size 2048 -i pipe:
-filter_complex
"setpts=N*1001/6/TB, split[1][2], [1]shuffleframes=0 1 2 3 3,
select=not(eq(mod(n\,5)\,4))[3],
[2]tblend=all_expr='if(eq(mod(X,2),mod(Y,2)),TOP,BOTTOM)',
shuffleframes=0
1 2 2 3,
select=eq(mod(n\,5)\,4)[4], [3][4]interleave" -i Mark's_source.mkv
-map
0:v -map 1:a -codec:v
libx265 -x265-params "crf=16:qcomp=0.60" -codec:a copy -codec:s copy
Mark's_script_6.mkv -y



Are you trying to keep the same frames from vapoursynth output node,
but
assign 6/1001 fps and timestamps instead of 48000/1001 ?
(effectively
making it a speed up)

If so, the workaround is : add after the Interframe line

video = core.std.AssumeFPS(video, fpsnum=6, fpsden=1001)


After your suggested addition to the python script, Mark's.vpy,
With '-filter_complex "setpts=N*1001/6/TB, split[1][2]...' there are
335 drops.
With '-filter_complex "split[1][2]...' there are 190 drops.


The workaround is correct for the PTS

   AssumeFPS is used to change the frame rate (and timestamps) without
changing the frame count. It just assigns a framerate (and their PTS). So
you would use that instead of setpts

There are no frame drops or additions from vapoursynth. The framecount,
framerate and PTS are correct at that point. You can verify this by
encoding
the vpy script directly without other filters.

So this implies the some drops are from setpts, and some other drops are
from some of your other filters


Well, I previously removed the 'setpts' directives with no change. Also, I
previously tested with no
ffmpeg filters at all and got the expected sped up video. I honestly can't
see anything else to
discover. But I'll start stripping filters one by one and hack a solution
(or make a discovery). Of
course, the 'shuffleframes' directives are most suspect, but I've used
'shuffleframes' in the past
and succeeded.

Thanks for your help. It was instrumental. The rest is up to me.





I realize this is ffmpeg-user board, but why not do some of the video
processing in vapoursynth ? You're already using it for part of it.  But I'm
not sure what you're trying to do ?

It looks like you're taking the 48000/1001 interpolated frame doubled output
and adding a "BC~C.bc~c" frame to every group of 4, to make up the
6/1001?

What is a "BC~C.bc~c" frame ? Is it that checkerboard blend?
http://ffmpeg.org/pipermail/ffmpeg-user/2021-February/051852.html

Either way, cadence wise that's going to be worse in terms of smoothness
then an optical flow retimed 6/1001 . (Some people would argue it's
worse period, you're retiming it and making it look like a soap opera...)


You know, I think that "soap opera" opinion is entirely bogus. In a movie theater, projectors are 
triple shuttered. That essentially brings the frame rate up to 72fps with picture rate of 24pps (or, 
if you include the times when the shutter is closed, 144fps). When some people see on a TV what they 
would see in a cinema, they say it looks like a soap opera. It's not what they're used to seeing on 
a TV. I think 60fps on a 60Hz TV looks much better, that it looks like reality. If you've been 
following what I've been doing, you'll know that's been my objective all along. I'd hoped that 
minterpolate would do it, but minterpolate makes too many errors. svpflow does a much better job and 
it does it via GPU (so transcoding goes from 4 days to 14 hours). I'm pretty confident that going to 
48fps (instead of 60fps) and then adding a modulo-4 frame will speed up the transcode by about 40% 
(to 8-1/2 hours -- an overnight job!).



Are you actually interested in workarounds and getting the job done, or just
how to do this in 

[FFmpeg-user] Re-writing hot .ts file that rotates every 24 hours in realtime

2021-02-12 Thread Korn Moffle
Hello,

we have a file that is written in realtime into .ts (MPEG-2). The file is 
written for 24 hours and then a new file starts.

Can we use ffmpeg to:
a. copy the file in realtime ? So, ffmpeg would be rewriting file1.ts into 
file2.ts as file1.ts is constantly being written into.
b. tell ffmpeg to read the file with a constant 3 second delay from the most 
updated frame?
c. if a new file appears, detect it and switch to it?

Thank you!



Sent from Outlook
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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