[FFmpeg-user] Getting right color correction for jpeg output

2018-03-06 Thread Bjorn Roche
Hey all,

I'm trying to produce JPEG thumbnails of movies and gifs. I am scaling them
to a particular size, which requires letter boxing them, and I noticed that
the black letterbox I use isn't always black. It works fine when converting
to other formats.

I assume this has something to do with RBG/YUV or YUV Range conversion, but
I'm not fluent in how FFmpeg handles color conversions and haven't found
too much documentation. Here is an example command line I'm using:

ffmpeg -i source.gif -frames 1 -pix_fmt yuvj420p -filter_complex
'[0:v]scale=360:360,pad=width=640:height=360:x=640-trunc(iw*min(360/iw\,360/ih)/4)*2:y=360-trunc(ih*min(640/iw\,360/ih)/4)*2:color=black'
-sws_flags lanczos -y -f singlejpeg out.jpg

I also tried yuv420p which works for mp4.

Thanks for any help!

bjorn

-- 


Bjorn Roche

Sr. Video Pipeline Engineer

bj...@giphy.com
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Quicktime - Specify a Movie Header timescale of 24000

2018-03-06 Thread Mark Burton
On 7 Mar 2018, at 00:24, Carl Eugen Hoyos  wrote:
> Could you elaborate a little?
> What kind of issues?
> 
> Does it help if you edit MOV_TIMESCALE in libavformat/movenc.h?

The files are being used in software (Conformalizer) that seeks to specific 
points in the Quicktime file, but with the FFmpeg generated files, its landing 
on the wrong frame, usually 1 frame out. The original Quicktime files (with a 
timescale of 24000), seek just fine when used in the same software.

With regards to changing the MOV_TIMESCALE in libavformat/movenc.h, I’m afraid 
I’m not an experienced developer unfortunately and don’t have the know how to 
compile ffmpeg myself having made changes. I do think your right though, this 
could well be the answer to the problem. Some Quicktime software sets this 
value to 45000 as its then divisible by 24, 25 and 30fps. Is there is specific 
reason this value is currently being set to 1000? This is not divisible by 24.

Thanks
Mark
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] Quicktime - Specify a Movie Header timescale of 24000

2018-03-06 Thread Carl Eugen Hoyos
2018-03-07 1:13 GMT+01:00, Mark Burton :
> When I run my 24fps Quicktime mov files through an FFmpeg transcode they are
> coming out with a Movie Header timescale of 1000, when the source file has a
> timescale of 24000. This low timescale value is causing issues in some
> professional software tools when seeking the file.

Could you elaborate a little?
What kind of issues?

Does it help if you edit MOV_TIMESCALE in libavformat/movenc.h?

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

[FFmpeg-user] Quicktime - Specify a Movie Header timescale of 24000

2018-03-06 Thread Mark Burton
When I run my 24fps Quicktime mov files through an FFmpeg transcode they are 
coming out with a Movie Header timescale of 1000, when the source file has a 
timescale of 24000. This low timescale value is causing issues in some 
professional software tools when seeking the file.

In my case the source file is a Quicktime with 1 x video track (DNx115) and 1 x 
data track (Timecode). I'm transcoding it to DNx36.

I can force the video timescale to 24000 by adding "-video_track_timescale 
24000", but this does not affect anything other than the video track.

The command is as follows:

ffmpeg -i input.mov -c:v dnxhd -b:v 36M -pix_fmt yuv422p -video_track_timescale 
24000 output.mov

Uncut console output:

ffmpeg version N-90214-gdd3f1e3a11-tessus Copyright (c) 2000-2018 the FFmpeg 
developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg 
--extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl 
--enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm 
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb 
--enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr 
--enable-libspeex --enable-libtheora --enable-libvidstab 
--enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack 
--enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid 
--enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 
--pkg-config-flags=--static --disable-ffplay
  libavutil  56.  8.100 / 56.  8.100
  libavcodec 58. 13.102 / 58. 13.102
  libavformat58. 10.100 / 58. 10.100
  libavdevice58.  2.100 / 58.  2.100
  libavfilter 7. 12.100 /  7. 12.100
  libswscale  5.  0.102 /  5.  0.102
  libswresample   3.  0.101 /  3.  0.101
  libpostproc55.  0.100 / 55.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mov':
  Metadata:
major_brand : qt  
minor_version   : 537199360
compatible_brands: qt  
creation_time   : 2018-03-06T10:45:16.00Z
timecode: 01:14:25:22
  Duration: 00:00:30.00, start: 0.00, bitrate: 116392 kb/s
Stream #0:0(eng): Video: dnxhd (DNXHD) (AVdn / 0x6E645641), yuv422p(tv, 
bt709), 1920x1080, 116391 kb/s, SAR 1:1 DAR 16:9, 24 fps, 24 tbr, 24k tbn, 24k 
tbc (default)
Metadata:
  creation_time   : 2018-03-06T10:45:16.00Z
  handler_name: Apple Alias Data Handler
  encoder : Avid DNxHD Codec
Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
  creation_time   : 2018-03-06T10:45:20.00Z
  handler_name: Apple Alias Data Handler
  timecode: 01:14:25:22
Stream mapping:
  Stream #0:0 -> #0:0 (dnxhd (native) -> dnxhd (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'output.mov':
  Metadata:
major_brand : qt  
minor_version   : 537199360
compatible_brands: qt  
timecode: 01:14:25:22
encoder : Lavf58.10.100
Stream #0:0(eng): Video: dnxhd (DNXHD) (AVdn / 0x6E645641), yuv422p, 
1920x1080 [SAR 1:1 DAR 16:9], q=2-1024, 36000 kb/s, 0.04 fps, 24k tbn, 24 tbc 
(default)
Metadata:
  creation_time   : 2018-03-06T10:45:16.00Z
  handler_name: Apple Alias Data Handler
  encoder : Lavc58.13.102 dnxhd
frame=  720 fps=151 q=4.0 Lsize=  132482kB time=00:00:29.95 
bitrate=36226.7kbits/s speed=6.28x

I have checked the timescale value in Atom Inspector and can clearly see that 
the mvhd (Movie Header) is changed to 1000 in the output.mov when the input.mov 
was set to 24000.

1000 is too low for accurate seeking.

Using Atom Inspector to manually change this header timescale to 24000 and 
alter the duration fields to what they should be based on this timescale, the 
file works as expected.

Is there anyway to set the Movie Header timescale value as an option in FFmpeg?
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

[FFmpeg-user] segmentation

2018-03-06 Thread Mehrab Azad
hi.
i'm recording a live streaming link with the command below

ffmpeg -loglevel quiet -fflags +igndts -y -i "link" -copyts -c:a aac
-c:v copy -bsf:a aac_adtstoasc -ac 2 -f ssegment -segment_time 10
-segment_format mpegts -strftime 1 C:\%Y%m%d%H%M%S.ts

then i will make an .m3u8 file manually out of these ts files and it works fine.

but sometimes ffmpeg gets stuck ( for any reason, that's not the
question here ) and so i have to rerun the command above.

so my ts files are not sequential ( i lose couple of seconds in the middle)

and when i make the m3u8 file, most players cannot play the m3u8 file
after that ts anymore, but players like VLC have no problem.

i have solved the problem with concating all the ts files in one ts file.
and then convert the file into m3u8 file via ffmpeg with following command:

ffmpeg -fflags +igndts -i C:\joined_files.ts -c copy -hls_list_size 0
C:\test.m3u8

and the problem will be solved and any player can play the new file.

(it is worth mentioning that only when i add -fflags +igndts to the
convert command it will solve the problem,

so i think the problem is with timestamps when i skip some seconds... )

so here's the question:

can i use some other options in my recording ffmpeg command that can
solve the problem?

so i don't have to concat the files and reConvert it via ffmpeg? that
would be awesome. i have ommited igndts and -copyts in the recording
command,

but it didn't made any difference.

thanks.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] YUV to h264 stream

2018-03-06 Thread Moritz Barsnick
On Tue, Mar 06, 2018 at 09:32:11 +0530, Vittalprasad wrote:
> *command:*
> ffmpeg -c:v rawvideo -pix_fmt yuv420p  -s:v 1920x1080 -r 30 -i bb.yuv -vf
> scale=960:540 -c:v h264 out.h264
> 
> *Error:*Cannot load libcuda.so.1
> Error initializing output stream 0:0 -- Error while opening encoder for
> output stream #0:0 - maybe incorrect parameters such as bit_rate, rate,
> width or height
> Conversion failed!

Could you please show us the complete, uncut console output of your
command?

I assume your ffmpeg only supports cuda for encoding to H.264, and your
system does not have the cuda libraries installed.

Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

Re: [FFmpeg-user] normalize

2018-03-06 Thread Moritz Barsnick
Hi Jacky,

On Mon, Mar 05, 2018 at 17:19:24 +0100, JACKY wrote:
> I would like to perform a aac sound normalize with the loudnorm filter
> but let ffmpeg read the first pass log result to perdorm the second pass
> is there a way to do so  on windows ?

As far as I can tell, there is no way (currently) for ffmpeg to re-use
the file from the first pass. You have to take the file's parameters
yourself in order to construct a filter command for the second pass:

http://k.ylo.ph/2016/04/04/loudnorm.html

Also see the quoted scripting example (this is in ruby, but could
easily be done in many scripting languages):
https://gist.github.com/kylophone/84ba07f6205895e65c9634a956bf6d54

Cheers,
Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

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