LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2014, 09:59 PM   #1
eskimoroll
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Rep: Reputation: Disabled
FFMpeg - help with fade filter losing quality


Hello,

I am losing a tons of quality applying the fade filter to a segment using FFMpeg. My videos are unplayable once Youtube gets through with them.

The command I am using:
Quote:
ffmpeg -y -i temp1.ts -filter:v "fade=t=in:st=0:d=0.5,fade=t=out:st=60:d=0.5" -preset medium -c:v libx264 "temp1c.ts"
temp1.ts= 158mb
temp1c.ts= 9mb

I tried playing with the -qp param, but the video's color becomes too vivid, almost incoherent.

This is the file I want to add the fade to:
Quote:
$ ffprobe temp1.ts
ffprobe version 2.3.git-1ace957 Copyright (c) 2007-2014 the FFmpeg developers
built on Jul 26 2014 20:25:06 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-x11grab --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr
libavutil 52. 92.101 / 52. 92.101
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 49.100 / 55. 49.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.102 / 4. 11.102
libavresample 1. 3. 0 / 1. 3. 0
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mpegts, from 'temp1.ts':
Duration: 00:00:06.37, start: 1.400000, bitrate: 199407 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High 4:4:4 Predictive) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
This is the information from the result file:
Quote:
$ ffprobe temp1c.ts
ffprobe version 2.3.git-1ace957 Copyright (c) 2007-2014 the FFmpeg developers
built on Jul 26 2014 20:25:06 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-x11grab --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr
libavutil 52. 92.101 / 52. 92.101
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 49.100 / 55. 49.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.102 / 4. 11.102
libavresample 1. 3. 0 / 1. 3. 0
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mpegts, from 'temp1c.ts':
Duration: 00:00:06.37, start: 1.466667, bitrate: 12181 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
 
Old 08-13-2014, 10:16 PM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
In your ffmpeg command, you are not setting a bitrate.

So your original file starts out being:

Code:
Duration: 00:00:06.37, start: 1.400000, bitrate: 199407 kb/s
but ends up being:

Code:
 Duration: 00:00:06.37, start: 1.466667, bitrate: 12181 kb/s
So you are going from 199407 kbps to 12181 kbps

Hardcode in a bitrate:
Code:
ffmpeg -y -i temp1.ts -filter:v "fade=t=in:st=0:d=0.5,fade=t=out:st=60:d=0.5" -preset medium -c:v libx264 -b:v 35000k "temp1c.ts"
and see what happens.
 
1 members found this post helpful.
Old 08-13-2014, 11:11 PM   #3
eskimoroll
LQ Newbie
 
Registered: Aug 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
I tried it and there was a slight improvement, but my videos are still grainy.

Note: The only other operation I do after building temp1c.ts (of which it is included) is the following command for the final file:

Quote:
ffmpeg -y -f concat -i final-file-list.txt -c:a libmp3lame -b:v 35000k -qp 14 -c:v libx264 "output.mp4"
Thanks for your help
 
Old 08-13-2014, 11:13 PM   #4
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
Up the bitrate. You are starting out with 200MBps. So in theory you could even try v:b 199000k and see what happens.
 
Old 06-16-2023, 06:36 AM   #5
MsSimilian
LQ Newbie
 
Registered: Jun 2023
Posts: 1

Rep: Reputation: 0
Faced the same issue while working with audio files. For me the best option is to convert audio files first to lossless .wav, do all things that I need to do and then covert them back to .mp3 or other lossy formats. This is the way that is used in audio editing apps and the most gentle way to work with audio or video files
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lower video quality with ffmpeg? anon109 Linux - General 4 03-01-2013 02:20 AM
About ffmpeg pad filter option Dave_P General 3 11-08-2011 03:19 PM
[SOLVED] How to cut the video without losing quality? Mr. Alex Linux - Software 1 10-23-2011 06:50 AM
Graphics: PNG (or whatever) to GIF (without losing quality) robbbert Linux - Software 5 03-28-2007 03:07 PM
Beryl/AIGLX Slight Stuttter in Fade-Ins/Fade-Outs Abomb Linux - Software 0 01-26-2007 11:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration