1

I am playing the .mp4 h264 video in exoplayer with defaultExtractor. Video is not seekable. When i seek the video it goes to start everytime i want to seek it. Others MP4 videos plays fine without any issue . Help me I am beginner of exoplayer .

Waqas Yousaf
  • 264
  • 4
  • 13
  • Most likely the `moov` atom is at the end of the file. See https://stackoverflow.com/questions/50914503/fastest-way-to-add-movflags-faststart-to-an-mp4-using-ffmpeg-leaving-everythi and try to move it to the start by using any of the commands in the answer and try again:) – Rudolfs Bundulis Jan 21 '20 at 09:49
  • Sorry for late Mr.Bundulis. I observe the video and find that after some time passage it get the total duration but seeking is not possible . I am still confused about its behavior . – Waqas Yousaf Jan 21 '20 at 11:39
  • well it is either the moov atom or your http server does not support byte range requests when the browser starts to do the seeking. Check the browsers network tab to see what requests are made when you click to seek (most likely with the range header) and what answer is returned. Did you even try the movflags from the question I pasted? – Rudolfs Bundulis Jan 21 '20 at 11:44
  • Mr.Bundulis I am talking about the video player android app . – Waqas Yousaf Jan 21 '20 at 12:07
  • Still, did you try to process the mp4 file you have as described in the linked question? – Rudolfs Bundulis Jan 21 '20 at 12:10
  • I have used the many of tools online to find to process it to find the difference between mp4 and mp4 h264 but they all are failed . Mr Rudolfs can you suggest me the solution – Waqas Yousaf Jan 22 '20 at 05:15
  • mp4 is a container, h.264 is a codec. When you say "many tools" - did you try the answers from the linked question? – Rudolfs Bundulis Jan 22 '20 at 10:16
  • i have tried that answer to convert the video to mp4 by using ffmpeg but this is not the perfect solution . Many of the videos are of this type . After converting the video was fine playing but i want to handle that kind of video in my app that it can play that codec as others doing like vlc , mx and many other projects .\ – Waqas Yousaf Jan 22 '20 at 12:04
  • What do you mean with "convert"? Your question says "I am playing the .mp4 h264", so you already have an mp4? What do you need to convert? The linked question shows how to move the moov atom, not convert the file. – Rudolfs Bundulis Jan 22 '20 at 12:09
  • i am facing problems in executing the commands through ffmpeg.execute(new String[]{"ffmpeg","-i",path,"-","c","copy","-map","0","-","movflags","+","faststart",path}, new FFmpegExecuteResponseHandler()) . Failed every time . – Waqas Yousaf Jan 23 '20 at 07:44
  • Anyone here ??? – Waqas Yousaf Jan 24 '20 at 06:19
  • i have tested the video and find the solution that this video is just the mpeg-ts file . And not seekable after increasing the tsdurationreader.timebar_search_bites . I solved my problem.Thank You for contributing . – Waqas Yousaf Jan 28 '20 at 13:25
  • Does this answer your question? [Fastest way to add -movflags +faststart to an MP4 using FFMPEG, leaving everything else as-is](https://stackoverflow.com/questions/50914503/fastest-way-to-add-movflags-faststart-to-an-mp4-using-ffmpeg-leaving-everythi) – malat Sep 06 '21 at 10:01

0 Answers0