Generete one second of black video and relative silence audio with the same duration

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Generete one second of black video and relative silence audio with the same duration

chanof
How can I generate a black mp4 video with relative silent audio track with ffmpeg, I need the audio and video tracks to correspond to the duration of 1 second.

ffmpeg -f lavfi -i color=c=black:s=1920x1080:r=24/1 -c:v h264 -f lavfi -i anullsrc=cl=stereo:r=44100 -video_track_timescale 90k -c:a mp3 -b:a 320k -ar 44100 -ac 2 -t 1 out.mp4

VIDEO FORMAT CONTAINER DURATION: 3.026000

VIDEO STREAM DURATION: 3.000000

how can i match these durations?

Thanks a lot!
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Generete one second of black video and relative silence audio with the same duration

Moritz Barsnick
On Sat, Jan 25, 2020 at 20:54:20 +0000, Gian Maria Allibrante wrote:
> How can I generate a black mp4 video with relative silent audio track with ffmpeg, I need the audio and video tracks to correspond to the duration of 1 second.
> ffmpeg -f lavfi -i color=c=black:s=1920x1080:r=24/1 -c:v h264 -f lavfi -i anullsrc=cl=stereo:r=44100 -video_track_timescale 90k -c:a mp3 -b:a 320k -ar 44100 -ac 2 -t 1 out.mp4
>
> VIDEO FORMAT CONTAINER DURATION: 3.026000
> VIDEO STREAM DURATION: 3.000000
>
> how can i match these durations?

Which tool gives you this information? If I use your command, I get one
second duration. The ffmpeg conversion command says so, as does a
check of the resulting file with ffmpeg and mediainfo.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

R: Generete one second of black video and relative silence audio with the same duration

chanof
Hi Moritz, thanks for reply, this one, im always unable to get round match duration:

echo VIDEO FORMAT CONTAINER DURATION:
ffprobe -v error -show_entries format=duration \
  -of default=noprint_wrappers=1:nokey=1 output.mp4
echo VIDEO STREAM DURATION:
ffprobe -v error -select_streams v:0 -show_entries stream=duration \
  -of default=noprint_wrappers=1:nokey=1 output.mp4

________________________________
Da: ffmpeg-user <[hidden email]> per conto di Moritz Barsnick <[hidden email]>
Inviato: sabato 25 gennaio 2020 22:21
A: FFmpeg user discussions <[hidden email]>
Oggetto: Re: [FFmpeg-user] Generete one second of black video and relative silence audio with the same duration

On Sat, Jan 25, 2020 at 20:54:20 +0000, Gian Maria Allibrante wrote:
> How can I generate a black mp4 video with relative silent audio track with ffmpeg, I need the audio and video tracks to correspond to the duration of 1 second.
> ffmpeg -f lavfi -i color=c=black:s=1920x1080:r=24/1 -c:v h264 -f lavfi -i anullsrc=cl=stereo:r=44100 -video_track_timescale 90k -c:a mp3 -b:a 320k -ar 44100 -ac 2 -t 1 out.mp4
>
> VIDEO FORMAT CONTAINER DURATION: 3.026000
> VIDEO STREAM DURATION: 3.000000
>
> how can i match these durations?

Which tool gives you this information? If I use your command, I get one
second duration. The ffmpeg conversion command says so, as does a
check of the resulting file with ffmpeg and mediainfo.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmpeg-user&amp;data=02%7C01%7C%7Cf55496db01384c05f86408d7a1e4f540%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637155877060241184&amp;sdata=WD%2B1QAkpCjjDgOZ5S4%2BQHFTCfV8iBVUTM7fo9oSxEOM%3D&amp;reserved=0

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Generete one second of black video and relative silence audio with the same duration

chanof
Hi Moritz, thanks for reply, this one, im always unable to get round match duration:

echo VIDEO FORMAT CONTAINER DURATION:
ffprobe -v error -show_entries format=duration \
  -of default=noprint_wrappers=1:nokey=1 output.mp4
echo VIDEO STREAM DURATION:
ffprobe -v error -select_streams v:0 -show_entries stream=duration \
  -of default=noprint_wrappers=1:nokey=1 output.mp4

________________________________
Da: ffmpeg-user <[hidden email]> per conto di Moritz Barsnick <[hidden email]>
Inviato: sabato 25 gennaio 2020 22:21
A: FFmpeg user discussions <[hidden email]>
Oggetto: Re: [FFmpeg-user] Generete one second of black video and relative silence audio with the same duration

On Sat, Jan 25, 2020 at 20:54:20 +0000, Gian Maria Allibrante wrote:
> How can I generate a black mp4 video with relative silent audio track with ffmpeg, I need the audio and video tracks to correspond to the duration of 1 second.
> ffmpeg -f lavfi -i color=c=black:s=1920x1080:r=24/1 -c:v h264 -f lavfi -i anullsrc=cl=stereo:r=44100 -video_track_timescale 90k -c:a mp3 -b:a 320k -ar 44100 -ac 2 -t 1 out.mp4
>
> VIDEO FORMAT CONTAINER DURATION: 3.026000
> VIDEO STREAM DURATION: 3.000000
>
> how can i match these durations?

Which tool gives you this information? If I use your command, I get one
second duration. The ffmpeg conversion command says so, as does a
check of the resulting file with ffmpeg and mediainfo.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmpeg-user&amp;data=02%7C01%7C%7Cf55496db01384c05f86408d7a1e4f540%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637155877060241184&amp;sdata=WD%2B1QAkpCjjDgOZ5S4%2BQHFTCfV8iBVUTM7fo9oSxEOM%3D&amp;reserved=0

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Generete one second of black video and relative silence audio with the same duration

Moritz Barsnick
On Sat, Jan 25, 2020 at 22:26:31 +0000, Gian Maria Allibrante wrote:
> Hi Moritz, thanks for reply, this one, im always unable to get round match duration:
>
> echo VIDEO FORMAT CONTAINER DURATION:
> ffprobe -v error -show_entries format=duration \
>   -of default=noprint_wrappers=1:nokey=1 output.mp4
> echo VIDEO STREAM DURATION:
> ffprobe -v error -select_streams v:0 -show_entries stream=duration \
>   -of default=noprint_wrappers=1:nokey=1 output.mp4

Ah, I think I understand now. You are trying to get the same duration
from the container as from the video stream.

Honestly, I was looking for a totally different problem:

> > VIDEO FORMAT CONTAINER DURATION: 3.026000
> > VIDEO STREAM DURATION: 3.000000

You showed us *three* seconds results, not one second. This totally
distracted from your actual issue! ;-)

Regarding the approx 0.026 extra seconds:
For some reason, ffmpeg creates an additional initial audio packet,
marked with
side_data_type=Skip Samples
skip_samples=1105

If those initial samples are skipped, the total length is exactly okay.
I'm not sure whether ffmpeg does this due to restrictions regaring the
audio packet size.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

R: Generete one second of black video and relative silence audio with the same duration

chanof
Thanks Moritz, sorry for the confusion, may ask:

  *   How to remove this audio packet? (i need this trick to concatenate videos with total duration multiple of the GOP destined to infinite mpeg dash pseudo live loop, mp4box will fail after some cycles with this duration dicrepance, it's unable to skip it)
  *   How you see this information: side_data_type=Skip Samples etc.

Gian

________________________________
Da: ffmpeg-user <[hidden email]> per conto di Moritz Barsnick <[hidden email]>
Inviato: sabato 25 gennaio 2020 22:53
A: FFmpeg user discussions <[hidden email]>
Oggetto: Re: [FFmpeg-user] Generete one second of black video and relative silence audio with the same duration

On Sat, Jan 25, 2020 at 22:26:31 +0000, Gian Maria Allibrante wrote:
> Hi Moritz, thanks for reply, this one, im always unable to get round match duration:
>
> echo VIDEO FORMAT CONTAINER DURATION:
> ffprobe -v error -show_entries format=duration \
>   -of default=noprint_wrappers=1:nokey=1 output.mp4
> echo VIDEO STREAM DURATION:
> ffprobe -v error -select_streams v:0 -show_entries stream=duration \
>   -of default=noprint_wrappers=1:nokey=1 output.mp4

Ah, I think I understand now. You are trying to get the same duration
from the container as from the video stream.

Honestly, I was looking for a totally different problem:

> > VIDEO FORMAT CONTAINER DURATION: 3.026000
> > VIDEO STREAM DURATION: 3.000000

You showed us *three* seconds results, not one second. This totally
distracted from your actual issue! ;-)

Regarding the approx 0.026 extra seconds:
For some reason, ffmpeg creates an additional initial audio packet,
marked with
side_data_type=Skip Samples
skip_samples=1105

If those initial samples are skipped, the total length is exactly okay.
I'm not sure whether ffmpeg does this due to restrictions regaring the
audio packet size.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmpeg-user&amp;data=02%7C01%7C%7C32e3db916233475c8a6a08d7a1e97653%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637155896408673471&amp;sdata=S6U6WcNUjtJKDeRgurxFnYUsHLV0BbX8yCJANT7HKJA%3D&amp;reserved=0

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: R: Generete one second of black video and relative silence audio with the same duration

Richard Mikesell
unsubscribe


Richard Mikesell


On Sat, Jan 25, 2020 at 4:20 PM Gian Maria Allibrante <[hidden email]>
wrote:

> Thanks Moritz, sorry for the confusion, may ask:
>
>   *   How to remove this audio packet? (i need this trick to concatenate
> videos with total duration multiple of the GOP destined to infinite mpeg
> dash pseudo live loop, mp4box will fail after some cycles with this
> duration dicrepance, it's unable to skip it)
>   *   How you see this information: side_data_type=Skip Samples etc.
>
> Gian
>
> ________________________________
> Da: ffmpeg-user <[hidden email]> per conto di Moritz
> Barsnick <[hidden email]>
> Inviato: sabato 25 gennaio 2020 22:53
> A: FFmpeg user discussions <[hidden email]>
> Oggetto: Re: [FFmpeg-user] Generete one second of black video and relative
> silence audio with the same duration
>
> On Sat, Jan 25, 2020 at 22:26:31 +0000, Gian Maria Allibrante wrote:
> > Hi Moritz, thanks for reply, this one, im always unable to get round
> match duration:
> >
> > echo VIDEO FORMAT CONTAINER DURATION:
> > ffprobe -v error -show_entries format=duration \
> >   -of default=noprint_wrappers=1:nokey=1 output.mp4
> > echo VIDEO STREAM DURATION:
> > ffprobe -v error -select_streams v:0 -show_entries stream=duration \
> >   -of default=noprint_wrappers=1:nokey=1 output.mp4
>
> Ah, I think I understand now. You are trying to get the same duration
> from the container as from the video stream.
>
> Honestly, I was looking for a totally different problem:
>
> > > VIDEO FORMAT CONTAINER DURATION: 3.026000
> > > VIDEO STREAM DURATION: 3.000000
>
> You showed us *three* seconds results, not one second. This totally
> distracted from your actual issue! ;-)
>
> Regarding the approx 0.026 extra seconds:
> For some reason, ffmpeg creates an additional initial audio packet,
> marked with
> side_data_type=Skip Samples
> skip_samples=1105
>
> If those initial samples are skipped, the total length is exactly okay.
> I'm not sure whether ffmpeg does this due to restrictions regaring the
> audio packet size.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
>
> https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmpeg-user&amp;data=02%7C01%7C%7C32e3db916233475c8a6a08d7a1e97653%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637155896408673471&amp;sdata=S6U6WcNUjtJKDeRgurxFnYUsHLV0BbX8yCJANT7HKJA%3D&amp;reserved=0
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

R: R: Generete one second of black video and relative silence audio with the same duration

chanof
Due to
"Related streams do not always have exactly the same duration, for various reasons including codec frame size or sloppy authoring. For that reason, related synchronized streams (e.g. a video and its audio track) should be concatenated at once. The concat filter will use the duration of the longest stream in each segment (except the last one), and if necessary pad shorter audio streams with silence."
FFmpeg documentation

Concat filter process result in different format container duration with tha same input videos depending on the order of concatenation.

So my guess is to insert a final segment with rounded duration for format cantainer and stream to produce a result as i need for my purpose.

Generating a FLAC black/silent video is precise/rounded without  "side_data_type=Skip Samples" segment, i ask if it's possible get the same result with AAC or MP3

Am i totally out of the road?
If yes sorry.
Gian

________________________________
Da: ffmpeg-user <[hidden email]> per conto di Richard Mikesell <[hidden email]>
Inviato: sabato 25 gennaio 2020 23:53
A: FFmpeg user questions <[hidden email]>
Oggetto: Re: [FFmpeg-user] R: Generete one second of black video and relative silence audio with the same duration

unsubscribe


Richard Mikesell


On Sat, Jan 25, 2020 at 4:20 PM Gian Maria Allibrante <[hidden email]>
wrote:

> Thanks Moritz, sorry for the confusion, may ask:
>
>   *   How to remove this audio packet? (i need this trick to concatenate
> videos with total duration multiple of the GOP destined to infinite mpeg
> dash pseudo live loop, mp4box will fail after some cycles with this
> duration dicrepance, it's unable to skip it)
>   *   How you see this information: side_data_type=Skip Samples etc.
>
> Gian
>
> ________________________________
> Da: ffmpeg-user <[hidden email]> per conto di Moritz
> Barsnick <[hidden email]>
> Inviato: sabato 25 gennaio 2020 22:53
> A: FFmpeg user discussions <[hidden email]>
> Oggetto: Re: [FFmpeg-user] Generete one second of black video and relative
> silence audio with the same duration
>
> On Sat, Jan 25, 2020 at 22:26:31 +0000, Gian Maria Allibrante wrote:
> > Hi Moritz, thanks for reply, this one, im always unable to get round
> match duration:
> >
> > echo VIDEO FORMAT CONTAINER DURATION:
> > ffprobe -v error -show_entries format=duration \
> >   -of default=noprint_wrappers=1:nokey=1 output.mp4
> > echo VIDEO STREAM DURATION:
> > ffprobe -v error -select_streams v:0 -show_entries stream=duration \
> >   -of default=noprint_wrappers=1:nokey=1 output.mp4
>
> Ah, I think I understand now. You are trying to get the same duration
> from the container as from the video stream.
>
> Honestly, I was looking for a totally different problem:
>
> > > VIDEO FORMAT CONTAINER DURATION: 3.026000
> > > VIDEO STREAM DURATION: 3.000000
>
> You showed us *three* seconds results, not one second. This totally
> distracted from your actual issue! ;-)
>
> Regarding the approx 0.026 extra seconds:
> For some reason, ffmpeg creates an additional initial audio packet,
> marked with
> side_data_type=Skip Samples
> skip_samples=1105
>
> If those initial samples are skipped, the total length is exactly okay.
> I'm not sure whether ffmpeg does this due to restrictions regaring the
> audio packet size.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmpeg-user&amp;data=02%7C01%7C%7C53797f48200642db939908d7a1f2f889%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637155937243041785&amp;sdata=fyx8HMPOzOSBnK59h6Q0EAXmscqqd6EwQYPGJUBqkZU%3D&amp;reserved=0
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmpeg-user&amp;data=02%7C01%7C%7C53797f48200642db939908d7a1f2f889%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637155937243051794&amp;sdata=Lo4vH55iWNXVrUzhQpSvXENd8UCYHwIwGe774tJy8lg%3D&amp;reserved=0
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmpeg-user&amp;data=02%7C01%7C%7C53797f48200642db939908d7a1f2f889%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637155937243051794&amp;sdata=Lo4vH55iWNXVrUzhQpSvXENd8UCYHwIwGe774tJy8lg%3D&amp;reserved=0

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".