0

Videos have same framerate (30fps), same video encoders / containers (aVC- mp4), same audio encoders (aac LC) sampling audio rate 44.1hz, and frame rate in audio (43.066 FPS (1024 SPF)) and same dimensions.

Produced video is 304 hours while it is not more than 1 hour long.

What is going wrong? I have found that the error message appears when videos do not have same properties. Here what is wrong?

tried:

fmpeg -f concat -safe 0 -i vids.txt -crf 15  -vcodec libx265 -vb 20M   -c:a copy  -fflags +genpts output.mp4

ffmpeg -safe 0 -f concat -segment_time_metadata 1 -i vids.txt -vf select=concatdec_select -af aselect=concatdec_select,aresample=async=1 out.mp4

a lot of errors of type:

PTS 16594278, next:2245566668 invalid dropping st:0

when try to encode them individually, produce black screen

ffmpeg  -i "vid 1.mp4"  -crf 15  -vcodec libx265 -vb 20M   -c:a copy  -fflags +genpts output_1.mp4

1st video

General
Complete name                            : /Queen of Swords (ep6 - part1) [_p0aHIi2DPw].mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 30.6 MiB
Duration                                 : 9 min 0 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 475 kb/s
Frame rate                               : 30.000 FPS
Encoded date                             : 2014-03-02 15:56:52 UTC
Tagged date                              : 2014-03-02 15:56:52 UTC

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Constrained [email protected]
Format settings                          : 1 Ref Frames
Format settings, CABAC                   : No
Format settings, Reference frames        : 1 frame
Format settings, GOP                     : M=1, N=60
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 9 min 0 s
Bit rate                                 : 377 kb/s
Maximum bit rate                         : 1 065 kb/s
Width                                    : 474 pixels
Height                                   : 352 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.075
Stream size                              : 24.2 MiB (79%)
Tagged date                              : 2014-03-02 15:56:59 UTC
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 9 min 0 s
Bit rate mode                            : Variable
Bit rate                                 : 96.0 kb/s
Maximum bit rate                         : 104 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 6.18 MiB (20%)

2nd video

Complete name                            : /Queen of Swords - Duel With A Stranger (ep6 - part2) [xHvbA6ZZGug].mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 31.7 MiB
Duration                                 : 9 min 0 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 493 kb/s
Frame rate                               : 30.000 FPS
Encoded date                             : 2014-02-06 16:05:26 UTC
Tagged date                              : 2014-02-06 16:05:26 UTC

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Constrained [email protected]
Format settings                          : 1 Ref Frames
Format settings, CABAC                   : No
Format settings, Reference frames        : 1 frame
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 9 min 0 s
Source duration                          : 9 min 0 s
Bit rate                                 : 394 kb/s
Maximum bit rate                         : 1 000 kb/s
Width                                    : 474 pixels
Height                                   : 352 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.079
Stream size                              : 25.4 MiB (80%)
Source stream size                       : 25.4 MiB (80%)
Tagged date                              : 2014-02-06 16:05:35 UTC
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 9 min 0 s
Bit rate mode                            : Variable
Bit rate                                 : 96.0 kb/s
Maximum bit rate                         : 103 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 6.18 MiB (19%)

3rd video

Complete name                            : /Queen of Swords - Duel With A Stranger (ep6 - part3) [USaMBAMlLYY].mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 25.3 MiB
Duration                                 : 9 min 0 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 393 kb/s
Frame rate                               : 30.000 FPS
Encoded date                             : 2018-10-30 06:40:01 UTC
Tagged date                              : 2018-10-30 06:40:01 UTC

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Constrained [email protected]
Format settings                          : 1 Ref Frames
Format settings, CABAC                   : No
Format settings, Reference frames        : 1 frame
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 9 min 0 s
Bit rate                                 : 295 kb/s
Width                                    : 474 pixels
Height                                   : 352 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.059
Stream size                              : 19.0 MiB (75%)
Title                                    : ISO Media file produced by Google Inc. Created on: 10/29/2018.
Encoded date                             : 2018-10-30 06:40:01 UTC
Tagged date                              : 2018-10-30 06:40:01 UTC
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 9 min 0 s
Bit rate mode                            : Variable
Bit rate                                 : 96.0 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 6.18 MiB (24%)

UPDATE: Using libx264 fixed the problem. But with libx265 not.

 for avii in *.mp4;   do ffmpeg -i "$avii" -vcodec  libx264 -vb 20M  -r 30  -crf 17  -c:a copy -fflags +genpts "ab_${avii//.*}.avi"   ; done;

fmpeg -fflags +igndts -f concat -safe 0  -i vids.txt -c copy  -shortest finalvideo_.mp4

UPDATE 2: When the format of downloaded videos (if supported) is webm there is no such problem. They can be concetrated.

UPDATE 3: The following command results

 ffmpeg -fflags +genpts -i "Queen of Swords.webm"  -vcodec  libx264 -vb 20M  -r 30  -crf 17  -c:a copy  -fflags +genpts output1.avi

Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted

when "-c:a copy" is removed, then it runs without problem. Why?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.