FFMpeg: Can't write packet with unknown timestamp

Here you can report any bugs/problems you encounter

FFMpeg: Can't write packet with unknown timestamp

Postby sinancetinkaya » Wed Feb 25, 2015 6:22 pm

ffmpeg transcoded recording with MKV container fails on some channels, probably tv channels that have more than 1 audio pid.
The bug is FFMpeg related but causes SmartDVB malfunctioning. Recordings are broken.
To overcome this issue, -fflags genpts needs to be added before input command
like from this
Code: Select all
%report% -i - -y -analyzeduration 5000000 -vcodec copy -acodec copy -threads 2

to this
Code: Select all
%report% -fflags genpts -i - -y -analyzeduration 5000000 -vcodec copy -acodec copy -threads 2


Code: Select all
ffmpeg started on 2015-02-25 at 16:38:54
Report written to "ffmpeg-20150225-163854.log"
Command line:
"H:\\FTP\\Multimedia\\Encoder\\ffmpeg\\ffmpeg.exe" -report -i - -y -analyzeduration 5000000 -vcodec copy -acodec copy -threads 2 -aspect 16:9 "H:\\DVBRecords\\KANALTURK_2015-2-25_16-38_Elimin Lezzeti.mkv"
ffmpeg version N-67501-g064a237 Copyright (c) 2000-2014 the FFmpeg developers
  built on Nov  9 2014 22:42:33 with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      54. 11.100 / 54. 11.100
  libavcodec     56. 12.100 / 56. 12.100
  libavformat    56. 12.103 / 56. 12.103
  libavdevice    56.  2.100 / 56.  2.100
  libavfilter     5.  2.103 /  5.  2.103
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input file with argument '-'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '5000000'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'copy'.
Reading option '-threads' ... matched as AVOption 'threads' with argument '2'.
Reading option '-aspect' ... matched as option 'aspect' (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)) with argument '16:9'.
Reading option 'H:\DVBRecords\KANALTURK_2015-2-25_16-38_Elimin Lezzeti.mkv' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file -.
Successfully parsed a group of options.
Opening an input file: -.
[mpegts @ 045c3540] Format mpegts probed with size=2048 and score=100
[mpegts @ 045c3540] Before avformat_find_stream_info() pos: 0 bytes read:5000800 seeks:0
[mpegts @ 045c3540] stream=0 stream_type=0 pid=992 prog_reg_desc=
[mpegts @ 045c3540] stream=1 stream_type=0 pid=92e prog_reg_desc=
[mpegts @ 045c3540] stream=2 stream_type=0 pid=8ca prog_reg_desc=
[mpegts @ 045c3540] probing stream 0 pp:2500
[mpegts @ 045c3540] Probe with size=5872, packets=1 detected mp3 with score=25
[mpegts @ 045c3540] probed stream 0
[mp2 @ 0038fa60] Header missing
[mpegts @ 045c3540] probing stream 1 pp:2500
[mpegts @ 045c3540] Probe with size=5872, packets=1 detected mp3 with score=25
[mpegts @ 045c3540] probed stream 1
[mp2 @ 045c21a0] Header missing
[mpegts @ 045c3540] probing stream 2 pp:2500
[mpegts @ 045c3540] Probe with size=204717, packets=1 detected mpegvideo with score=51
[mpegts @ 045c3540] probed stream 2
[mpegts @ 045c3540] max_analyze_duration 5000000 reached at 5016000 microseconds
[mpegts @ 045c3540] After avformat_find_stream_info() pos: 4411796 bytes read:5000800 seeks:0 frames:535
Input #0, mpegts, from 'pipe:':
  Duration: N/A, start: 38648.667589, bitrate: 512 kb/s
    Stream #0:0[0x992], 211, 1/90000: Audio: mp2, 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:1[0x92e], 205, 1/90000: Audio: mp2, 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:2[0x8ca], 119, 1/90000: Video: mpeg2video (Main), yuv420p(tv), 704x576 [SAR 12:11 DAR 4:3], max. 6154 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Successfully opened the file.
Parsing a group of options: output file H:\DVBRecords\KANALTURK_2015-2-25_16-38_Elimin Lezzeti.mkv.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument copy.
Applying option aspect (set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)) with argument 16:9.
Successfully parsed a group of options.
Opening an output file: H:\DVBRecords\KANALTURK_2015-2-25_16-38_Elimin Lezzeti.mkv.
Successfully opened the file.
Overriding aspect ratio with stream copy may produce invalid files
Output #0, matroska, to 'H:\DVBRecords\KANALTURK_2015-2-25_16-38_Elimin Lezzeti.mkv':
  Metadata:
    encoder         : Lavf56.12.103
    Stream #0:0, 0, 1/1000: Video: mpeg2video (mpg2 / 0x3267706D), yuv420p, 704x576 [SAR 16:11 DAR 16:9], q=2-31, max. 6154 kb/s, 25 fps, 1k tbn, 90k tbc
    Stream #0:1, 0, 1/1000: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, 256 kb/s
Stream mapping:
  Stream #0:2 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
[matroska @ 04f36e00] Writing block at offset 682, size 1136, pts 0, dts 0, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 1825, size 768, pts 24, dts 24, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 2600, size 768, pts 48, dts 48, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 3375, size 768, pts 72, dts 72, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 4150, size 768, pts 96, dts 96, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 4925, size 768, pts 120, dts 120, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 5700, size 768, pts 144, dts 144, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 6475, size 768, pts 168, dts 168, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 7250, size 768, pts 192, dts 192, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 8025, size 768, pts 216, dts 216, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 8800, size 768, pts 240, dts 240, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 9575, size 768, pts 264, dts 264, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 10350, size 768, pts 288, dts 288, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 11125, size 768, pts 312, dts 312, duration 24, flags 128
[matroska @ 04f36e00] Starting new cluster at offset 11900 bytes, pts 465dts 345
[matroska @ 04f36e00] Writing block at offset 11916, size 768, pts 336, dts 336, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 12691, size 58117, pts 465, dts 345, duration 40, flags 128
[matroska @ 04f36e00] Writing block at offset 70816, size 768, pts 360, dts 360, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 71591, size 768, pts 384, dts 384, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 72366, size 14344, pts 385, dts 385, duration 40, flags 0
[matroska @ 04f36e00] Writing block at offset 86717, size 768, pts 408, dts 408, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 87492, size 17288, pts 425, dts 425, duration 40, flags 0
[matroska @ 04f36e00] Writing block at offset 104788, size 768, pts 432, dts 432, duration 24, flags 128
[matroska @ 04f36e00] Starting new cluster at offset 105563 bytes, pts 9223372036854775808dts 465
[matroska @ 04f36e00] Writing block at offset 105579, size 768, pts 456, dts 456, duration 24, flags 128
[matroska @ 04f36e00] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
No more output streams to write to, finishing.
[matroska @ 04f36e00] Writing block at offset 106354, size 768, pts 480, dts 480, duration 24, flags 128
[matroska @ 04f36e00] Writing block at offset 107129, size 19496, pts 505, dts 505, duration 40, flags 0
[matroska @ 04f36e00] Writing block at offset 126633, size 22256, pts 545, dts 545, duration 40, flags 0
[matroska @ 04f36e00] end duration = 585
frame=    6 fps=0.0 q=-1.0 Lsize=     145kB time=00:00:00.54 bitrate=2186.1kbits/s   

video:167kB audio:16kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (pipe:):
  Input stream #0:0 (audio): 21 packets read (16496 bytes);
  Input stream #0:1 (audio): 14 packets read (11120 bytes);
  Input stream #0:2 (video): 6 packets read (171053 bytes);
  Total: 41 packets (198669 bytes) demuxed
Output file #0 (H:\DVBRecords\KANALTURK_2015-2-25_16-38_Elimin Lezzeti.mkv):
  Output stream #0:0 (video): 6 packets muxed (171053 bytes);
  Output stream #0:1 (audio): 21 packets muxed (16496 bytes);
  Total: 27 packets (187549 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 045f3900] Statistics: 28 seeks, 43 writeouts
[AVIOContext @ 0038d820] Statistics: 5000800 bytes read, 0 seeks
Conversion failed!
sinancetinkaya
 
Posts: 48
Joined: Wed Aug 11, 2010 10:02 am

Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 7 guests

cron