Can't write packet with unknown timestamp

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

Can't write packet with unknown timestamp

Brian J. Murrell
A piece of software I'm using is trying to remux a file and running
into an error:

$ ffmpeg -f avi -i file:"/tmp/vid.avi" -sn -codec:v:0 copy -flags -global_header -fflags +genpts -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 ac3 -ac 6 -ab 192000  -y "/tmp/vid.mkv"
ffmpeg version 4.0.3 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, avi, from 'file:/tmp/vid.avi':
  Metadata:
    encoder         : Nandub v1.0rc2
  Duration: 00:00:04.00, start: 0.000000, bitrate: 2095 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [SAR 1:1 DAR 45:19], 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (ac3 (native) -> ac3 (native))
Press [q] to stop, [?] for help
[ac3 @ 0x5590061fd340] frame sync error
Error while decoding stream #0:1: Invalid data found when processing input
Output #0, matroska, to '/tmp/vid.mkv':
  Metadata:
    encoder         : Lavf58.12.100
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x304 [SAR 1:1 DAR 45:19], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1, fltp, 192 kb/s
    Metadata:
      encoder         : Lavc58.18.100 ac3
[matroska @ 0x5590061efb00] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[matroska @ 0x5590061efb00] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
frame=    1 fps=0.0 q=-1.0 Lsize=      12kB time=00:00:00.50 bitrate= 197.6kbits/s speed=94.5x    
video:2kB audio:11kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

/tmp/vid.avi can be found at:

https://drive.google.com/file/d/1llf7h51ZwqsodpsPAqW01JjePs1ZxeCd/view?usp=sharing

Any ideas?

Cheers,
b.

P.S. I was going to put this into a trac ticket, but trac doesn't seem
to be sending account verification tokens.

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

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

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can't write packet with unknown timestamp

Moritz Barsnick
On Wed, Feb 13, 2019 at 09:07:35 -0500, Brian J. Murrell wrote:
> $ ffmpeg -f avi -i file:"/tmp/vid.avi" -sn -codec:v:0 copy -flags -global_header -fflags +genpts -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 ac3 -ac 6 -ab 192000  -y "/tmp/vid.mkv"

"-fflags +genpts" is an input option, so it needs to go before the
corresponding "-i input". If you do that, you will still get the other
error (which is likely caused by your file, and perhaps has the same
cause as the missing timestamp):

> [ac3 @ 0x5590061fd340] frame sync error
> Error while decoding stream #0:1: Invalid data found when processing input

And by the way:

> ffmpeg version 4.0.3 Copyright (c) 2000-2018 the FFmpeg developers
>   built with gcc 8 (GCC)

And we recommend to try newest versions first before reporting issues
(git master HEAD preferred) - even though it didn't matter in this
case.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://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: Can't write packet with unknown timestamp

Carl Eugen Hoyos-2
In reply to this post by Brian J. Murrell
2019-02-13 15:07 GMT+01:00, Brian J. Murrell <[hidden email]>:
> A piece of software I'm using is trying to remux a file and running
> into an error:
>
> $ ffmpeg -f avi -i file:"/tmp/vid.avi" -sn -codec:v:0 copy -flags

Unrelated:
Generally, you shouldn't force an input format and certainly
not for avi.

> -global_header -fflags +genpts

You want -fflags +genpts to have an effect on your input
file:
$ ffmpeg -fflags +genpts -i vid.avi

> -vsync -1

Unrelated:
This must be a bad idea with -c copy (or it has no effect).

> -map_metadata -1 -map_chapters -1

> -threads 0 -codec:a:0 ac3 -ac 6 -ab 192000  -y "/tmp/vid.mkv"

-threads 0 is the default, "-ac 6" can be bad, and I strongly
suggest not to re-encode ac3 audio to ac3, even less so with
a higher bitrate.

> ffmpeg version 4.0.3 Copyright (c) 2000-2018 the FFmpeg developers

For future questions, please remember that only current FFmpeg
git head is supported here.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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