Re: [FFmpeg-user] Channel manipulation and audio filter equivalencies

2020-11-11 Thread Chris Angelico
On Fri, Nov 6, 2020 at 2:43 AM Chris Angelico  wrote:
> The real challenge is selecting two channels and trying to make them
> into the left and right channels of a new stereo audio channel. One
> option is channelmap:
>
> ffmpeg -loglevel error -stats -y -i Original.mkv -af
> 'channelmap=map=BL|BR' channel_split.mkv
>
> Another option is pan:
>
> ffmpeg -loglevel error -stats -y -i Original.mkv -af
> 'pan=stereo|c0=BL|c1=BR' channel_split.mkv
>

Anyone have recommendations on these options, or any other preferred
way to remap channels at maximum quality?

ChrisA
___
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 a silent audio stream if no audio stream exists

2020-11-11 Thread Michael Koch

Am 11.11.2020 um 21:59 schrieb Jim DeLaHunt:


2. Generate a more elaborate FFmpeg invocation which will generate 
silent audio streams for input files which have none. The details of 
this should be in a separate thread with a separate Subject: line.




That's an interesting question. Can this be done in one command line?
If the input video has an audio stream, then leave it as it is. If no 
audio stream exists, then add silent audio.


Michael

___
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] Reduce ffmpeg response

2020-11-11 Thread Jeff England
Jim,
Thank you very much for your assistance.  Thank you also for letting me
know I was off topic.
We ended up figuring it out, went into the library code and added a line
dealing with stdout (I don't recall the syntax).

Thanks again
Jeff

On Sun, Nov 8, 2020 at 1:40 PM Jim DeLaHunt 
wrote:

> On 2020-11-08 08:42, Jeff England wrote:
>
> > …Developing code in a Linux / Python environment, using Pydub and ffmpeg
> to
> > play .mp3 sound.
> > I would like to "quiet" the response from ffmpeg.  I've found a number of
> > posts along the lines of
> > ffmpeg -hide_banner -loglevel panic.  I'm having difficulty knowing
> exactly
> > where to place
> > the ffmpeg -hide_banner -loglevel panic (or the like) command.  I've
> tried
> > it following the
> > import AudioSegment
> > from pydub.playback statement and in the programming where the sound is
> > actually called.
> >
> > Any thoughts or guidance is appreciated.
>
> Hello, Jeff, and welcome to the FFmpeg users list. You ask an
> interesting question.
>
> It sounds like you are using the Python module Pydub[1] to do audio
> editing. Pydub offers an API of audio editing actions, it uses Python
> code for the logic to convert those editing actions into calls to FFmpeg
> or libav, and it can call FFmpeg behind the scenes to actually
> manipulate the audio data. It sounds like the FFmpeg invocations
> generate more text on its stdout than you want, and you want to reduce
> the amount of text which FFmpeg puts to its stdout.
>
> I don't know Pydub, but I do know Python and FFmepg, and I have written
> Python code which calls FFmpeg behind the scenes to actually manipulate
> the video data.
>
> An important thing to bear in mind is that Pydub exists in a Python
> environment, and FFmpeg exists outside that environment. You need to be
> clear what is happening in which environment.
>
> In reading the Pydub API docs[2], I see no way to manipulate FFmpeg
> directly. The AudioSegment(…).export() call[3] does have a `parameters`
> keyword argument, which is a list of options for Pydub to include in the
> FFmpeg invocation. The docs says, "These are added to the end of the
> call (in the output file section)." It doesn't say there is a way to put
> those parameters somewhere else. I don't see any other places in the API
> which lets the caller send parameters to the FFmpeg invocation. And of
> course, the Pydub API docs might not be complete.
>
> So, the first question is, which Pydub API call are you using?
>
> Second, in what way do you see the FFmpeg output to its stdout? Does
> Pydub return this to you?  I don't see a mention of this in the API
> docs. You should describe how you are calling Pydub, and what results
> you see, and what results you would like to see.
>
> Third, be aware that Pydub might not give you the control you are after.
>
> Fourth, be aware that Pydub is a bit off-topic for this list. Anything
> about Pydub and the way it creates an invocation of FFmpeg are
> off-topic. Questions you can phrase in terms of a command-line
> invocation of FFmpeg are where you start to be on-topic for this list.
> Nevertheless, you might still get a bit of help with the Pydub and
> Python parts of your situation.
>
> [1] http://pydub.com/
>
> [2] https://github.com/jiaaro/pydub/blob/master/API.markdown
>
> [3]
> https://github.com/jiaaro/pydub/blob/master/API.markdown#audiosegmentexport
>
> Hope this helps,
>   —Jim DeLaHunt, software engineer, Vancouver, Canada
>
>
> ___
> 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] Stream specifier ':a' in filtergraph Error

2020-11-11 Thread Jim DeLaHunt


On 2020-11-10 13:27, Randy Johnson via ffmpeg-user wrote:

When running the following command:

```
ffmpeg \
-loop 1 -framerate 30 -t 1.4 -i /assets/img/filler640480.jpg -i 0d.mp4 -
y \
-loop 1 -framerate 30 -t 891.113 -i /assets/img/filler640480.jpg -i
9f.mp4 -y \
-f lavfi -t 0.1 -i anullsrc=channel_layout=mono:sample_rate=48000 \
-filter_complex "
[0:v]setsar=1[v0];[2:v]setsar=1[v1];[v0][4:a][1:v][1:a][v1][4:a][3:v][3:a]concat=n=4:v=1:a=1"
-vsync 2 -vcodec libx264 -pix_fmt yuv420p 0245-grid.mp4

```

I am getting the following error:

```
Stream specifier ':a' in filtergraph description
[0:v]setsar=1[v0];[2:v]setsar=1[v1];[v0][4:a][1:v][1:a][v1][4:a][3:v][3:a]concat=n=4:v=1:a=1
matches no streams.
```

This only happens on some video processing not all, cannot seem to
figure out why.



I agree with Michael Koch's earlier answer, but let me try to explain 
what FFmpeg is trying to tell you.


Within a video file, each sequence of video images, and each audio 
channel, is a stream. Some files might have a single video stream and a 
two audio streams (stereo sound). Some might have a video stream and one 
audio stream (monophonic sound). Some might have a video stream and no 
audio stream at all (silent video).


Your complex filter operates on multiple streams, in parallel. Those 
notations "1:v", "4:a" are _stream specifiers_. The documentation of 
stream specifiers is at 
.


FFmpeg gives you an error message, "Stream specifier ':a' in filtergraph 
description … matches no streams."  ":a" is a stream specifier for an 
audio stream (see the documentation, under "stream_type"). Look in the 
"[0:v]setsar"…"concat=n=4:v=1:a=1" code — that is your filtergraph 
description — for stream specifiers ending in ":a". Those are what 
FFmpeg cannot match to a stream in the input files.


As Andrei Ka points out, you can look in the FFmpeg output for a 
description of what streams FFmpeg finds in the input files. I suspect 
that in the cases where your invocation succeeds, FFmpeg will tell you 
that each of the input files has an audio stream. In the cases where 
your invocation fails, FFmpeg will tell you that at least one of the 
input files has no audio stream.


If it is the case that some of your files have no audio streams, then 
you have two basic choices:


1. Generate an FFmpeg invocation tailored to the details of your input 
files. Don't generate instructions to concatenate audio streams for 
files which have none, but do generate for files which do have audio.


2. Generate a more elaborate FFmpeg invocation which will generate 
silent audio streams for input files which have none. The details of 
this should be in a separate thread with a separate Subject: line.


I hope this is helpful,
   —Jim DeLaHunt, software engineer, Vancouver Canada


___
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] Stream specifier ':a' in filtergraph Error

2020-11-11 Thread Nicolas George
andrei ka (12020-11-11):
> ffmpeg would be enuf, ffmpeg would list all the tracks in input files
> before starting transco, on failure dude should just check his first
> 20lines of log to see if mp4 have snd tracks...

Bad advice. The log output of ffmpeg is not meant to be parsed by an
application. The fact that it goes to stderr should be a hint. In
particular, there are no promises that the syntax of the list of streams
will be kept constant.

ffprobe is the right tool for this, because the output is guaranteed to
be stable.

Regards,

-- 
  Nicolas George


signature.asc
Description: PGP signature
___
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] HLS Streaming - FFMPEG: Program date time of older segment also changing in playlist.m3u8 when re-streaming after discontinuity.

2020-11-11 Thread andrei ka
you mean the names of segments are the same, not "program time"... would
make sense to me if the idea was related to kicking the last couple of ts
out from caches (you may need to read src code for understanding why it's
happening)... what if you delete all m3u8 before restart... ?


___
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] Stream specifier ':a' in filtergraph Error

2020-11-11 Thread andrei ka
>
> You could check those videos with FFprobe. May be they have no audio
> stream, or something else is different.
>

ffmpeg would be enuf, ffmpeg would list all the tracks in input files
before starting transco, on failure dude should just check his first
20lines of log to see if mp4 have snd tracks...



___
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] HLS Streaming - FFMPEG: Program date time of older segment also changing in playlist.m3u8 when re-streaming after discontinuity.

2020-11-11 Thread Suriya Velusamy
HI,

Following is the ffmpeg command used to stream the data.

ffmpeg -re -f avfoundation

-framerate 30 -i 0

-codec:v h264_videotoolbox -x264-params keyint=120:scenecut=0

-codec:a copy -f hls

-hls_list_size 60

-hls_time 10

-hls_flags delete_segments

-hls_flags +append_list

-hls_flags +discont_start

-hls_flags +program_date_time

-strftime 1

-strftime_mkdir 1

-hls_segment_filename

'%Y%m%dT%H%M%S%z.ts' playlist.m3u8



Following is the playlist.m3u8 content which generated for a few seconds.



#EXTM3U

#EXT-X-VERSION:3

#EXT-X-TARGETDURATION:10

#EXT-X-MEDIA-SEQUENCE:0

#EXT-X-DISCONTINUITY

#EXT-X-DISCONTINUITY

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:07:53.000+0530

20201109T220753+0530.ts

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:08:03.000+0530

20201109T220803+0530.ts

#EXT-X-ENDLIST



When the re-stream happens(in case of restarting the streaming service),
the program date time of older segments(before #EXT-X-DISCONTINUITY) also
get changed like below which is unexpected.



#EXTM3U

#EXT-X-VERSION:3

#EXT-X-TARGETDURATION:10

#EXT-X-MEDIA-SEQUENCE:0

#EXT-X-DISCONTINUITY

#EXT-X-DISCONTINUITY

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:12:50.633+0530

20201109T220753+0530.ts

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:00.633+0530

20201109T220803+0530.ts

#EXT-X-DISCONTINUITY

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:12.000+0530

20201109T221312+0530.ts

#EXTINF:5.40,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:22.000+0530

20201109T221322+0530.ts

#EXT-X-ENDLIST



Why does the program date time of older segments change? Should we add any
arguments explicitly in ffmpeg command to handle this?



Regards,

Suriya V.
___
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] FFMPEG HLS Streaming: Older segment program date time also changing in playlist.m3u8 when re-streaming after discontinuity

2020-11-11 Thread Suriya Velusamy via ffmpeg-user
Hi,

Following is the ffmpeg command used to stream the data.

ffmpeg -re -f avfoundation
-framerate 30 -i 0
-codec:v h264_videotoolbox -x264-params keyint=120:scenecut=0
-codec:a copy -f hls
-hls_list_size 60
-hls_time 10
-hls_flags delete_segments
-hls_flags +append_list
-hls_flags +discont_start
-hls_flags +program_date_time
-strftime 1
-strftime_mkdir 1
-hls_segment_filename
'%Y%m%dT%H%M%S%z.ts' playlist.m3u8

Following is the playlist.m3u8 content which generated for few seconds.


#EXTM3U

#EXT-X-VERSION:3

#EXT-X-TARGETDURATION:10

#EXT-X-MEDIA-SEQUENCE:0

#EXT-X-DISCONTINUITY

#EXT-X-DISCONTINUITY

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:07:53.000+0530

20201109T220753+0530.ts

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:08:03.000+0530

20201109T220803+0530.ts

#EXT-X-ENDLIST

When the re-stream happens(in case of restarting the streaming service), the 
program date time of older segments(before #EXT-X-DISCONTINUITY) also get 
changed like below which is unexpected.


#EXTM3U

#EXT-X-VERSION:3

#EXT-X-TARGETDURATION:10

#EXT-X-MEDIA-SEQUENCE:0

#EXT-X-DISCONTINUITY

#EXT-X-DISCONTINUITY

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:12:50.633+0530

20201109T220753+0530.ts

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:00.633+0530

20201109T220803+0530.ts

#EXT-X-DISCONTINUITY

#EXTINF:10.00,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:12.000+0530

20201109T221312+0530.ts

#EXTINF:5.40,

#EXT-X-PROGRAM-DATE-TIME:2020-11-09T22:13:22.000+0530

20201109T221322+0530.ts

#EXT-X-ENDLIST

Why the program date time of older segment should change? Should we add any 
arguments explicitly in ffmpeg command to handle this?

Regards,
Suriya V.










[cid:Redflex_6b470a42-cafa-498a-b934-6f5c1c549a62.jpg]


Suriya Velusamy | Software Engineer | Product Engineering | Redflex Group
E suriya.velus...@redflex.com
4/293, Old Mahabalipuram Road, Perungudi, Chennai Tamil Nadu 600096, India

www.redflex.com


Confidentiality Note: This e-mail, and any attachment to it, is intended only 
for the use of the individual(s) or entity named on the e-mail, and may contain 
confidential or proprietary information (including copyrighted materials). If 
the reader is not an authorized recipient, you are hereby notified that reading 
it or further distributing it (other than to the author or the intended 
recipient) is prohibited and is potentially an infringement of the rights of 
the sender or intended recipient. If you have received this e-mail in error, 
please immediately return it to the sender and delete it from your system. 
Thank you.






___
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".