#428(avformat:new): avisynth generate wrong audio pts
#428: avisynth generate wrong audio pts ----------------------+-------------------------- Reporter: chinshou | Type: defect Status: new | Priority: normal Component: avformat | Version: unspecified Keywords: | Blocked By: Blocking: | Reproduced: 0 Analyzed: 0 | ----------------------+-------------------------- I just found avisynth.c generate very large audio pts. we can use ffplay to play following avs a0=DirectShowSource("1.avi") v1=ImageSource("1.jpg", start=0, end = 14900, fps=30).BilinearResize(320,240) video=FlipVertical(v1) audio=(a0) AudioDubEx(video,audio) From the ffplay console log 18178.97 A-V:18166.132 s:0.0 aq= 314KB vq= 8552KB sq= 0B f=0/0 /0 I noticed that audio pts was very large than video pts.It seems we should remove following code from avisynth_read_packet function pkt->pts = stream->read;<-------------remove this line and correct pts should be pkt->pts = avs->streams[stream_id].read / avs->streams[stream_id].chunck_samples; static int avisynth_read_packet(AVFormatContext *s, AVPacket *pkt) { ... if (av_new_packet(pkt, stream->chunck_size)) return AVERROR(EIO); pkt->stream_index = stream_id; pkt->pts = avs->streams[stream_id].read / avs->streams[stream_id].chunck_samples; res = AVIStreamRead(stream->handle, stream->read, stream->chunck_samples, pkt->data, stream->chunck_size, &read_size, NULL); pkt->pts = stream->read;<-------------remove this line pkt->size = read_size; stream->read += stream->chunck_samples; ... } best regards chinshou -- Ticket URL: <http://avcodec.org/trac/ffmpeg/ticket/428> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#428: avisynth generate wrong audio pts ------------------------+----------------------- Reporter: chinshou | Owner: Type: defect | Status: open Priority: normal | Component: avformat Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced: 0 Analyzed: 0 | ------------------------+----------------------- Changes (by cehoyos): * status: new => open Comment: Please produce your patch with "git diff libavformat/avisynth.c
patchavisynth.diff" and send the resulting file patchavisynth.diff to ffmpeg-devel (or attach it here).
-- Ticket URL: <https://avcodec.org/trac/ffmpeg/ticket/428#comment:1> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#428: avisynth generate wrong audio pts -------------------------------------+------------------------------------ Reporter: chinshou | Owner: Type: defect | Status: open Priority: normal | Component: avformat Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by chinshou): I have upload the patch, besides pts bug fix, this patch also fix the image displayed upside down bug .The upsidedown bug can be reproduced by following avs script ImageSource("Sample1.jpg", start=0, end = 40, fps=25) -- Ticket URL: <https://avcodec.org/trac/ffmpeg/ticket/428#comment:2> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#428: avisynth generate wrong audio pts -------------------------------------+------------------------------------ Reporter: chinshou | Owner: Type: defect | Status: open Priority: normal | Component: avformat Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by cehoyos): The indentation looks wrong, if the setting of pts is really wrong (I don't know, but in your original report you suggest an alternative calculation), please remove the line (do not just outcomment it), and unfortunately, we absolutely require "one patch per issue", so please attach (or send to ffmpeg-devel) one patch for the original (pts) issue and one patch for upside-down. -- Ticket URL: <http://avcodec.org/trac/ffmpeg/ticket/428#comment:3> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#428: avisynth generate wrong audio pts -------------------------------------+------------------------------------ Reporter: chinshou | Owner: Type: defect | Status: open Priority: normal | Component: avformat Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by chinshou): Replying to [comment:3 cehoyos]:
The indentation looks wrong, if the setting of pts is really wrong (I don't know, but in your original report you suggest an alternative calculation), please remove the line (do not just outcomment it), and unfortunately, we absolutely require "one patch per issue", so please attach (or send to ffmpeg-devel) one patch for the original (pts) issue and one patch for upside-down.
I have split the fix to two patches, original avisynth calculate the pts two times, the finally calculation was wrong , so I only delete one line in the pts patch. -- Ticket URL: <http://avcodec.org/trac/ffmpeg/ticket/428#comment:4> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#428: avisynth generate wrong audio pts -------------------------------------+------------------------------------ Reporter: chinshou | Owner: Type: defect | Status: closed Priority: normal | Component: avformat Version: unspecified | Resolution: fixed Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by michael): * status: open => closed * resolution: => fixed Comment: Both patches applied Thanks -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/428#comment:5> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg