Re: [FFmpeg-user] concatenating files in FFMPEG causing the wrong file length

2020-10-08 Thread Philip Orrill
I'm getting further thank you for your patience.

It feels like the home stretch now.

I run the command and it half works. It runs some but errors at the end.

It seems to suggest it has patched some items. But then says a directory
does not exist.

Do I need to specify a directory instead of ?

patching file fftools/ffmpeg.c
Hunk #1 succeeded at 4435 (offset 48 lines).
Hunk #2 succeeded at 4470 (offset 48 lines).
Hunk #3 succeeded at 4510 (offset 51 lines).
patching file fftools/ffmpeg.h
Hunk #2 succeeded at 588 (offset -2 lines).
patching file fftools/ffmpeg_opt.c
Hunk #2 succeeded at 1207 (offset 50 lines).
Hunk #3 succeeded at 3479 (offset 72 lines).
bash: ./configure...: No such file or directory



--
Sent from: http://www.ffmpeg-archive.org/
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] concatenating files in FFMPEG causing the wrong file length

2020-10-08 Thread Philip Orrill
I have downloaded the file from the drive thanks.

I have created a directory called /tmp on my machine and copied the file
into that.

I have the command $ curl -sLO
https://ffmpeg.org/releases/ffmpeg-4.2.1.tar.gz && tar -zxf
ffmpeg-4.2.1.tar.gz --strip-components=1 && patch -p1 --ignore-whitespace <
/tmp/patch.txt && ./configure...  && make...

This gives me the error:
/tmp/patch.txt: No such file or directory

I assume i'm doing something really silly. 

Thanks for the help again.




--
Sent from: http://www.ffmpeg-archive.org/
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] concatenating files in FFMPEG causing the wrong file length

2020-10-08 Thread Philip Orrill
That makes sense. Sorry my lack of linux showing now.

I have updated the command and now get bash: /tmp/patch.txt "No such file or
directory". Do I need to create the directory and paste in the code you
provided. Or should docker do something to pick it up from git?

Thought it would be best to ask before I create directories I don't need
etc.



--
Sent from: http://www.ffmpeg-archive.org/
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] concatenating files in FFMPEG causing the wrong file length

2020-10-08 Thread Philip Orrill
Hi
I now have a ubuntu instance running and have installed docker. I ran the
little hello world app they give and that ran.

I ran the command you gave $ curl -sLO
https://ffmpeg.org/releases/ffmpeg-$4.2.1.tar.gz && tar -zxf
ffmpeg-$4.2.1.tar.gz --strip-components=1 && path -p1 --ignore-whitespace <
/tmp/patch.txt && ./configure... && make...

This gives an error that

gzip: stdin: not in gzip format
tar: child returned status 1
tar: Error is not recoverable: existing now 

Have I missed installing something?

Thanks again




--
Sent from: http://www.ffmpeg-archive.org/
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] concatenating files in FFMPEG causing the wrong file length

2020-10-07 Thread Philip Orrill
Thanks a lot for the details. 
I am busy with some other bits at the moment but will look at this a bit
later and give it a go.

I posted this not expecting to hear back this quick.

I do seem to have some commands that seem to fix the timing on the video
(but the audio gets muddled).

If this patch fixes it then I might not need this. I just want to sanity
check my understanding.

My fix that seems to work for video is to run this on each segment:

*-y -r {fps} -use_wallclock_as_timestamps 1 -i {video} -vf scale=1920:-1 -r
{fps} -c:a copy*

My understanding is this tells the segment how many fps should be on the
input and resets the timestamps. The output will then set the scale and
regenerate the file to be the expected fps.

When this is run on all the files and then concatenated it seems to be the
expected result.

I don't know if this actually changes the pts and if this will be a "full
fix" or if this is more putting a plaster over the issue.

If I can get your suggestion running and it works then that would be a much
cleaner result.





--
Sent from: http://www.ffmpeg-archive.org/
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] concatenating files in FFMPEG causing the wrong file length

2020-10-07 Thread Philip Orrill
Thanks for the fast reply.

I am quite new to the FFMPEG source code world. I have version 4.2.3. I am
on windows and used chocolatey to get a build initially. The command doesn't
exist (which i'm not surprised about since you said it was a patch).

I have visual studio and cloned the branch from git.

How do I apply the patch?

Do I need to get the code changes that you displayed from git. Copy them
into the code and re-compile?

How can I find the change-set on github? I can see the added and removed
lines from what you provided. 

I feel like i'm more likely to make a mistake copying and pasting like that
then taking the code from git.

I want to make sure I am on the right page to test this fix:
1) Get source code.
2) Override existing code with the code provided in the patch.
3)Recompile ffmpeg
4) test

Does that sound correct?
Thanks again





--
Sent from: http://www.ffmpeg-archive.org/
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] concatenating files in FFMPEG causing the wrong file length

2020-10-07 Thread Philip Orrill
Hi there

I have an input coming from an rtsp source in 2 second increments to convert
to a HLS stream. The stream itself seems fine. However I do sometimes get
the warning:

*Non-monotonous DTS in output stream 0:0*

my current command for obtaining the stream is 

*-stimeout 6000 -y -rtsp_transport tcp -use_wallclock_as_timestamps 1 -i
{url} -c:v copy -hls_segment_type mpegts -hls_time 2 -hls_list_size 5 -f hls
output.m3u8*

The idea was to then concatenate these together to get a full file. However
the concatenation generates a file with a very different length. I may do a
10 minute video. When concatenated this comes out to be 15 minutes or more.

I figured this was due to the warnings. I thought I could process each
segment and re-generate the timestamps. I know all my files are around 2
second long for instance. So re-generate and then concatenate.

I am so far having no luck.

*I have tried a few different commands below are some examples:*

*Reset timestamps* -i "D:\TestFiles\output18.ts" -c:v libx264 -crf 17
-preset veryfast -reset_timestamps 1 "D:\TestFiles\output18_new.ts"

*setting framerate and fflags* -i "D:\TestFiles\output18.ts" -r 20 -c:v
libx264 -preset veryfast -g 20 -fflags +genpts "D:\TestFiles\output18.mp4"

*Vsync and wall clock* -i "D:\TestFiles\output18.ts" -r 20
-use_wallclock_as_timestamps 1 -c:v libx264 -preset veryfast -vsync drop
"D:\TestFiles\output18.mp4"

The files are generated and I can concatenate them but the time is still off
by a lot.

Interestingly even when converting a single file from just a ts to an mp4
the files changes more then I expect.

For example the file size goes from 260KB to 694KB

I have done a lot of tests and they all seem to produce slightly different
wrong results.

Here is an example from FFPROBE on the 2 files I have run.

*ts file*
ffprobe version git-2019-11-11-20c5f4d Copyright (c) 2007-2019 the FFmpeg
developers
  built with gcc 9.2.1 (GCC) 20191010
  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libdav1d --enable-libbluray --enable-libfreetype
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va
--enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
--enable-libopenmpt --enable-amf
  libavutil  56. 35.101 / 56. 35.101
  libavcodec 58. 61.100 / 58. 61.100
  libavformat58. 34.101 / 58. 34.101
  libavdevice58.  9.100 / 58.  9.100
  libavfilter 7. 66.100 /  7. 66.100
  libswscale  5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc55.  6.100 / 55.  6.100
Input #0, mpegts, from 'D:\TestFiles\output18.ts':
  Duration: 00:00:01.99, start: 38.121067, bitrate: 1034 kb/s
  Program 1
Metadata:
  service_name: Media Presentation
  service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt709, progressive), 1920x1080, 20 fps, 24.92 tbr, 90k tbn, 40
tbc

*MP4*
ffprobe version git-2019-11-11-20c5f4d Copyright (c) 2007-2019 the FFmpeg
developers
  built with gcc 9.2.1 (GCC) 20191010
  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libdav1d --enable-libbluray --enable-libfreetype
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va
--enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
--enable-libopenmpt --enable-amf
  libavutil  56. 35.101 / 56. 35.101
  libavcodec 58. 61.100 / 58. 61.100
  libavformat58. 34.101 / 58. 34.101
  libavdevice58.  9.100 / 58.  9.100
  libavfilter 7. 66.100 /  7. 66.100
  libswscale  5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc55.  6.100 / 55.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\TestFiles\output18.mp4':
  Metadata:
major_brand : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder :