Re: [FFmpeg-user] Using FFMPEG to encode multiple outputs in 'parallel' (doesn't work?)

2017-06-28 Thread Hans Carlson

On Wed, 28 Jun 2017, shalin wrote:


Nicolas George wrote

I think you need to take a little step back and learn what Unix pipes 
mean. They are meant to connect the output of a process to the input of 
the next one, but in your examples your commands neither consume their 
input nor produce output.


Piping only shows that I am trying to run all three ffmpeg transcode 
instances in parallel using single command line. If it makes any 
clearer, you can read them as three separate commands issued at the same 
time. With that, I hope we can focus on the concern raised in the 
original question.


As Nicolas already said, you need to take a closer look at "piping" vs 
"background processing" in the UNIX shell.


What you are doing is PIPING:

   |  | 

This takes the output of process 1 and uses it as the input to process 2, 
then the output of process 2 and uses it as the input to process 3.


It sounds like what you want is BACKGROUND PROCESSING:

   &  & process 3 &

This puts all 3 processes in the background and runs them concurrently.

You might want to check out some basics of the UNIX shell, such as this 
link:


  https://www.washington.edu/computing/unix/startdoc/shell.html
___
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] Using FFMPEG to encode multiple outputs in 'parallel' (doesn't work?)

2017-06-28 Thread Cley Faye
2017-06-28 22:56 GMT+02:00 shalin :

> Piping only shows that I am trying to run all three ffmpeg transcode
> instances in parallel using single command line. If it makes any clearer,
> you can read them as three separate commands issued at the same time. With
> that, I hope we can focus on the concern raised in the original question.
>

​Then you don't want pipes, you just want three parallel processes, which
you can do using &.

More to the point, as far as I know, ffmpeg will not do parallel treatment
on either input or output, as you deduced. It certainly is doable, but
don't seem trivial to implement in the ffmpeg CLI tool itself since that
tool must handle various cases, and introducing (more) special cases would
add complexity for not much benefits.

You should look in using the various ffmpeg libraries directly; with that
you could probably write it to decode once, encode multiple time. But
unless you have shockingly similar settings and unlimited processing power,
you'll most likely stall some of your encodings while other catch up with
them. I don't know how well ffmpeg libraries handle multithreading (I
suppose fairly well since most of it's operations are based on context
structures) but you'll have to do a fair amount of synchronization by hand.
___
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] Using FFMPEG to encode multiple outputs in 'parallel' (doesn't work?)

2017-06-28 Thread shalin
Nicolas George wrote
> Hi.
> 
> Le decadi 10 messidor, an CCXXV, Shalin Mehta a écrit :
>> Option1: Run 3 instances of ffmpeg using pipe.
>> ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - | ffmpeg -i input.mp4
>> -c:v libx264 -b:v 12M -f null - | ffmpeg -i input.mp4 -c:v libx264 -b:v
>> 12M
>> -f null -
> 
> I think you need to take a little step back and learn what Unix pipes
> mean. They are meant to connect the output of a process to the input of
> the next one, but in your examples your commands neither consume their
> input nor produce output.
> 
> -- 
>   Nicolas George
> 
> signature.asc (849 bytes)
> ;

Piping only shows that I am trying to run all three ffmpeg transcode
instances in parallel using single command line. If it makes any clearer,
you can read them as three separate commands issued at the same time. With
that, I hope we can focus on the concern raised in the original question.




--
View this message in context: 
http://www.ffmpeg-archive.org/Using-FFMPEG-to-encode-multiple-outputs-in-parallel-doesn-t-work-tp4680420p4680422.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".

Re: [FFmpeg-user] Using FFMPEG to encode multiple outputs in 'parallel' (doesn't work?)

2017-06-28 Thread Nicolas George
Hi.

Le decadi 10 messidor, an CCXXV, Shalin Mehta a écrit :
> Option1: Run 3 instances of ffmpeg using pipe.
> ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - | ffmpeg -i input.mp4
> -c:v libx264 -b:v 12M -f null - | ffmpeg -i input.mp4 -c:v libx264 -b:v 12M
> -f null -

I think you need to take a little step back and learn what Unix pipes
mean. They are meant to connect the output of a process to the input of
the next one, but in your examples your commands neither consume their
input nor produce output.

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
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] Using FFMPEG to encode multiple outputs in 'parallel' (doesn't work?)

2017-06-28 Thread Shalin Mehta
Hello Community members,

Quoting from the ffmpeg's wiki for creating multiple outputs.
https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs
*Parallel encoding*:
Outputting and re encoding multiple times in the same FFmpeg process will
typically slow down to the "slowest encoder" in your list. Some encoders
(like libx264) perform their encoding "threaded and in the background" so
they will effectively allow for parallel encodings.

Unfortunately, my results are not correlating with what is mentioned above.
By that I mean, I am not seeing encoding being performed in parallel on
multiple outputs even when using libx264.

To simplify the problem and to understand it easily, here's what I am doing
for strictly benchmarking purposes.

Option1: Run 3 instances of ffmpeg using pipe.
ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - | ffmpeg -i input.mp4
-c:v libx264 -b:v 12M -f null - | ffmpeg -i input.mp4 -c:v libx264 -b:v 12M
-f null -

Option2: run all three encodes in single ffmpeg process
ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - -c:v libx264 -b:v 12M
-f null - -c:v libx264 -b:v 12M -f null -

I am executing this workload on 32 core platform on google cloud.
Option1 gives me nearly 100% cpu utilization. In case of Option 2 cpu
utilization doesn't go beyond 50% and also fps is about 70% of the option1.

Then why don't I just use Option1?
Because Option2 decodes the input only once. I need to generate many
streams (up to 25 streams) from the same input file which could be 4K or
even bigger. So I want to avoid the overhead of decoding the same input so
many times in Option1.
So basically, I want to make Option2 work but I am not understanding why
it's not running all the encodes in parallel to give me better fps and
maximum cpu utilization.

After taking a quick look at the code, it doesn't seem like ffmpeg is
creating multiple threads to run multiple x264 encode sessions in parallel.
I know x264 library itself will create multiple threads but that's for a
single output. What I am looking for is output level parallelism.
Can some one explain if this is possible?
Or may be, I can use some different kind of command line to achieve such
output level parallelism?

Shalin
___
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] VideoStream from a Cloud VM with gdigrab window capture withut Remote Desktop

2017-06-28 Thread Thadeu Antonio Ferreira de Melo
Hello.

We are trying to create an automated cloud stream for a 3D application
running on an Azure Windows VM. We use gdigrab to capture that window and
FFMPEG streams it to a FFSERVER

Our command is this

ffmpeg -f gdigrab -i title="Win1 (64-bit, PCD3D_SM5)" -pix_fmt yuv420p
-framerate 30 -draw_mouse 0 -vcodec libx264 -tune zerolatency -bf 0 -preset
ultrafast -crf 25 -g 30 -an -refs 4 -x264-params
vbv-maxrate=2000:vbv-bufsize=256:keyint=600 http:///feed1.ffm

The problem is that, so far, we can only run tests while we have a Remote
Desktop instance opened. If one minimises the RD the stream stops.

Our go is to have a script that could start this command from any cloud VM
with diffent configurations for different instances of the 3D app.

Our VM are Windows Server 2016.

Thank you.
___
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] Streaming Syntax error

2017-06-28 Thread Mettavihari D
Greetings



On Wed, Jun 28, 2017 at 3:56 PM, Mettavihari D  wrote:
> Greetings
>
> Thank you for the note
> What do you suggest that I put in this line
> If I can have the syntax to use then I can adjust the values.
>
> Regards
> Mettavihari
>
> On Wed, Jun 28, 2017 at 7:17 AM, Reuben Martin  wrote:
>> On Tuesday, June 27, 2017 7:09:46 PM CDT Mettavihari D wrote:
>>> I tried the following:
>>> /root/bin/ffmpeg -re -i /data/video/sinhala/innput-15m.mp4 -acodec
>>> copy -vcodec copy -maxrate 1.5M -bufsize 3M -f flv -metadata
>>> streamName=xlarge rtmp://some.site.com.
>>
>> You cannot adjust the bitrate of the stream without re-encoding it. (i.e. you
>> cannot use "-vcodec copy”)
>>
>> -Reuben
>>
>>

Does this syntax look OK

/root/bin/ffmpeg -re -i /data/video/sinhala/input-15m.mp4 -b 1500k
-minrate 1500k -maxrate 1500k -bufsize 3000k -f flv -metadata
streamName=xlarge rtmp://some.site.com.

regards
Mettavihari


>> ___
>> 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".
>
>
>
> --
> Streaming video from http://learntv.lk



-- 
Streaming video from http://learntv.lk
___
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] Streaming Syntax error

2017-06-28 Thread Mettavihari D
Greetings

Thank you for the note
What do you suggest that I put in this line
If I can have the syntax to use then I can adjust the values.

Regards
Mettavihari

On Wed, Jun 28, 2017 at 7:17 AM, Reuben Martin  wrote:
> On Tuesday, June 27, 2017 7:09:46 PM CDT Mettavihari D wrote:
>> I tried the following:
>> /root/bin/ffmpeg -re -i /data/video/sinhala/innput-15m.mp4 -acodec
>> copy -vcodec copy -maxrate 1.5M -bufsize 3M -f flv -metadata
>> streamName=xlarge rtmp://some.site.com.
>
> You cannot adjust the bitrate of the stream without re-encoding it. (i.e. you
> cannot use "-vcodec copy”)
>
> -Reuben
>
>
> ___
> 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".



-- 
Streaming video from http://learntv.lk
___
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".