<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yassine Qarbal</title>
    <description>The latest articles on DEV Community by Yassine Qarbal (@yassineqarbal).</description>
    <link>https://dev.to/yassineqarbal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F857079%2Fced79a26-c7c8-4255-8c0f-c379a89290e8.jpg</url>
      <title>DEV Community: Yassine Qarbal</title>
      <link>https://dev.to/yassineqarbal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yassineqarbal"/>
    <language>en</language>
    <item>
      <title>Debugging Video Playback Issues with FFprobe and FFmpeg</title>
      <dc:creator>Yassine Qarbal</dc:creator>
      <pubDate>Tue, 03 Nov 2026 14:42:24 +0000</pubDate>
      <link>https://dev.to/yassineqarbal/debugging-video-playback-issues-with-ffprobe-and-ffmpeg-2656</link>
      <guid>https://dev.to/yassineqarbal/debugging-video-playback-issues-with-ffprobe-and-ffmpeg-2656</guid>
      <description>&lt;p&gt;A video plays perfectly on a laptop but fails on an Android TV. The audio works, yet the screen stays black. Another file plays, but freezes every few seconds.&lt;/p&gt;

&lt;p&gt;It's tempting to blame the network or the media player immediately. However, playback failures often involve several independent layers: container parsing, codec compatibility, hardware decoding, frame timestamps, and network delivery.&lt;/p&gt;

&lt;p&gt;This tutorial demonstrates a reproducible workflow for diagnosing these problems using two open-source tools: &lt;strong&gt;FFprobe and FFmpeg&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Understand the Video Playback Pipeline
&lt;/h2&gt;

&lt;p&gt;Before investigating a failure, it helps to understand what happens between receiving a media file and displaying an image.&lt;/p&gt;

&lt;p&gt;A simplified playback pipeline looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Media file or network stream
          |
          v
    Container parser
          |
          v
    Audio/video tracks
          |
          v
     Video decoder
          |
          v
    Frame renderer
          |
          v
       Display
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A failure at any stage can affect playback.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A container parser may fail to recognize a track.&lt;/li&gt;
&lt;li&gt;The device may not support the video's codec profile.&lt;/li&gt;
&lt;li&gt;Hardware decoding may be unavailable.&lt;/li&gt;
&lt;li&gt;Incorrect timestamps may cause irregular presentation.&lt;/li&gt;
&lt;li&gt;Network interruptions may prevent the player from receiving sufficient data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The challenge is identifying which layer is responsible.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Inspect the Video Before Changing Player Settings
&lt;/h2&gt;

&lt;p&gt;Start by collecting the media's technical properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffprobe &lt;span class="nt"&gt;-v&lt;/span&gt; error &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-show_entries&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nv"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;index,codec_name,profile,width,height,pix_fmt,level,r_frame_rate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-of&lt;/span&gt; json input.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command reports information such as the video codec, profile, resolution, pixel format, and nominal frame rate.&lt;/p&gt;

&lt;p&gt;For example, you might encounter these properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"codec_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"hevc"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"profile"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Main 10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"width"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3840&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2160&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"pix_fmt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yuv420p10le"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"r_frame_rate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"60/1"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This describes a 4K HEVC video using a 10-bit pixel format at a nominal 60 frames per second.&lt;/p&gt;

&lt;p&gt;Not every television supporting HEVC can decode that combination.&lt;/p&gt;

&lt;p&gt;A device might support HEVC Main at 1080p while lacking support for Main 10 at 4K60.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key principle:&lt;/strong&gt; codec support alone does not guarantee compatibility. Resolution, profile, bit depth, level, and frame rate also matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Separate Container Problems from Codec Problems
&lt;/h2&gt;

&lt;p&gt;MP4, MKV, and MPEG-TS are containers, not video compression formats.&lt;/p&gt;

&lt;p&gt;A container can hold multiple audio and video streams, subtitles, and metadata.&lt;/p&gt;

&lt;p&gt;If you suspect a container issue, try remuxing the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg &lt;span class="nt"&gt;-i&lt;/span&gt; input.mkv &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-map&lt;/span&gt; 0:v:0 &lt;span class="nt"&gt;-map&lt;/span&gt; 0:a? &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt; copy output.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This copies the selected streams without re-encoding them, provided the destination container supports their codecs and stream configurations.&lt;/p&gt;

&lt;p&gt;If the command fails, inspect the error before switching containers or codecs.&lt;/p&gt;

&lt;p&gt;If remuxing resolves playback, the original problem may involve container support, metadata, or the application's demultiplexer.&lt;/p&gt;

&lt;p&gt;If the file still fails, continue investigating the decoding stage.&lt;/p&gt;

&lt;p&gt;Remuxing does not magically make an unsupported video codec compatible with a television.                                            ### Additional Reading: H.264 vs H.265 Compatibility&lt;/p&gt;

&lt;p&gt;Understanding the difference between AVC and HEVC is useful when diagnosing playback failures. Compression efficiency, device capabilities, and codec profiles can all influence whether a video plays correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Reading: H.264 vs H.265 Compatibility
&lt;/h3&gt;

&lt;p&gt;Understanding the difference between AVC and HEVC is useful when diagnosing playback failures. Compression efficiency, device capabilities, and codec profiles can all influence whether a video plays correctly.&lt;/p&gt;

&lt;p&gt;For a broader comparison of these technologies, see this &lt;a href="https://euroiptvmax.com/h264-vs-h265-iptv/" rel="noopener noreferrer"&gt;French-language technical guide to H.264 and H.265&lt;/a&gt;, which covers bitrate efficiency, hardware compatibility, and common Smart TV playback issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Test Whether the Video Can Be Decoded
&lt;/h2&gt;

&lt;p&gt;FFmpeg can attempt to decode the video without generating an output file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg &lt;span class="nt"&gt;-v&lt;/span&gt; warning &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-i&lt;/span&gt; input.mp4 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-map&lt;/span&gt; 0:v:0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-f&lt;/span&gt; null -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful for detecting certain bitstream corruption and decoding errors.&lt;/p&gt;

&lt;p&gt;However, successful software decoding on a computer does not prove that the video will work with a television's hardware decoder.&lt;/p&gt;

&lt;p&gt;The computer and television may use entirely different decoding implementations.&lt;/p&gt;

&lt;p&gt;To investigate a specific television, compare the stream properties with the device's documented media capabilities.&lt;/p&gt;

&lt;p&gt;For Android-based devices, the Android media format documentation provides a useful starting point.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Build a Compatible Test File
&lt;/h2&gt;

&lt;p&gt;When testing a playback issue, avoid changing multiple settings simultaneously.&lt;/p&gt;

&lt;p&gt;One controlled experiment is to encode a short H.264 test file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg &lt;span class="nt"&gt;-i&lt;/span&gt; input.mp4 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-t&lt;/span&gt; 30 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-map&lt;/span&gt; 0:v:0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-map&lt;/span&gt; 0:a:0? &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt;:v libx264 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-pix_fmt&lt;/span&gt; yuv420p &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-profile&lt;/span&gt;:v high &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-level&lt;/span&gt;:v 4.0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-vf&lt;/span&gt; &lt;span class="s2"&gt;"scale=1280:720"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-r&lt;/span&gt; 30 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-c&lt;/span&gt;:a aac &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-b&lt;/span&gt;:a 128k &lt;span class="se"&gt;\&lt;/span&gt;
  test-h264.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This generates a short 720p test file with H.264 video and AAC audio, assuming the required encoders are available.&lt;/p&gt;

&lt;p&gt;It provides a more conservative compatibility baseline, although it is not guaranteed to work on every device.&lt;/p&gt;

&lt;p&gt;Now compare both versions on the same player:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Observation&lt;/th&gt;
&lt;th&gt;Possible interpretation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Both videos fail&lt;/td&gt;
&lt;td&gt;Investigate player configuration, container handling, or rendering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;H.264 works; original HEVC fails&lt;/td&gt;
&lt;td&gt;Investigate HEVC decoder capability&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Both play locally but fail over the network&lt;/td&gt;
&lt;td&gt;Investigate transport, buffering, or stream delivery&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Video works but audio fails&lt;/td&gt;
&lt;td&gt;Inspect the audio codec and output configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These observations narrow the investigation. They are not definitive diagnoses by themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Investigate Frame Timestamps
&lt;/h2&gt;

&lt;p&gt;Not every stuttering problem is caused by insufficient bandwidth.&lt;/p&gt;

&lt;p&gt;Media timestamps determine when decoded frames should be presented.&lt;/p&gt;

&lt;p&gt;Inspect video packet timestamps using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffprobe &lt;span class="nt"&gt;-v&lt;/span&gt; error &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-select_streams&lt;/span&gt; v:0 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-show_entries&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nv"&gt;packet&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;pts_time,dts_time,duration_time &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-of&lt;/span&gt; &lt;span class="nv"&gt;csv&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;p&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0 input.mp4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pay attention to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Missing timestamps.&lt;/li&gt;
&lt;li&gt;Unexpected gaps in presentation time.&lt;/li&gt;
&lt;li&gt;Irregular packet durations.&lt;/li&gt;
&lt;li&gt;Discontinuities near playback failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember that decoding timestamps and presentation timestamps serve different purposes.&lt;/p&gt;

&lt;p&gt;For codecs using frame reordering, their values may legitimately differ.&lt;/p&gt;

&lt;p&gt;Likewise, variable-frame-rate video can contain uneven frame intervals without being broken.&lt;/p&gt;

&lt;p&gt;The goal is to distinguish expected behavior from actual timestamp corruption.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Diagnose Network Playback Separately
&lt;/h2&gt;

&lt;p&gt;For HTTP-based video delivery, a successful local playback test can help separate network problems from decoding problems.&lt;/p&gt;

&lt;p&gt;Common network-related symptoms include buffering, delayed startup, and intermittent interruptions.&lt;/p&gt;

&lt;p&gt;Useful checks include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Compare local and network playback of an equivalent media sample.&lt;/li&gt;
&lt;li&gt;Observe response failures and connection interruptions.&lt;/li&gt;
&lt;li&gt;Measure available throughput over time.&lt;/li&gt;
&lt;li&gt;Check whether the stream bitrate exceeds sustainable network capacity.&lt;/li&gt;
&lt;li&gt;Inspect player buffering events and error logs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A download speed test alone is insufficient.&lt;/p&gt;

&lt;p&gt;Network performance can change during playback, and a high average bandwidth does not rule out packet loss, latency spikes, or unstable delivery.&lt;/p&gt;

&lt;p&gt;For adaptive streaming protocols, inspect playlist and segment behavior as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Use a Repeatable Debugging Checklist
&lt;/h2&gt;

&lt;p&gt;Here is a compact process that can be integrated into a QA workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;START
  |
  v
Inspect media metadata
  |
  v
Verify container and codecs
  |
  v
Run FFmpeg decoding test
  |
  v
Create conservative H.264 sample
  |
  v
Compare playback on target device
  |
  +--&amp;gt; Local failure:
  |      inspect decoder and renderer
  |
  +--&amp;gt; Network-only failure:
  |      inspect delivery and buffering
  |
  v
Record results and reproduce
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For reliable comparisons, record the device model, operating system version, media player version, video profile, and exact error.&lt;/p&gt;

&lt;p&gt;That information is often more valuable than a vague report saying that a video "doesn't work."&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Video playback debugging becomes much easier when each layer is tested independently.&lt;/p&gt;

&lt;p&gt;FFprobe reveals what the media contains. FFmpeg helps identify decoding errors, test container changes, and create controlled comparison samples.&lt;/p&gt;

&lt;p&gt;The most important lesson is to avoid treating every black screen or frozen video as a network problem.&lt;/p&gt;

&lt;p&gt;A systematic approach saves time, makes bugs reproducible, and provides developers with evidence they can actually act on.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ffmpeg.org/ffprobe.html" rel="noopener noreferrer"&gt;FFprobe official documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ffmpeg.org/ffmpeg.html" rel="noopener noreferrer"&gt;FFmpeg official documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.android.com/media/platform/supported-formats" rel="noopener noreferrer"&gt;Android supported media formats&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Disclosure: This article was prepared with AI writing assistance. Technical commands and recommendations should be validated against the target device and media before production use.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F68j4ql2wxiw2qpfc0djl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F68j4ql2wxiw2qpfc0djl.png" alt=" " width="619" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>software</category>
      <category>tools</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
