[FFmpeg-user] stream copy video / re-enc audio

Mike F paziu at yahoo.com
Sat Sep 28 07:01:18 CEST 2013



Hello all,

I am trying to convert audio in a few avi files from ac3 to aac+, and stream copy the video:


# ffmpeg -y -i "$1" -c:a libaacplus -b:a 64k -ac 2 -threads 12 -c:v copy -map 0:0 -map 0:1  -c:s copy -strict experimental "$1".mkv -v info

( ffmpeg version 2.0 )

it fails with:

[matroska @ 0x17d2440] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument 

it works just fine if the container is changed to mp4 
this is true for most/all avi/xvid files:




avi example:

General
Format                                   : AVI
Format/Info                              : Audio Video Interleave
Format profile                           : OpenDML
Format settings                          : rec
File size                                : 1.36 GiB
Duration                                 : 1h 44mn
Overall bit rate                         : 1 864 Kbps
Writing application                      : AVI-Mux GUI 1.17.8.3, Feb 15 201019:43:50

Video
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Advanced Simple at L5
Format settings, BVOP                    : 2
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (H.263)
Muxing mode                              : Packed bitstream
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 1h 44mn
Bit rate                                 : 1 411 Kbps
Width                                    : 720 pixels
Height                                   : 400 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.204
Stream size                              : 1.03 GiB (76%)
Writing library                          : XviD 1.2.1 (UTC 2008-12-04)

Audio
ID                                       : 1
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : 2000
Duration                                 : 1h 44mn
Bit rate mode                            : Constant
Bit rate                                 : 448 Kbps
Channel count                            : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 334 MiB (24%)
Alignment                                : Aligned on interleaves
Interleave, duration                     : 64 ms (1.53 video frames)
Interleave, preload duration             : 512 ms

=================================================================
  Duration: 01:44:37.50, start: 0.000000, bitrate: 1865 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x400 [SAR 1:1 DAR 9:5], 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 448 kb/s
=================================================================

and 2nd question:
Is it possible to encode audio only using SMP? - from what I noticed it only runs single-threaded...

when both audio/video ( x264 ) transcoding is started, it uses N threads, as specified.


Thank you,

Mike



More information about the ffmpeg-user mailing list